Skip to main content

GraphQLValueAsync

Trait GraphQLValueAsync 

Source
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<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_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, 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,

Available on crate feature chrono only.
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,

Available on crate feature chrono-tz only.
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,

Available on crate feature bigdecimal only.
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,

Available on crate feature bson only.
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,

Available on crate feature bson only.
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,

Available on crate feature chrono only.
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,

Available on crate feature chrono only.
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,

Available on crate feature chrono only.
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 CompactString
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,

Available on crate feature jiff only.
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,

Available on crate feature jiff only.
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,

Available on crate feature jiff only.
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 Span
where __S: ScalarValue + Send + Sync, Self: Sync,

Available on crate feature jiff only.
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 Timestamp
where __S: ScalarValue + Send + Sync, Self: Sync,

Available on crate feature jiff only.
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 Offset
where __S: ScalarValue + Send + Sync, Self: Sync,

Available on crate feature jiff only.
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 TimeZone
where __S: ScalarValue + Send + Sync, Self: Sync,

Available on crate feature jiff only.
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 Zoned
where __S: ScalarValue + Send + Sync, Self: Sync,

Available on crate feature jiff only.
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,

Available on crate feature rust_decimal only.
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,

Available on crate feature time only.
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,

Available on crate feature time only.
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,

Available on crate feature time only.
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,

Available on crate feature time only.
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,

Available on crate feature time only.
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,

Available on crate feature url only.
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,

Available on crate feature uuid only.
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<S> GraphQLValueAsync<S> for Argument<S>
where S: ScalarValue + Send + Sync + ScalarValue, Self: Sync,

Source§

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

Source§

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

Source§

impl<S, QueryT, MutationT, SubscriptionT> GraphQLValueAsync<S> for RootNode<QueryT, MutationT, SubscriptionT, S>
where QueryT: GraphQLTypeAsync<S>, QueryT::TypeInfo: Sync, QueryT::Context: Sync, 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,

Available on crate feature expose-test-schema only.
Source§

impl<__S> GraphQLValueAsync<__S> for juniper::integrations::jiff::TimeZone
where __S: ScalarValue + Send + Sync, Self: Sync,

Available on crate feature jiff only.
Source§

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

Source§

impl<__S> GraphQLValueAsync<__S> for ArcStr
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,

Available on crate feature expose-test-schema only.
Source§

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

Available on crate feature expose-test-schema only.
Source§

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

Available on crate feature expose-test-schema only.
Source§

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

Available on crate feature expose-test-schema only.