You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SchemaUtil#replaceTypeReferences Issue When trying to re-built a GraphqlSchema #3384
graphql.schema.impl.SchemaUtil#replaceTypeReferences is breaking , when we are trying to re build the schema.
Issue occurring case :
When we traverse through a GraphqlObject node which has its interfaces resolved (replacedInterfaces!=null), those interfaces wont get registered into typeMap , as we are using
at later step when replaceTypeReferences tries to resolve graphqlobejcts interface types at method graphql.schema.GraphQLTypeResolvingVisitor#visitGraphQLObjectType of a resolved GraphqlObject node ( which have its resolved interfaces ) . it fails to resolve as there is not such interface registered in typeMap.
To Reproduce
one case where its necessary to rebuild an already built schema is while trying to create a readOnly Schema GraphQLSchema.newSchema(schema).mutation((GraphQLObjectType) null).build()
The root cause was that schema rebuild type collection traverses the original type-reference child view via getChildrenWithTypeReferences(), while already-built schema accessors can return resolved strong references such as implemented interfaces and union member types. After removing a root type, those resolved references could still be reachable through a remaining schema element but missing from the rebuilt type map, leading to the NPE in GraphQLTypeResolvingVisitor.
#4390 extends GraphQLTypeCollectingVisitor to collect those resolved object/interface/union relationships and adds regression coverage for direct schema rebuild and SchemaTransformer.transformSchemaWithDeletes(...). The PR merged with the required CI checks green.
Activity
Fix 5 open issues: subscription memory leak, cyclical directives, dup…
fix: handle already-resolved type references when rebuilding schema
andimarek commentedon May 20, 2026
Fixed by #4390.
The root cause was that schema rebuild type collection traverses the original type-reference child view via
getChildrenWithTypeReferences(), while already-built schema accessors can return resolved strong references such as implemented interfaces and union member types. After removing a root type, those resolved references could still be reachable through a remaining schema element but missing from the rebuilt type map, leading to the NPE inGraphQLTypeResolvingVisitor.#4390 extends
GraphQLTypeCollectingVisitorto collect those resolved object/interface/union relationships and adds regression coverage for direct schema rebuild andSchemaTransformer.transformSchemaWithDeletes(...). The PR merged with the required CI checks green.