Skip to main content

libgraphql_parser/
document_kind.rs

1/// The kind of GraphQL document being parsed.
2///
3/// Different document kinds allow different definition types:
4/// - Schema documents: only type system definitions
5/// - Executable documents: only operations and fragments
6/// - Mixed documents: both type system and executable definitions
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8pub enum DocumentKind {
9    /// Schema document: only type system definitions allowed
10    /// (`schema`, `type`, `interface`, `directive`, etc.).
11    Schema,
12
13    /// Executable document: only operations and fragments allowed
14    /// (`query`, `mutation`, `subscription`, `fragment`).
15    Executable,
16
17    /// Mixed document: both type system and executable definitions allowed.
18    /// This is useful for tools that process complete GraphQL codebases.
19    Mixed,
20}