Fix schema transformation and Field Visibility for complex deletion cases#4209
Fix schema transformation and Field Visibility for complex deletion cases#4209
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.
This is a breaking change. Just in case you didnt realise.
| public Builder additionalTypes(Set<? extends GraphQLNamedType> additionalTypes) { | ||
| this.additionalTypes.addAll(additionalTypes); | ||
| return this; | ||
| } |
| public Builder additionalType(GraphQLNamedType additionalType) { | ||
| this.additionalTypes.add(additionalType); | ||
| return this; | ||
| } |
There was a problem hiding this comment.
and again - thats ok - just pointing it out
There was a problem hiding this comment.
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.