-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix schema transformation and Field Visibility for complex deletion cases #4209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Test Results 327 files ±0 327 suites ±0 5m 7s ⏱️ ±0s Results for commit 6b77ff8. ± Comparison against base commit 2766087. This pull request removes 213 and adds 191 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Change GraphQLSchema.additionalTypes from Set<GraphQLType> to Set<GraphQLNamedType> for improved type safety. All types that can be added as additional types are named types, so this makes the API more precise.
| * @see Builder#additionalTypes(Set) | ||
| */ | ||
| public Set<GraphQLType> getAdditionalTypes() { | ||
| public Set<GraphQLNamedType> getAdditionalTypes() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change. Just in case you didnt realise.
| public Builder additionalTypes(Set<? extends GraphQLNamedType> additionalTypes) { | ||
| this.additionalTypes.addAll(additionalTypes); | ||
| return this; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also a breaking change
| public Builder additionalType(GraphQLNamedType additionalType) { | ||
| this.additionalTypes.add(additionalType); | ||
| return this; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and again - thats ok - just pointing it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well .. they never contained not named types so far. Technically breaking, but I think nobody ever used it to add [Foo] instead of Foo
|
I have labelled it as a breaking change because it it. Its in the minor category of possible impact but none the less Java breaking |
For certain complex schema deletion cases the current schema transformer fails.
This PR introduces a new transform method
transformSchemaWithDeleteswhich should be used specifically for these cases.The FieldVisibilityTransformer is also changed internally to use this new method.
The existing schema transformation was unchanged to keep existing behavior as the new
transformSchemaWithDeleteschanges slightly the traversal behavior.The original bug was first reported in #4133, but we had additional reports after.