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 — SchemaUtil#replaceTypeReferences Issue When trying to re-built a GraphqlSchema · Issue #3384 · graphql-java/graphql-java

SchemaUtil#replaceTypeReferences Issue When trying to re-built a GraphqlSchema #3384

New issue
Copy link
New issue
Copy link
Closed
#4390
Closed
SchemaUtil#replaceTypeReferences Issue When trying to re-built a GraphqlSchema#3384
#4390
Copy link
Labels
keep-openTells Stale Bot to keep PRs and issues openTells Stale Bot to keep PRs and issues open

Description

@night-crawlr
night-crawlr
opened on Nov 30, 2023
Issue body actions

Describe the bug

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

SchemaTraverser schemaTraverser = new SchemaTraverser(schemaElement -> schemaElement.getChildrenWithTypeReferences().getChildrenAsList());

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

Activity

  1. dondonz
    added
    keep-openTells Stale Bot to keep PRs and issues openTells Stale Bot to keep PRs and issues open
    on Feb 11, 2024
  2. dondonz
    added a commit that references this issue on Mar 14, 2026

    Fix 5 open issues: subscription memory leak, cyclical directives, dup…

    2bfc07b
  3. dondonz
    added a commit that references this issue on Apr 3, 2026

    fix: handle already-resolved type references when rebuilding schema

    This issue will close once commit a31127a is merged into the 'master' branch.
    a31127a
  4. andimarek
    closed this as completedin #4390on May 20, 2026
  5. andimarek commented on May 20, 2026

    @andimarek
    andimarek
    on May 20, 2026
    Member
    More actions

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    keep-openTells Stale Bot to keep PRs and issues openTells Stale Bot to keep PRs and issues open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.