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 type collecting for indirect references by andimarek · Pull Request #4213 · graphql-java/graphql-java

Conversation

@andimarek

@andimarek andimarek commented Jan 22, 2026

Copy link
Copy Markdown
Member

Fix GraphQLTypeCollectingVisitor to traverse children of indirect strong references

The fixDanglingReplacedTypes method now recursively traverses types discovered through indirect strong references (types referenced via replaced type references). Previously, when an indirect strong reference was found, it was added to the result but its children were not traversed, causing types referenced by the indirect reference to be missing from the schema.

The fix:

  • For each newly discovered indirect strong reference, start a new traversal
  • Reuse the same visitor instance to ensure duplicate type detection works
  • Clear indirectStrongReferences before each traversal to capture new ones
  • Recursively call fixDanglingReplacedTypes to handle nested indirect references

Added tests:

  • indirect type references should have their children collected
  • nested indirect type references requiring multiple traversals
  • redefined types are caught when introduced during transformation

Sorry, something went wrong.

Uh oh!

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

All reactions
@andimarek
Fix GraphQLTypeCollectingVisitor to traverse children of indirect str…
fc78f2f
…ong references

The fixDanglingReplacedTypes method now recursively traverses types discovered
through indirect strong references (types referenced via replaced type references).
Previously, when an indirect strong reference was found, it was added to the result
but its children were not traversed, causing types referenced by the indirect
reference to be missing from the schema.

The fix:
- For each newly discovered indirect strong reference, start a new traversal
- Reuse the same visitor instance to ensure duplicate type detection works
- Clear indirectStrongReferences before each traversal to capture new ones
- Recursively call fixDanglingReplacedTypes to handle nested indirect references

Added tests:
- indirect type references should have their children collected
- nested indirect type references requiring multiple traversals
- redefined types are caught when introduced during transformation
@github-actions

github-actions Bot commented Jan 22, 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 8s ⏱️ ±0s
5 248 tests +3  5 239 ✅ +2  9 💤 +1  0 ❌ ±0 
5 337 runs  +3  5 328 ✅ +2  9 💤 +1  0 ❌ ±0 

Results for commit fc78f2f. ± Comparison against base commit e860aff.

This pull request removes 196 and adds 175 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@43e9089 delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@3c5dbdf8 delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@352c44a8 delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@60bbacfc delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@65b97f47 delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@255eaa6b delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@44e93c1f delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@7efd28bd delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@472a11ae delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 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@644ded04 delegate=graphql.AssertTest@9b21bd3 owner=graphql.AssertTest@9b21bd3 thisObject=graphql.AssertTest@9b21bd3 resolveStrategy=0 directive=0 parameterTypes=[class java.lang.Object] maximumNumberOfParameters=1 bcw=null>, expectedMessage: error arg1, #0]
…
This pull request skips 1 test.
graphql.schema.fetching.LambdaFetchingSupportTest ‑ different class loaders induce certain behaviours

♻️ 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
andimarek merged commit 6c2cdb0 into master Jan 22, 2026
7 checks passed

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

1 participant

@andimarek
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.