Implemented a safe way to build a schema #374
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially addresses these issues #348 #344 #340 #201 #313 #309.
The main goal of this PR is to avoid re-declaration errors during the schema build and not to fail completely in such cases:
This situation occurs quite often when the schema is divided into several files and is collected during the build or in runtime. For example, this can often be found when using graphql-modules.
It doesn't fix error messages though, they are still pretty confusing and useless because they don't help you to find where the re-declaration is located. I think we should completely ignore them from graphql-java and implement custom inspections, which could be configured or even disabled by the user.
Also we should support resolving multiple declarations using
PsiPolyVariantReference
.