Struct apollo_router::graphql::Response
source ยท #[non_exhaustive]pub struct Response {
pub label: Option<String>,
pub data: Option<Value>,
pub path: Option<Path>,
pub errors: Vec<Error>,
pub extensions: Map<ByteString, Value>,
pub has_next: Option<bool>,
pub subscribed: Option<bool>,
pub created_at: Option<Instant>,
pub incremental: Vec<IncrementalResponse>,
}Expand description
A graphql primary response. Used for federated and subgraph queries.
Fields (Non-exhaustive)ยง
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.label: Option<String>The label that was passed to the defer or stream directive for this patch.
data: Option<Value>The response data.
path: Option<Path>The path that the data should be merged at.
errors: Vec<Error>The optional graphql errors encountered.
extensions: Map<ByteString, Value>The optional graphql extensions.
has_next: Option<bool>ยงsubscribed: Option<bool>ยงcreated_at: Option<Instant>Used for subscription event to compute the duration of a subscription event
incremental: Vec<IncrementalResponse>Implementationsยง
sourceยงimpl Response
impl Response
sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
If path is None, this is a primary response.
sourcepub fn append_errors(&mut self, errors: &mut Vec<Error>)
pub fn append_errors(&mut self, errors: &mut Vec<Error>)
append_errors default the errors path with the one provided.
sourceยงimpl Response
impl Response
sourcepub fn builder(
) -> __ResponseBuilder<(__Optional<Option<String>>, __Optional<Option<Value>>, __Optional<Option<Path>>, __Optional<Vec<Error>>, __Optional<Map<ByteString, Value>>, __Optional<Option<String>>, __Optional<Option<bool>>, __Optional<Option<bool>>, __Optional<Vec<IncrementalResponse>>, __Optional<Option<Instant>>)>
pub fn builder( ) -> __ResponseBuilder<(__Optional<Option<String>>, __Optional<Option<Value>>, __Optional<Option<Path>>, __Optional<Vec<Error>>, __Optional<Map<ByteString, Value>>, __Optional<Option<String>>, __Optional<Option<bool>>, __Optional<Option<bool>>, __Optional<Vec<IncrementalResponse>>, __Optional<Option<Instant>>)>
Constructor
Trait Implementationsยง
sourceยงimpl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
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>,
Deserialize this value from the given Serde deserializer. Read more
sourceยงimpl PartialEq<Response> for Response
impl PartialEq<Response> for Response
impl Eq for Response
impl StructuralEq for Response
impl StructuralPartialEq for Response
Auto Trait Implementationsยง
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
Blanket Implementationsยง
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.ยง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
Checks if this value is equivalent to the given key. Read more
ยง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
Compare self to
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>
Wrap the input message
T in a tonic::Requestsourceยง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> 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)
Convert this
Variant trait object to &mut dyn Any.sourceยงfn as_boxed_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn as_boxed_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert this
Variant trait object to Box<dyn Any>.