Skip to main content

libgraphql_parser/
definition_kind.rs

1/// The kind of definition found in a GraphQL document.
2///
3/// Used for error reporting and programmatic categorization of definitions.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum DefinitionKind {
6    /// `schema { ... }` or `extend schema { ... }`
7    Schema,
8
9    /// Type definitions: `type`, `interface`, `union`, `enum`, `scalar`,
10    /// `input`, or their `extend` variants.
11    TypeDefinition,
12
13    /// `directive @name on ...`
14    DirectiveDefinition,
15
16    /// Operations: `query`, `mutation`, `subscription`, or anonymous `{ ... }`
17    Operation,
18
19    /// `fragment Name on Type { ... }`
20    Fragment,
21}