You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If fields for a GraphQL object type is empty, it'll cause an error to be thrown on the reference GraphQL implementation, so that this is effectively not valid:
I've considered having Schema.schema raise an exception in case of validation errors. Presumably creating a schema is something that happens once at "boot time", so it should be easy to catch invalid schemas with even the most primitive test suite. There are definitely more complex solutions (e.g. add a phantom type parameter to Schema.schema which is either unvalidated or validated -- then you can only execute queries on validated schemas), but I'm not sure it's worth it.
Could you be interested in adding one or more validations?
If
fields
for a GraphQL object type is empty, it'll cause an error to be thrown on the reference GraphQL implementation, so that this is effectively not valid:Perhaps there should be some validation function we can call at runtime to make sure we've constructed a valid GraphQL schema?
The text was updated successfully, but these errors were encountered: