pub trait GraphQLValueAsync<S = DefaultScalarValue>: GraphQLValue<S> + 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§
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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>>
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
impl<S> GraphQLValueAsync<S> for str
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>
impl<S, T> GraphQLValueAsync<S> for Option<T>
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 &Twhere
T: GraphQLValueAsync<S> + ?Sized,
T::TypeInfo: Sync,
T::Context: Sync,
S: ScalarValue + Send + Sync,
impl<S, T> GraphQLValueAsync<S> for &Twhere
T: GraphQLValueAsync<S> + ?Sized,
T::TypeInfo: Sync,
T::Context: Sync,
S: ScalarValue + Send + Sync,
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>>
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]
impl<S, T> GraphQLValueAsync<S> for [T]
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>where
T: GraphQLValueAsync<S> + ?Sized,
T::TypeInfo: Sync,
T::Context: Sync,
S: ScalarValue + Send + Sync,
impl<S, T> GraphQLValueAsync<S> for Box<T>where
T: GraphQLValueAsync<S> + ?Sized,
T::TypeInfo: Sync,
T::Context: Sync,
S: ScalarValue + Send + Sync,
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>where
T: GraphQLValueAsync<S> + Send + ?Sized,
T::TypeInfo: Sync,
T::Context: Sync,
S: ScalarValue + Send + Sync,
impl<S, T> GraphQLValueAsync<S> for Arc<T>where
T: GraphQLValueAsync<S> + Send + ?Sized,
T::TypeInfo: Sync,
T::Context: Sync,
S: ScalarValue + Send + Sync,
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>
impl<S, T> GraphQLValueAsync<S> for Vec<T>
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]
impl<S, T, const N: usize> GraphQLValueAsync<S> for [T; N]
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.
impl<Tz, __S> GraphQLValueAsync<__S> for DateTime<Tz>where
Tz: TimeZone + FromFixedOffset,
Tz::Offset: Display,
__S: ScalarValue + Send + Sync,
Self: Sync,
chrono only.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
Available on crate feature chrono-tz only.
impl<__S> GraphQLValueAsync<__S> for Tz
chrono-tz only.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
impl<__S> GraphQLValueAsync<__S> for bool
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
impl<__S> GraphQLValueAsync<__S> for f64
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
impl<__S> GraphQLValueAsync<__S> for i32
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
impl<__S> GraphQLValueAsync<__S> for String
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
Available on crate feature bigdecimal only.
impl<__S> GraphQLValueAsync<__S> for BigDecimal
bigdecimal only.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
Available on crate feature bson only.
impl<__S> GraphQLValueAsync<__S> for DateTime
bson only.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
Available on crate feature bson only.
impl<__S> GraphQLValueAsync<__S> for ObjectId
bson only.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
Available on crate feature chrono only.
impl<__S> GraphQLValueAsync<__S> for NaiveDate
chrono only.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
Available on crate feature chrono only.
impl<__S> GraphQLValueAsync<__S> for NaiveDateTime
chrono only.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
Available on crate feature chrono only.
impl<__S> GraphQLValueAsync<__S> for NaiveTime
chrono only.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
impl<__S> GraphQLValueAsync<__S> for CompactString
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
Available on crate feature jiff only.
impl<__S> GraphQLValueAsync<__S> for Date
jiff only.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
Available on crate feature jiff only.
impl<__S> GraphQLValueAsync<__S> for DateTime
jiff only.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
Available on crate feature jiff only.
impl<__S> GraphQLValueAsync<__S> for Time
jiff only.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
Available on crate feature jiff only.
impl<__S> GraphQLValueAsync<__S> for Span
jiff only.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
Available on crate feature jiff only.
impl<__S> GraphQLValueAsync<__S> for Timestamp
jiff only.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
Available on crate feature jiff only.
impl<__S> GraphQLValueAsync<__S> for Offset
jiff only.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
Available on crate feature jiff only.
impl<__S> GraphQLValueAsync<__S> for TimeZone
jiff only.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
Available on crate feature jiff only.
impl<__S> GraphQLValueAsync<__S> for Zoned
jiff only.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
Available on crate feature rust_decimal only.
impl<__S> GraphQLValueAsync<__S> for Decimal
rust_decimal only.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
Available on crate feature time only.
impl<__S> GraphQLValueAsync<__S> for Date
time only.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
Available on crate feature time only.
impl<__S> GraphQLValueAsync<__S> for OffsetDateTime
time only.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
Available on crate feature time only.
impl<__S> GraphQLValueAsync<__S> for PrimitiveDateTime
time only.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
Available on crate feature time only.
impl<__S> GraphQLValueAsync<__S> for Time
time only.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
Available on crate feature time only.
impl<__S> GraphQLValueAsync<__S> for UtcOffset
time only.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
Available on crate feature url only.
impl<__S> GraphQLValueAsync<__S> for Url
url only.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
Available on crate feature uuid only.
impl<__S> GraphQLValueAsync<__S> for Uuid
uuid only.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§
impl<S> GraphQLValueAsync<S> for Argument<S>
impl<S> GraphQLValueAsync<S> for Field<S>
impl<S> GraphQLValueAsync<S> for SchemaType<S>
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,
impl<S, T> GraphQLValueAsync<S> for Nullable<T>
impl<S, T> GraphQLValueAsync<S> for EmptyMutation<T>
impl<__S> GraphQLValueAsync<__S> for TypeKind
impl<__S> GraphQLValueAsync<__S> for Episode
expose-test-schema only.impl<__S> GraphQLValueAsync<__S> for juniper::integrations::jiff::TimeZone
jiff only.impl<__S> GraphQLValueAsync<__S> for EnumValue
impl<__S> GraphQLValueAsync<__S> for ArcStr
impl<__S> GraphQLValueAsync<__S> for ID
impl<__S> GraphQLValueAsync<__S> for Droid
expose-test-schema only.impl<__S> GraphQLValueAsync<__S> for Human
expose-test-schema only.impl<__S> GraphQLValueAsync<__S> for Query
expose-test-schema only.impl<__S> GraphQLValueAsync<__S> for CharacterValue
expose-test-schema only.