Skip to content

Schema vs SchemaDocument #188

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

Open
dmjio opened this issue Jun 29, 2018 · 1 comment
Open

Schema vs SchemaDocument #188

dmjio opened this issue Jun 29, 2018 · 1 comment

Comments

@dmjio
Copy link

dmjio commented Jun 29, 2018

Why not unify Schema and SchemaDocument as the same type?

@jml
Copy link
Collaborator

jml commented Jun 29, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants