[][src]Struct juniper::http::GraphQLResponse

pub struct GraphQLResponse<'a, S = DefaultScalarValue>(_);

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.

Methods

impl<'a, S> GraphQLResponse<'a, S> where
    S: ScalarValue
[src]

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, T> Serialize for GraphQLResponse<'a, T> where
    T: Serialize + ScalarValue,
    Value<T>: Serialize,
    ExecutionError<T>: Serialize,
    GraphQLError<'a>: Serialize
[src]

Auto Trait Implementations

impl<'a, S> Send for GraphQLResponse<'a, S> where
    S: Send

impl<'a, S> Sync for GraphQLResponse<'a, S> where
    S: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]