-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Missing errors on invalid types in development #136
Comments
Ohhh I see ... this is tough. Firstly, a String is a valid entry for field type. It gets looked up in the global namespace to find the type object. Secondly, type resolution starts with QueryType & MutationType and follows the tree, going from field to field, finding all the types included in the schema. So any types which aren't connected to those roots (like Options? Hm...
A |
I think providing some help loading the graph directory is a great idea. I've had issues surrounding loading all the type definitions in the right order, it can get a bit hairy with a larger application. If they're all preloaded, something like this would definitely cause an error I think. As far as the |
No, it's just a way to add additional types which can't be discovered by crawling fields from the schema roots. (Specifically, that's types who are only connected to the schema because they're members of an interface.) |
I think I've done all I can here: "floating" types can (must) be added with |
If a type is not defined correctly, i.e.:
field :name, "This is missing a type argument"
the app will run fine in development with no errors as long as the type is not queried. In production however, all queries will fail (rightly so).FWIW I am using Puma in production and pre-loading the app. Here is a small Rails app that reproduces the problem: https://github.com/dphaener/graphql-test
The text was updated successfully, but these errors were encountered: