pub trait GraphQLValueAsync<S = DefaultScalarValue>: GraphQLValue<S> + Sync
where Self::TypeInfo: Sync, Self::Context: Sync, S: ScalarValue + Send + Sync,
{ // Provided methods fn resolve_field_async<'a>( &'a self, _info: &'a Self::TypeInfo, _field_name: &'a str, _arguments: &'a Arguments<'_, S>, _executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>> { ... } fn resolve_into_type_async<'a>( &'a self, info: &'a Self::TypeInfo, type_name: &str, selection_set: Option<&'a [Selection<'a, S>]>, executor: &'a Executor<'a, 'a, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>> { ... } fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, selection_set: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>> { ... } }
Expand description

Extension of GraphQLValue trait with asynchronous queries/mutations resolvers.

Convenience macros related to asynchronous queries/mutations expand into an implementation of this trait and GraphQLValue for the given type.

Provided Methods§

source

fn resolve_field_async<'a>( &'a self, _info: &'a Self::TypeInfo, _field_name: &'a str, _arguments: &'a Arguments<'_, S>, _executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

Resolves the value of a single field on this GraphQLValueAsync.

The arguments object contains all the specified arguments, with default values being substituted for the ones not provided by the query.

The executor can be used to drive selections into sub-objects.

§Panics

The default implementation panics.

source

fn resolve_into_type_async<'a>( &'a self, info: &'a Self::TypeInfo, type_name: &str, selection_set: Option<&'a [Selection<'a, S>]>, executor: &'a Executor<'a, 'a, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

Resolves this GraphQLValueAsync (being an interface or an union) into a concrete downstream object type.

Tries to resolve this GraphQLValueAsync into the provided type_name. If the type matches, then passes the instance along to Executor::resolve.

§Panics

The default implementation panics.

source

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, selection_set: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

Resolves the provided selection_set against this GraphQLValueAsync.

For non-object types, the selection_set will be None and the value should simply be returned.

For objects, all fields in the selection_set should be resolved. The default implementation uses GraphQLValueAsync::resolve_field_async to resolve all fields, including those through a fragment expansion.

Since the GraphQL spec specifies that errors during field processing should result in a null-value, this might return Ok(Null) in case of a failure. Errors are recorded internally.

§Panics

The default implementation panics, if selection_set is None.

Implementations on Foreign Types§

source§

impl<'e, S, T> GraphQLValueAsync<S> for &'e T

source§

fn resolve_field_async<'b>( &'b self, info: &'b Self::TypeInfo, field_name: &'b str, arguments: &'b Arguments<'_, S>, executor: &'b Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'b, ExecutionResult<S>>

source§

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, selection_set: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

source§

impl<S> GraphQLValueAsync<S> for str
where S: ScalarValue + Send + Sync,

source§

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, selection_set: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

source§

impl<S, T> GraphQLValueAsync<S> for Option<T>

source§

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, _: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

source§

impl<S, T> GraphQLValueAsync<S> for [T]

source§

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, _: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

source§

impl<S, T> GraphQLValueAsync<S> for Box<T>

source§

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, selection_set: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

source§

impl<S, T> GraphQLValueAsync<S> for Arc<T>

source§

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, selection_set: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

source§

impl<S, T> GraphQLValueAsync<S> for Vec<T>

source§

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, _: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

source§

impl<S, T, const N: usize> GraphQLValueAsync<S> for [T; N]

source§

fn resolve_async<'a>( &'a self, info: &'a Self::TypeInfo, _: Option<&'a [Selection<'_, S>]>, executor: &'a Executor<'_, '_, Self::Context, S> ) -> BoxFuture<'a, ExecutionResult<S>>

source§

impl<Tz, __S> GraphQLValueAsync<__S> for DateTime<Tz>
where Tz: TimeZone + FromFixedOffset, Tz::Offset: Display, __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for Tz
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for bool
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for f64
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for i32
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for String
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for BigDecimal
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for DateTime
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for ObjectId
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for NaiveDate
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for NaiveDateTime
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for NaiveTime
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for Decimal
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for Date
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for OffsetDateTime
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for PrimitiveDateTime
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for Time
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for UtcOffset
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for Url
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

source§

impl<__S> GraphQLValueAsync<__S> for Uuid
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

fn resolve_async<'b>( &'b self, info: &'b Self::TypeInfo, selection_set: Option<&'b [Selection<'_, __S>]>, executor: &'b Executor<'_, '_, Self::Context, __S> ) -> BoxFuture<'b, ExecutionResult<__S>>

Implementors§

source§

impl<'a, S> GraphQLValueAsync<S> for Argument<'a, S>
where S: ScalarValue + Send + Sync + ScalarValue + 'a, for<'__fa__a> Argument<'__fa__a, S>: Sync,

source§

impl<'a, S> GraphQLValueAsync<S> for Field<'a, S>
where S: ScalarValue + Send + Sync + ScalarValue + 'a, for<'__fa__a> Field<'__fa__a, S>: Sync,

source§

impl<'a, S> GraphQLValueAsync<S> for SchemaType<'a, S>
where S: ScalarValue + Send + Sync + ScalarValue + 'a, for<'__fa__a> SchemaType<'__fa__a, S>: Sync,

source§

impl<'a, S, QueryT, MutationT, SubscriptionT> GraphQLValueAsync<S> for RootNode<'a, QueryT, MutationT, SubscriptionT, S>
where QueryT: GraphQLTypeAsync<S>, QueryT::TypeInfo: Sync, QueryT::Context: Sync + 'a, MutationT: GraphQLTypeAsync<S, Context = QueryT::Context>, MutationT::TypeInfo: Sync, SubscriptionT: GraphQLType<S, Context = QueryT::Context> + Sync, SubscriptionT::TypeInfo: Sync, S: ScalarValue + Send + Sync,

source§

impl<S, T> GraphQLValueAsync<S> for Nullable<T>

source§

impl<S, T> GraphQLValueAsync<S> for EmptyMutation<T>
where Self::TypeInfo: Sync, Self::Context: Sync, S: ScalarValue + Send + Sync,

source§

impl<__S> GraphQLValueAsync<__S> for TypeKind
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

impl<__S> GraphQLValueAsync<__S> for Episode
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

impl<__S> GraphQLValueAsync<__S> for EnumValue
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

impl<__S> GraphQLValueAsync<__S> for ID
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

impl<__S> GraphQLValueAsync<__S> for Droid
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

impl<__S> GraphQLValueAsync<__S> for Human
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

impl<__S> GraphQLValueAsync<__S> for Query
where __S: ScalarValue + Send + Sync, Self: Sync,

source§

impl<__S> GraphQLValueAsync<__S> for CharacterValue
where __S: ScalarValue + Send + Sync, Self: Sync,