GeezerVison is showing github.com — Fix schema transformation and Field Visibility for complex deletion cases by andimarek · Pull Request #4209 · graphql-java/graphql-java
Conversation
andimarek
commented
Jan 19, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
For certain complex schema deletion cases the current schema transformer fails.
This PR introduces a new transform method transformSchemaWithDeletes which 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 transformSchemaWithDeletes changes slightly the traversal behavior.
The original bug was first reported in #4133, but we had additional reports after.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
alf reacted with hooray emoji
Test Results
327 files ±0 327 suites ±0 5m 7s ⏱️ ±0s
5 230 tests +2 5 222 ✅ +3 8 💤 - 1 0 ❌ ±0
5 319 runs +2 5 311 ✅ +3 8 💤 - 1 0 ❌ ±0
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.
?
, expected: combo-\"\\\b\f\n\r\t, #4]
__schema { types { fields { args { type { name fields { name }}}}}}
__schema { types { fields { type { name fields { name }}}}}
__schema { types { inputFields { type { inputFields { name }}}}}
__schema { types { interfaces { fields { type { interfaces { name } } } } } }
__schema { types { name} }
__type(name : "t") { name }
a1: __schema { types { name} }
a1: __type(name : "t") { name }
…
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure23@37b56ac7 delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure24@5399f6c5 delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertFalse with different number of error args but false does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_21prov0_closure25@4fe64d23 delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure20@10db6131 delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure21@6c6017b9 delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertFalse with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_20prov0_closure22@4730e0f0 delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertNotNull with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure3@2abe9173 delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
graphql.AssertTest ‑ assertNotNull with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure4@354e7004 delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2, #1]
graphql.AssertTest ‑ assertNotNull with different number of error args throws assertions [toRun: <graphql.AssertTest$__spock_feature_0_5prov0_closure5@6f231ced delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1 arg2 arg3, #2]
graphql.AssertTest ‑ assertNotNull with different number of error args with non null does not throw assertions [toRun: <graphql.AssertTest$__spock_feature_0_6prov0_closure6@376c7d7d delegate=graphql.AssertTest@43f9dd56 owner=graphql.AssertTest@43f9dd56 thisObject=graphql.AssertTest@43f9dd56 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
…
♻️ This comment has been updated with latest results.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
andimarek
changed the title
add specific transform method for deletion cases
Fix schema transformation for complex deletion cases
Jan 19, 2026
andimarek
changed the title
Fix schema transformation for complex deletion cases
Fix schema transformation and Field Visibility for complex deletion cases
Jan 19, 2026
|
|
* @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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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
|
andimarek reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|