Skip to content
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

Schema validation #25

Open
jjergus opened this issue May 10, 2021 · 0 comments
Open

Schema validation #25

jjergus opened this issue May 10, 2021 · 0 comments

Comments

@jjergus
Copy link
Contributor

jjergus commented May 10, 2021

This is distinct from request (query) validation (#10). We need to ensure that all types in the GraphQL schema are well-defined, e.g. things like:

  • there are no 2 types with the same name
  • there are no 2 fields with the same name on an object/interface type
  • object types correctly implement interfaces (mostly enforced by Hack, but there might be additional restrictions that Hack can't check -- e.g. GraphQL arguments are named, so fields on object types must have arguments with names that are consistent with the interface)
  • ...

The spec describes all necessary checks in the Schema and Type sections (search for "Type Validation").

These can be implemented as part of the codegen (we should avoid ever generating an invalid type/schema), there should be no need to do any checks at runtime.

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

1 participant