FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix schema transformation and Field Visibility for complex deletion cases by andimarek · Pull Request #4209 · graphql-java/graphql-java · GitHub

Fix schema transformation and Field Visibility for complex deletion cases - #4209

Merged
andimarek merged 8 commits into
masterfrom
schema-transform-delete-add-types
Jan 20, 2026
Merged

Fix schema transformation and Field Visibility for complex deletion cases#4209
andimarek merged 8 commits into
masterfrom
schema-transform-delete-add-types

Conversation

andimarek commented Jan 19, 2026
edited
Loading

Copy link
Copy Markdown
Member

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 Bot commented Jan 19, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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 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() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

also a breaking change

public Builder additionalType(GraphQLNamedType additionalType) {
this.additionalTypes.add(additionalType);
return this;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

and again - thats ok - just pointing it out

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 added the breaking change requires a new major version to be relased label Jan 19, 2026

Copy link
Copy Markdown
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 merged commit c225c59 into master Jan 20, 2026
5 checks passed
andimarek added this to the 26.x breaking changes milestone Jan 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL