[−][src]Struct juniper::http::GraphQLResponse
Simple wrapper around the result from executing a GraphQL query
This struct implements Serialize, so you can simply serialize this
to JSON and send it over the wire. Use the is_ok
method to determine
whether to send a 200 or 400 HTTP status code.
Implementations
impl<'a, S> GraphQLResponse<'a, S> where
S: ScalarValue,
[src]
S: ScalarValue,
pub fn from_result(
r: Result<(Value<S>, Vec<ExecutionError<S>>), GraphQLError<'a>>
) -> Self
[src]
r: Result<(Value<S>, Vec<ExecutionError<S>>), GraphQLError<'a>>
) -> Self
Constructs new GraphQLResponse
using the given result
pub fn error(error: FieldError<S>) -> Self
[src]
Constructs an error response outside of the normal execution flow
pub fn is_ok(&self) -> bool
[src]
Was the request successful or not?
Note that there still might be errors in the response even though it's considered OK. This is by design in GraphQL.
Trait Implementations
impl<'a, S: Debug> Debug for GraphQLResponse<'a, S>
[src]
impl<'a, T> Serialize for GraphQLResponse<'a, T> where
T: Serialize + ScalarValue,
Value<T>: Serialize,
ExecutionError<T>: Serialize,
GraphQLError<'a>: Serialize,
[src]
T: Serialize + ScalarValue,
Value<T>: Serialize,
ExecutionError<T>: Serialize,
GraphQLError<'a>: Serialize,
Auto Trait Implementations
impl<'a, S> RefUnwindSafe for GraphQLResponse<'a, S> where
S: RefUnwindSafe,
[src]
S: RefUnwindSafe,
impl<'a, S> Send for GraphQLResponse<'a, S> where
S: Send,
[src]
S: Send,
impl<'a, S> Sync for GraphQLResponse<'a, S> where
S: Sync,
[src]
S: Sync,
impl<'a, S> Unpin for GraphQLResponse<'a, S> where
S: Unpin,
[src]
S: Unpin,
impl<'a, S> UnwindSafe for GraphQLResponse<'a, S> where
S: UnwindSafe,
[src]
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,