#[non_exhaustive]pub enum GraphQLParseError {
Syntax(String),
MissingOperation,
UnknownOperation(String),
AmbiguousOperation(usize),
EmptySelection,
ValueNestingTooDeep(usize),
}Expand description
Errors that can occur when parsing a GraphQL query.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Syntax(String)
Failed to parse GraphQL syntax.
MissingOperation
No query or mutation operation found in the document.
UnknownOperation(String)
The requested operationName matches no operation in the document
(GraphQL § 6.1 GetOperation).
AmbiguousOperation(usize)
The document defines more than one operation and the request named none
(GraphQL § 6.1 GetOperation).
EmptySelection
Selection set has no fields.
ValueNestingTooDeep(usize)
GraphQL value nesting exceeds the allowed depth limit.
Implementations§
Source§impl GraphQLParseError
impl GraphQLParseError
Sourcepub const fn is_operation_selection(&self) -> bool
pub const fn is_operation_selection(&self) -> bool
Whether this is a request error about which operation to run, rather than a syntax error in the document.
The distinction is what the client sees: a document that does not parse
is a PARSE_ERROR, but operationName: "Nope" against a document that
parses perfectly is a VALIDATION_ERROR. Reporting the second as a
parse failure sends the client hunting for a syntax mistake that is not
there.
Trait Implementations§
Source§impl Debug for GraphQLParseError
impl Debug for GraphQLParseError
Source§impl Display for GraphQLParseError
impl Display for GraphQLParseError
Source§impl Error for GraphQLParseError
impl Error for GraphQLParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()