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 'RemoveUnreachableTypes' option in HC 12 breaks BCP (and other graphql IDEs) #4712

Closed
1 task done
Andrej-Peplinski opened this issue Feb 1, 2022 · 0 comments · Fixed by #4917
Closed
1 task done
Assignees
Labels
Area: Type System Issue is related to the Type System 🐛 bug Something isn't working 🌶️ hot chocolate
Milestone

Comments

@Andrej-Peplinski
Copy link

Andrej-Peplinski commented Feb 1, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Using .ModifyOptions(options => options.RemoveUnreachableTypes = true); breaks Banana Pop Cake (and Insomnia).
I have been able to reproduce the issue using HC v.12.5 and v.12.6

Steps to reproduce

  1. Check out the Schema First demo example (from here)
  2. Optionally remove the [UsePaging] attribute from the Query.GetPersons method.
    This is to ensure that the generated schema does not include any auto-generated Int field
    image
  3. Add .ModifyOptions(options => options.RemoveUnreachableTypes = true); to Program.cs
    image
  4. Reproduce the problem by starting the demo application an hopping over to BCP. You should see a spinning doughnut as the fetched schema is not readable. Then open the [F12] Browser tools and see the following error message
    image

Relevant log output

No response

Additional Context?

Digging a bit deeper to the root cause.

First look at the sdl and find that there is only one Int field (in the stream directive):
image

Second find the 'introspection_phase_2' query in the Network tab of the Browser tools:
image
Inspect the response in a tool like e.g. VS Code and you will see that effectively no Int SCALAR type has been defined. However, it's being used in the scalar directive...
image

Third repeat the same steps but this time without the options.RemoveUnreachableTypes option....
image

Product

Hot Chocolate

Version

12.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Type System Issue is related to the Type System 🐛 bug Something isn't working 🌶️ hot chocolate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants