pub struct RootNode<'a, QueryT: GraphQLType<S>, MutationT: GraphQLType<S>, SubscriptionT: GraphQLType<S>, S = DefaultScalarValue>where
S: ScalarValue,{ /* private fields */ }
Expand description
Root query node of a schema
This brings the mutation, subscription and query types together, and provides the predefined metadata fields.
Implementations§
source§impl<'a, QueryT, MutationT, SubscriptionT> RootNode<'a, QueryT, MutationT, SubscriptionT, DefaultScalarValue>where
QueryT: GraphQLType<DefaultScalarValue, TypeInfo = ()>,
MutationT: GraphQLType<DefaultScalarValue, TypeInfo = ()>,
SubscriptionT: GraphQLType<DefaultScalarValue, TypeInfo = ()>,
impl<'a, QueryT, MutationT, SubscriptionT> RootNode<'a, QueryT, MutationT, SubscriptionT, DefaultScalarValue>where
QueryT: GraphQLType<DefaultScalarValue, TypeInfo = ()>,
MutationT: GraphQLType<DefaultScalarValue, TypeInfo = ()>,
SubscriptionT: GraphQLType<DefaultScalarValue, TypeInfo = ()>,
sourcepub fn new(
query: QueryT,
mutation: MutationT,
subscription: SubscriptionT
) -> Self
pub fn new(
query: QueryT,
mutation: MutationT,
subscription: SubscriptionT
) -> Self
Constructs a new RootNode
from query
, mutation
and subscription
nodes,
parametrizing it with a DefaultScalarValue
.
source§impl<'a, QueryT, MutationT, SubscriptionT, S> RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
S: ScalarValue + 'a,
QueryT: GraphQLType<S, TypeInfo = ()>,
MutationT: GraphQLType<S, TypeInfo = ()>,
SubscriptionT: GraphQLType<S, TypeInfo = ()>,
impl<'a, QueryT, MutationT, SubscriptionT, S> RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
S: ScalarValue + 'a,
QueryT: GraphQLType<S, TypeInfo = ()>,
MutationT: GraphQLType<S, TypeInfo = ()>,
SubscriptionT: GraphQLType<S, TypeInfo = ()>,
sourcepub fn new_with_scalar_value(
query: QueryT,
mutation: MutationT,
subscription: SubscriptionT
) -> Self
pub fn new_with_scalar_value(
query: QueryT,
mutation: MutationT,
subscription: SubscriptionT
) -> Self
Constructs a new RootNode
from query
, mutation
and subscription
nodes,
parametrizing it with the provided ScalarValue
.
source§impl<'a, S, QueryT, MutationT, SubscriptionT> RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
QueryT: GraphQLType<S>,
MutationT: GraphQLType<S>,
SubscriptionT: GraphQLType<S>,
S: ScalarValue + 'a,
impl<'a, S, QueryT, MutationT, SubscriptionT> RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
QueryT: GraphQLType<S>,
MutationT: GraphQLType<S>,
SubscriptionT: GraphQLType<S>,
S: ScalarValue + 'a,
sourcepub fn new_with_info(
query_obj: QueryT,
mutation_obj: MutationT,
subscription_obj: SubscriptionT,
query_info: QueryT::TypeInfo,
mutation_info: MutationT::TypeInfo,
subscription_info: SubscriptionT::TypeInfo
) -> Self
pub fn new_with_info(
query_obj: QueryT,
mutation_obj: MutationT,
subscription_obj: SubscriptionT,
query_info: QueryT::TypeInfo,
mutation_info: MutationT::TypeInfo,
subscription_info: SubscriptionT::TypeInfo
) -> Self
Construct a new root node from query and mutation nodes, while also providing type info objects for the query and mutation types.
sourcepub fn as_schema_language(&self) -> String
pub fn as_schema_language(&self) -> String
The schema definition as a String
in the
GraphQL Schema Language
format.
sourcepub fn as_parser_document(&'a self) -> Document<'a, &'a str>
pub fn as_parser_document(&'a self) -> Document<'a, &'a str>
The schema definition as a graphql_parser
Document
.
Trait Implementations§
source§impl<'a, QueryT: Debug + GraphQLType<S>, MutationT: Debug + GraphQLType<S>, SubscriptionT: Debug + GraphQLType<S>, S> Debug for RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
S: ScalarValue + Debug,
QueryT::TypeInfo: Debug,
MutationT::TypeInfo: Debug,
SubscriptionT::TypeInfo: Debug,
impl<'a, QueryT: Debug + GraphQLType<S>, MutationT: Debug + GraphQLType<S>, SubscriptionT: Debug + GraphQLType<S>, S> Debug for RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
S: ScalarValue + Debug,
QueryT::TypeInfo: Debug,
MutationT::TypeInfo: Debug,
SubscriptionT::TypeInfo: Debug,
source§impl<'a, S, QueryT, MutationT, SubscriptionT> GraphQLType<S> for RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
S: ScalarValue,
QueryT: GraphQLType<S>,
MutationT: GraphQLType<S, Context = QueryT::Context>,
SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
impl<'a, S, QueryT, MutationT, SubscriptionT> GraphQLType<S> for RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
S: ScalarValue,
QueryT: GraphQLType<S>,
MutationT: GraphQLType<S, Context = QueryT::Context>,
SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
source§impl<'a, S, QueryT, MutationT, SubscriptionT> GraphQLValue<S> for RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
S: ScalarValue,
QueryT: GraphQLType<S>,
MutationT: GraphQLType<S, Context = QueryT::Context>,
SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
impl<'a, S, QueryT, MutationT, SubscriptionT> GraphQLValue<S> for RootNode<'a, QueryT, MutationT, SubscriptionT, S>where
S: ScalarValue,
QueryT: GraphQLType<S>,
MutationT: GraphQLType<S, Context = QueryT::Context>,
SubscriptionT: GraphQLType<S, Context = QueryT::Context>,
§type Context = <QueryT as GraphQLValue<S>>::Context
type Context = <QueryT as GraphQLValue<S>>::Context
Context type for this
GraphQLValue
. Read more§type TypeInfo = <QueryT as GraphQLValue<S>>::TypeInfo
type TypeInfo = <QueryT as GraphQLValue<S>>::TypeInfo
Type that may carry additional schema information for this
GraphQLValue
. Read moresource§fn concrete_type_name(
&self,
context: &Self::Context,
info: &Self::TypeInfo
) -> String
fn concrete_type_name(
&self,
context: &Self::Context,
info: &Self::TypeInfo
) -> String
Returns the concrete
GraphQLType
name for this GraphQLValue
being an interface,
an union or an object. Read moresource§fn resolve_field(
&self,
info: &Self::TypeInfo,
field: &str,
args: &Arguments<'_, S>,
executor: &Executor<'_, '_, Self::Context, S>
) -> ExecutionResult<S>
fn resolve_field(
&self,
info: &Self::TypeInfo,
field: &str,
args: &Arguments<'_, S>,
executor: &Executor<'_, '_, Self::Context, S>
) -> ExecutionResult<S>
Resolves the value of a single field on this
GraphQLValue
. Read moresource§fn resolve(
&self,
info: &Self::TypeInfo,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, '_, Self::Context, S>
) -> ExecutionResult<S>
fn resolve(
&self,
info: &Self::TypeInfo,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, '_, Self::Context, S>
) -> ExecutionResult<S>
source§fn resolve_into_type(
&self,
info: &Self::TypeInfo,
type_name: &str,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, '_, Self::Context, S>
) -> ExecutionResult<S>
fn resolve_into_type(
&self,
info: &Self::TypeInfo,
type_name: &str,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, '_, Self::Context, S>
) -> ExecutionResult<S>
Resolves this
GraphQLValue
(being an interface or an union) into a concrete
downstream object type. Read moresource§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,
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§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_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>>
Resolves the value of a single field on this
GraphQLValueAsync
. Read moresource§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_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. Read more