Linter rulesGraphQLno-mixed-definitions
no-mixed-definitions
Since 0.9.0
This rule checks that a document holds either a schema or operations, not both.
Rule Details
Schemas and operations have different owners and lifecycles: schema files are served, operation files are compiled into clients. Each operation and fragment of a document with type system definitions is reported.
Configuration
This rule has no options.
version: "1.0"
commands:
lint:
graphql:
rules:
no-mixed-definitions: warning
The rule can be disabled for a node and everything nested in it with an # apigenie-lint-disable no-mixed-definitions comment on the node, or for a whole file with the comment at the top of the file, separated from the first definition by a blank line. It applies to definitions.
Examples
Good.
type Query { me: User }
Bad. The linter reports Operation 'Me' should not be in a document with type system definitions.
type Query { me: User }
query Me { me { id } }