GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@andimarek andimarek commented Jan 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alf reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@andimarek
add specific transform method for deletion cases
0464f19
@github-actions

github-actions Bot commented Jan 19, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

andimarek added 7 commits January 19, 2026 17:02
@andimarek
explanation
bfd8789
@andimarek
Test to showcase bug
49dca7e
@andimarek
Refactor additionalTypes to use GraphQLNamedType
44aeed6
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
simplify
fe82d4f
@andimarek
handle deletion case much better on the schema transformer level
7c55747
@andimarek
handle deletion case much better on the schema transformer level
7553d76
@andimarek
add AGENTS.md
6b77ff8
@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
@andimarek andimarek mentioned this pull request Jan 19, 2026
SchemaTransformer.transformSchema produces schema with dangling reference to deleted type #4133
Closed
bbakerman
bbakerman reviewed Jan 19, 2026
View reviewed changes
Comment thread src/main/java/graphql/schema/GraphQLSchema.java
* @see Builder#additionalTypes(Set)
*/
public Set<GraphQLType> getAdditionalTypes() {
public Set<GraphQLNamedType> getAdditionalTypes() {

@bbakerman bbakerman Jan 19, 2026

Copy link
Copy Markdown
Member

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.

All reactions
bbakerman
bbakerman reviewed Jan 19, 2026
View reviewed changes
Comment thread src/main/java/graphql/schema/GraphQLSchema.java
public Builder additionalTypes(Set<? extends GraphQLNamedType> additionalTypes) {
this.additionalTypes.addAll(additionalTypes);
return this;
}

@bbakerman bbakerman Jan 19, 2026

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bbakerman
bbakerman reviewed Jan 19, 2026
View reviewed changes
Comment thread src/main/java/graphql/schema/GraphQLSchema.java
public Builder additionalType(GraphQLNamedType additionalType) {
this.additionalTypes.add(additionalType);
return this;
}

@bbakerman bbakerman Jan 19, 2026

Copy link
Copy Markdown
Member

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.

All reactions

@andimarek andimarek Jan 19, 2026

Copy link
Copy Markdown
Member Author

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.

All reactions
bbakerman
bbakerman approved these changes Jan 19, 2026
View reviewed changes
@bbakerman bbakerman added the breaking change requires a new major version to be relased label Jan 19, 2026
@bbakerman

bbakerman commented 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 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andimarek
andimarek merged commit c225c59 into master Jan 20, 2026
5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@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

Reviewers

@bbakerman bbakerman bbakerman approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

breaking change requires a new major version to be relased

Projects

None yet

Milestone

26.x is a breaking change release (ot...

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@andimarek @bbakerman
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.