nakago_async_graphql/errors.rs
1use async_graphql::{Response, ServerError};
2use async_graphql_axum::GraphQLResponse;
3
4/// Convert a Nakago injection error into a GraphQL response
5pub fn to_graphql_response(error: nakago::Error) -> GraphQLResponse {
6 Response::from_errors(vec![ServerError::new(error.to_string(), None)]).into()
7}