Trait juniper::GraphQLSubscriptionValue[][src]

pub trait GraphQLSubscriptionValue<S = DefaultScalarValue>: GraphQLValue<S> + Sync where
    Self::TypeInfo: Sync,
    Self::Context: Sync,
    S: ScalarValue + Send + Sync
{ fn resolve_into_stream<'s, 'i, 'ref_e, 'e, 'res, 'f>(
        &'s self,
        info: &'i Self::TypeInfo,
        executor: &'ref_e Executor<'ref_e, 'e, Self::Context, S>
    ) -> BoxFuture<'f, Result<Value<ValuesStream<'res, S>>, FieldError<S>>>
    where
        'e: 'res,
        'i: 'res,
        's: 'f,
        'ref_e: 'f,
        'res: 'f
, { ... }
fn resolve_field_into_stream<'s, 'i, 'ft, 'args, 'e, 'ref_e, 'res, 'f>(
        &'s self,
        _: &'i Self::TypeInfo,
        _: &'ft str,
        _: Arguments<'args, S>,
        _: &'ref_e Executor<'ref_e, 'e, Self::Context, S>
    ) -> BoxFuture<'f, Result<Value<ValuesStream<'res, S>>, FieldError<S>>>
    where
        's: 'f,
        'i: 'res,
        'ft: 'f,
        'args: 'f,
        'ref_e: 'f,
        'res: 'f,
        'e: 'res
, { ... }
fn resolve_into_type_stream<'s, 'i, 'tn, 'e, 'ref_e, 'res, 'f>(
        &'s self,
        info: &'i Self::TypeInfo,
        type_name: &'tn str,
        executor: &'ref_e Executor<'ref_e, 'e, Self::Context, S>
    ) -> BoxFuture<'f, Result<Value<ValuesStream<'res, S>>, FieldError<S>>>
    where
        'i: 'res,
        'e: 'res,
        's: 'f,
        'tn: 'f,
        'ref_e: 'f,
        'res: 'f
, { ... } }
Expand description

Extension of GraphQLValue trait with asynchronous subscription execution logic. It should be used with GraphQLValue in order to implement subscription resolvers on GraphQL objects.

Subscription-related convenience macros expand into an implementation of this trait and GraphQLValue for the given type.

See trait methods for more detailed explanation on how this trait works.

Provided methods

Resolves into Value<ValuesStream>.

Default implementation

In order to resolve selection set on object types, default implementation calls resolve_field_into_stream every time a field needs to be resolved and resolve_into_type_stream every time a fragment needs to be resolved.

For non-object types, the selection set will be None and default implementation will panic.

This method is called by Self’s resolve_into_stream default implementation every time any field is found in selection set.

It replaces GraphQLValue::resolve_field. Unlike resolve_field, which resolves each field into a single Value<S>, this method resolves each field into Value<ValuesStream<S>>.

The default implementation panics.

This method is called by Self’s resolve_into_stream default implementation every time any fragment is found in selection set.

It replaces GraphQLValue::resolve_into_type. Unlike resolve_into_type, which resolves each fragment a single Value<S>, this method resolves each fragment into Value<ValuesStream<S>>.

The default implementation panics.

Implementors