Struct apollo_router::graphql::Error
source ยท #[non_exhaustive]pub struct Error {
pub message: String,
pub locations: Vec<Location>,
pub path: Option<Path>,
pub extensions: Map<ByteString, Value>,
}Expand description
A GraphQL error
as may be found in the errors field of a GraphQL Response.
Converted to (or from) JSON with serde.
Fields (Non-exhaustive)ยง
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.message: StringThe error message.
locations: Vec<Location>The locations of the error in the GraphQL document of the originating request.
path: Option<Path>If this is a field error, the JSON path to that field in Response::data
extensions: Map<ByteString, Value>The optional GraphQL extensions for this error.
Implementationsยง
sourceยงimpl Error
impl Error
sourcepub fn builder<T: Into<String>>() -> NewErrorBuilder<T>
pub fn builder<T: Into<String>>() -> NewErrorBuilder<T>
Returns a builder that builds a GraphQL Error from its components.
Builder methods:
-
.message(impl Into<String>)Required. SetsError::message. -
.locations(impl Into<Vec<Location>>)Optional. Sets the entireVecofError::locations, which defaults to the empty. -
.location(impl Into<Location>)Optional, may be called multiple times. Adds one item at the end ofError::locations. -
.path(impl Into<Path>)Optional. SetsError::path. -
.extensions(impl Into<serde_json_bytes::Map<ByteString,Value>>)Optional. Sets the entireError::extensionsmap, which defaults to empty. -
.extension(impl Into<ByteString>, impl Into<Value>)Optional, may be called multiple times. Adds one item to theError::extensionsmap. -
.build()Finishes the builder and returns a GraphQLError.
Trait Implementationsยง
sourceยงimpl<'de> Deserialize<'de> for Error
impl<'de> Deserialize<'de> for Error
sourceยงfn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
sourceยงimpl From<PlannerError> for Error
impl From<PlannerError> for Error
sourceยงfn from(err: PlannerError) -> Self
fn from(err: PlannerError) -> Self
sourceยงimpl From<WorkerError> for Error
impl From<WorkerError> for Error
sourceยงfn from(err: WorkerError) -> Self
fn from(err: WorkerError) -> Self
sourceยงimpl From<WorkerGraphQLError> for Error
impl From<WorkerGraphQLError> for Error
sourceยงfn from(err: WorkerGraphQLError) -> Self
fn from(err: WorkerGraphQLError) -> Self
sourceยงimpl PartialEq for Error
impl PartialEq for Error
impl Eq for Error
impl StructuralEq for Error
impl StructuralPartialEq for Error
Auto Trait Implementationsยง
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementationsยง
sourceยงimpl<T> Serialize for Twhere
T: Serialize + ?Sized,
impl<T> Serialize for Twhere T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
ยงimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
ยงimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
ยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.sourceยงimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
sourceยงfn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.sourceยงimpl<T> FutureExt for T
impl<T> FutureExt for T
sourceยงfn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourceยงfn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceยงimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourceยงfn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Requestยงimpl<T> StdoutFmt for Twhere
T: Display,
impl<T> StdoutFmt for Twhere T: Display,
sourceยงimpl<T> Variant for Twhere
T: Any + Clone + SendSync,
impl<T> Variant for Twhere T: Any + Clone + SendSync,
sourceยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant trait object to &mut dyn Any.sourceยงfn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Variant trait object to Box<dyn Any>.