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

Bootstrap.generateGraphQLSchema fails when generic type with two distinct resolutions exists in the schema #429

Closed
velias opened this issue Sep 29, 2020 · 1 comment

Comments

@velias
Copy link
Collaborator

velias commented Sep 29, 2020

Follow up on generic support added in #281
Bootstrap.generateGraphQLSchema() fails when generic type with two distinct resolutions (eg. GenericType_Date and GenericType_Integer) are present in the Schema.

Caused by: graphql.AssertException: type GenericType_Date not found in schema
	at graphql.Assert.assertNotNull(Assert.java:16)
	at graphql.schema.GraphQLTypeResolvingVisitor.handleTypeReference(GraphQLTypeResolvingVisitor.java:55)
	at graphql.schema.GraphQLTypeResolvingVisitor.visitGraphQLTypeReference(GraphQLTypeResolvingVisitor.java:50)
	at graphql.schema.GraphQLTypeReference.accept(GraphQLTypeReference.java:55)
	at graphql.schema.SchemaTraverser$TraverserDelegateVisitor.enter(SchemaTraverser.java:72)
	at graphql.util.Traverser.traverse(Traverser.java:144)
	at graphql.schema.SchemaTraverser.doTraverse(SchemaTraverser.java:59)
	at graphql.schema.SchemaTraverser.depthFirst(SchemaTraverser.java:51)
	at graphql.schema.SchemaTraverser.depthFirst(SchemaTraverser.java:38)
	at graphql.schema.SchemaUtil.replaceTypeReferences(SchemaUtil.java:113)
	at graphql.schema.GraphQLSchema$Builder.buildImpl(GraphQLSchema.java:568)
	at graphql.schema.GraphQLSchema$Builder.build(GraphQLSchema.java:546)
	at io.smallrye.graphql.bootstrap.Bootstrap.generateGraphQLSchema(Bootstrap.java:143)
	at io.smallrye.graphql.bootstrap.Bootstrap.bootstrap(Bootstrap.java:103)
	at io.smallrye.graphql.cdi.producer.GraphQLProducer.initialize(GraphQLProducer.java:41)

Problem is there because Bootstrap uses java class name as a key in internal collecting maps (interfaceMap, typeMap, inputMap) so only one GraphQL type per java class is preserved.
I'm working on PR with patch (use GraphQL type name in the map).

velias added a commit to velias/smallrye-graphql that referenced this issue Sep 29, 2020
…ype with

two distinct resolutions exists in the schema
@velias
Copy link
Collaborator Author

velias commented Sep 29, 2020

PR #430 created

phillip-kruger added a commit that referenced this issue Oct 1, 2020
#429 - patched Bootstrap.generateGraphQLSchema when generic type with
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants