graphql-kotlin
graphql-kotlin copied to clipboard
Using SchemaGeneratorHooks to modify type names breaks data fetchers
Library Version 6.4.1
Describe the bug
When using SchemaGeneratorHooks
to modify the type names at runtime (yes I know I shouldn't do this but I have a good reason to) the generated schema has the new modified type names but codeRegistry
still contains data fetchers for original type names.
This leads to runtime exceptions and the only fix is to add new mappings to the codeRegistry
from within the hook.
To Reproduce An example repo to reproduce the bug (with my workaround for it): https://github.com/HarshDaga/graphql-kotlin-schema-generator-bug
Expected behavior
codeRegistry
should be populated using the type names coming from the hook instead of the original type names.
Modifying the type names within SchemaGeneratorHooks
will not lead to runtime exceptions.