Skip to content

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