schema validation
We should add a schema validation thing to find issues like:
- schema definition missing in schema
- to be continued...
Also when validating a Query there should be a meaningful message in case the validation errs due to missing schema declaration. A possible solution might be to initialize the operation definition values with "-1".
I think we should respect the spec here and add fallback behaviour as described in the spec: https://github.com/graphql/graphql-spec/blob/master/spec/Section%203%20--%20Type%20System.md#root-operation-types
Default Root Operation Type Names
While any type can be the root operation type for a GraphQL operation, the type system definition language can omit the schema definition when the query, mutation, and subscription root types are named Query, Mutation, and Subscription respectively.
Likewise, when representing a GraphQL schema using the type system definition language, a schema definition should be omitted if it only uses the default root operation type names.
This example describes a valid complete GraphQL schema, despite not explicitly including a schema definition. The Query type is presumed to be the query root operation type of the schema.
Same goes for the builtin scalars: https://github.com/graphql/graphql-spec/blob/master/spec/Section%203%20--%20Type%20System.md#scalars
Built-in Scalars
GraphQL provides a basic set of well-defined Scalar types. A GraphQL server should support all of these types, and a GraphQL server which provide a type by these names must adhere to the behavior described below.
Should support extensions, e.g. in case of custom directives. So extensions should be able to define their own rules/hooks to extend the validation rules manually.
up
it is still an issue
We could get an error in the playground when some type is missing in a schema, but there is no error message in the console
Browser error message:
playground.js:1 Uncaught Error: Invalid or incomplete schema, unknown type: RequestResult. Ensure that a full introspection query is used in order to build a client schema.