Skip to content

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

Merged
oryan-block merged 6 commits into
graphql-java-kickstart:masterfrom
timward60:timward/unused-types
Oct 2, 2026
Merged

oryan-block merged 6 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

  • 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)

timward60 and others added 3 commits January 27, 2025 15:20
…rfaces and unions

Handling all unused types at once required a dictionary class for types
that would have been discovered by scanning another unused type. Unused
interfaces and unions are now included without a class, and unused enums
missing from the dictionary are only reported as unused instead of failing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 2, 2026

Copy link
Copy Markdown

@oryan-block
oryan-block merged commit b6feaf7 into graphql-java-kickstart:master Oct 2, 2026
6 checks passed
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