Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
night-crawlr opened this issue Nov 30, 2023 · 0 comments
Labels
keep-open Tells Stale Bot to keep PRs and issues open

Comments

@night-crawlr
Copy link

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

@dondonz dondonz added the keep-open Tells Stale Bot to keep PRs and issues open label Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep-open Tells Stale Bot to keep PRs and issues open
Projects
None yet
Development

No branches or pull requests

3 participants
@dondonz @night-crawlr and others