Validate documents
Validates documents against a schema and looks for deprecated usage.
Usage
Run the following command:
graphql-inspector validate DOCUMENTS SCHEMA
Example
graphql-inspector validate './documents/*.graphql' http://localhost:3000/graphql
Arguments
Flags
-d, --deprecated
- Fail on deprecated usage (default: false)--noStrictFragments
- Do not fail on duplicated fragment names (default: false)--apollo
- Support Apollo directives (@client and @connection) (default: false)--keepClientFields <b>
- Keeps the fields with @client, but removes @client directive from them - works only with combination of--apollo
(default: false)--maxDepth <n>
- Fail when operation depth exceeds maximum depth (default: false)-r, --require <s>
- require a module-t, --token <s>
- an access token-h, --header <s>
- set http header (`--header 'Auth: Basic 123')
Output
A list of errors found in documents. A second list with every deprecated usage.
When there's at least one error or a deprecated usage (when --deprecated flag is enabled), process fails.