Skip to main content

validate

Validates documents against a schema and looks for deprecated usage.. See the official GraphQL Inspector documentation for details.

Installation#

yarn global add @graphql-cli/validate

Usage#

graphql validate [DOCUMENTS] [SCHEMA]

Arguments#

argumentdescriptiondefault
DOCUMENTSA glob pattern that points to GraphQL Documents / Operationsdocuments property in GraphQL Config file
SCHEMAA pointer to a schemaschema property in GraphQL Config file

Options#

optionaliasdescriptiondefault
--deprecated-dFail on deprecated usagefalse
--noStrictFragmentsDo not fail on duplicated fragment namesfalse
--apolloSupport Apollo directives (@client and @connection)false
--keepClientFieldsKeeps the fields with @client, but removes @client directive from them - works only with combination of --apollofalse
--maxDepthFail when operation depth exceeds maximum depthundefined
--require-rRequire a module[]
--token-tAn access tokenundefined
--header-hSet HTTP header (--header 'Auth: Basic 123')undefined