Open dmjio opened 6 years ago
Because they are different things.
SchemaDocument
is an AST-level representation. The type allows everything that's syntactically valid, and values are constructed with a parser.
Schema
is a known valid GraphQL schema. It is guaranteed to be fully validated, and excludes many syntactically valid values that are not valid GraphQL.
This means the parser only has to worry about syntax, the validator only has to worry about validation, and the executor doesn't have to worry about dodgy input.
What lead you to ask the question?
Why not unify
Schema
andSchemaDocument
as the same type?