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

Add support for unused types for all dictionary types #737

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

timward60
Copy link
Contributor

@timward60 timward60 commented Mar 7, 2023

Resolves #736

Checklist

  • Pull requests follows the contribution guide
  • New or modified functionality is covered by tests

Description

For unused type handling in SchemaClassScanner, when processing unused types, allow the dictionary to inject all types (EnumTypeDefinition, InterfaceTypeDefinition, etc) in addition to ObjectTypeDefinition.

Without this, we see an issue that the injecting enum that is being used by a missing field resolver custom implementation (we support preview only GraphQL schema where we fake data) results in an exception being thrown by the graphql-java-tools:

graphql.kickstart.tools.SchemaError: Expected type 'MyEnum' to be a GraphQLInputType, but it wasn't!  Was a type only permitted for object types incorrectly used as an input type, or vice-versa?  at
graphql.kickstart.tools.SchemaParser.determineInputType(SchemaParser.kt:409)  at 
graphql.kickstart.tools.SchemaParser.determineInputType(SchemaParser.kt:389)  at 
graphql.kickstart.tools.SchemaParser.createArgument(SchemaParser.kt:302) at 
graphql.kickstart.tools.SchemaParser.createField(SchemaParser.kt:292)

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

Successfully merging this pull request may close these issues.

Support unused types for all dictionary types
2 participants