Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

Conversation

@andimarek
Copy link
Member

@andimarek andimarek commented Jan 19, 2026

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

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.

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 andimarek changed the title add specific transform method for deletion cases Fix schema transformation for complex deletion cases Jan 19, 2026
@andimarek 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() {
Copy link
Member

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;
}
Copy link
Member

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;
}
Copy link
Member

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

Copy link
Member Author

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

@bbakerman bbakerman added the breaking change requires a new major version to be relased label Jan 19, 2026
@bbakerman
Copy link
Member

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 andimarek merged commit c225c59 into master Jan 20, 2026
5 checks passed
@andimarek andimarek added this to the 26.x breaking changes milestone Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change requires a new major version to be relased

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants