[][src]Enum juniper_graphql_ws::ServerMessage

pub enum ServerMessage<S: ScalarValue> {
    ConnectionError {
        payload: ConnectionErrorPayload,
    },
    ConnectionAck,
    Data {
        id: String,
        payload: DataPayload<S>,
    },
    Error {
        id: String,
        payload: ErrorPayload,
    },
    Complete {
        id: String,
    },
    ConnectionKeepAlive,
}

ServerMessage defines the message types that servers can send.

Variants

ConnectionError

ConnectionError is used for errors that are not associated with a GraphQL operation. For example, this will be used when:

  • The server is unable to parse a client's message.
  • The client's initialization parameters are rejected.

Fields of ConnectionError

payload: ConnectionErrorPayload

The error that occurred.

ConnectionAck

ConnectionAck is sent in response to a client's ConnectionInit message if the server accepted a connection.

Data

Data contains the result of a query, mutation, or subscription event.

Fields of Data

id: String

The id of the operation that the data is for.

payload: DataPayload<S>

The data and errors that occurred during execution.

Error

Error contains an error that occurs before execution, such as validation errors.

Fields of Error

id: String

The id of the operation that triggered this error.

payload: ErrorPayload

The error(s).

Complete

Complete indicates that no more data will be sent for the given operation.

Fields of Complete

id: String

The id of the operation that has completed.

ConnectionKeepAlive

ConnectionKeepAlive is sent periodically after accepting a connection.

Trait Implementations

impl<S: Debug + ScalarValue> Debug for ServerMessage<S>[src]

impl<S: PartialEq + ScalarValue> PartialEq<ServerMessage<S>> for ServerMessage<S>[src]

impl<S: ScalarValue> Serialize for ServerMessage<S> where
    S: ScalarValue
[src]

impl<S: ScalarValue> StructuralPartialEq for ServerMessage<S>[src]

Auto Trait Implementations

impl<S> !RefUnwindSafe for ServerMessage<S>[src]

impl<S> Send for ServerMessage<S> where
    S: Send
[src]

impl<S> !Sync for ServerMessage<S>[src]

impl<S> !Unpin for ServerMessage<S>[src]

impl<S> !UnwindSafe for ServerMessage<S>[src]

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.