postrust_graphql/
error.rs

1//! GraphQL-specific error types.
2
3use thiserror::Error;
4
5/// Errors that can occur during GraphQL operations.
6#[derive(Debug, Error)]
7pub enum GraphQLError {
8    #[error("Schema generation failed: {0}")]
9    SchemaGeneration(String),
10
11    #[error("Schema error: {0}")]
12    SchemaError(String),
13
14    #[error("Query execution failed: {0}")]
15    QueryExecution(String),
16
17    #[error("Invalid filter: {0}")]
18    InvalidFilter(String),
19
20    #[error("Type mapping error: {0}")]
21    TypeMapping(String),
22
23    #[error("Authentication required")]
24    AuthenticationRequired,
25
26    #[error("Database error: {0}")]
27    Database(String),
28}
29
30pub type Result<T> = std::result::Result<T, GraphQLError>;