Skip to content

Add support for unused types for all dictionary types - #737

Open
timward60 wants to merge 4 commits into
graphql-java-kickstart:masterfrom
timward60:timward/unused-types
Open

Add support for unused types for all dictionary types#737
timward60 wants to merge 4 commits into
graphql-java-kickstart:masterfrom
timward60:timward/unused-types

Conversation

@timward60

@timward60 timward60 commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

Resolves #736

Checklist

  • 拉取请求 follows the contribution guide
  • 新建 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)

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

Support unused types for all dictionary types

2 participants