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

Recursive queries produce invalid schema introspection #191

Closed
smyrick opened this issue Mar 8, 2019 · 2 comments · Fixed by #192
Closed

Recursive queries produce invalid schema introspection #191

smyrick opened this issue Mar 8, 2019 · 2 comments · Fixed by #192
Labels
type: bug Something isn't working

Comments

@smyrick
Copy link
Contributor

smyrick commented Mar 8, 2019

Library Version

0.2.7

Describe the bug

There are GraphQLTypeReferences in the schema when a recursive query like NodeGraphTest is used.

To Reproduce

On the integration test NodeGraphTest, we actually have a failing schema. If you inspect the schema after build, you will notice that the type of Node.parent is GraphQLTypeReference. This should never happen as all schemas should have the full objects.

You can add the following assert to now make a failing test

assertFalse((schema.typeMap["Node"] as? GraphQLObjectType)?.getFieldDefinition("parent")?.type is GraphQLTypeReference)

Expected behavior

There are no GraphQLTypeReference in the code. This is fixed if I use graphql-java 2019-03-07T04-34-55-809a980

@smyrick smyrick added the type: bug Something isn't working label Mar 8, 2019
@smyrick
Copy link
Contributor Author

smyrick commented Mar 8, 2019

@kaqqao
Copy link

kaqqao commented Mar 10, 2019

For what it's worth, I think the issue can be worked around by creating a new GraphQLTypeReference each time. The bug in graphql-java v11 is that it replaces each individual instance only once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants