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

Using SchemaGeneratorHooks to modify type names breaks data fetchers #1775

Open
HarshDaga opened this issue May 15, 2023 · 0 comments
Open
Labels
type: bug Something isn't working

Comments

@HarshDaga
Copy link

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.

@HarshDaga HarshDaga added the type: bug Something isn't working label May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

No branches or pull requests

1 participant