Struct juniper::RootNode[][src]

pub struct RootNode<'a, QueryT: GraphQLType<S>, MutationT: GraphQLType<S>, SubscriptionT: GraphQLType<S>, S = DefaultScalarValue> where
    S: ScalarValue
{ /* fields omitted */ }
Expand description

Root query node of a schema

This brings the mutation, subscription and query types together, and provides the predefined metadata fields.

Implementations

impl<'a, QueryT, MutationT, SubscriptionT> RootNode<'a, QueryT, MutationT, SubscriptionT, DefaultScalarValue> where
    QueryT: GraphQLType<DefaultScalarValue, TypeInfo = ()>,
    MutationT: GraphQLType<DefaultScalarValue, TypeInfo = ()>,
    SubscriptionT: GraphQLType<DefaultScalarValue, TypeInfo = ()>, 
[src]

pub fn new(
    query: QueryT,
    mutation: MutationT,
    subscription: SubscriptionT
) -> Self
[src]

Constructs a new RootNode from query, mutation and subscription nodes, parametrizing it with a DefaultScalarValue.

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 = ()>, 
[src]

pub fn new_with_scalar_value(
    query: QueryT,
    mutation: MutationT,
    subscription: SubscriptionT
) -> Self
[src]

Constructs a new RootNode from query, mutation and subscription nodes, parametrizing it with the provided ScalarValue.

pub fn as_schema_language(&self) -> String[src]

The schema definition as a String in the GraphQL Schema Language format.

pub fn as_parser_document(&'a self) -> Document<'a, &'a str>[src]

The schema definition as a graphql_parser Document.

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, 
[src]

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
[src]

Construct a new root node from query and mutation nodes, while also providing type info objects for the query and mutation types.

Trait Implementations

impl<'a, QueryT: Debug + GraphQLType<S>, MutationT: Debug + GraphQLType<S>, SubscriptionT: Debug + GraphQLType<S>, S: Debug> Debug for RootNode<'a, QueryT, MutationT, SubscriptionT, S> where
    S: ScalarValue,
    QueryT::TypeInfo: Debug,
    MutationT::TypeInfo: Debug,
    SubscriptionT::TypeInfo: Debug
[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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>, 
[src]

fn name(info: &Self::TypeInfo) -> Option<&str>[src]

Returns name of this GraphQLType to expose. Read more

fn meta<'r>(
    info: &Self::TypeInfo,
    registry: &mut Registry<'r, S>
) -> MetaType<'r, S> where
    S: 'r, 
[src]

Returns MetaType representing this GraphQLType.

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>, 
[src]

type Context = QueryT::Context

Context type for this GraphQLValue. Read more

type TypeInfo = QueryT::TypeInfo

Type that may carry additional schema information for this GraphQLValue. Read more

fn type_name<'i>(&self, info: &'i Self::TypeInfo) -> Option<&'i str>[src]

Returns name of the GraphQLType exposed by this GraphQLValue. Read more

fn concrete_type_name(
    &self,
    context: &Self::Context,
    info: &Self::TypeInfo
) -> String
[src]

Returns the concrete GraphQLType name for this GraphQLValue being an interface, an union or an object. Read more

fn resolve_field(
    &self,
    info: &Self::TypeInfo,
    field: &str,
    args: &Arguments<'_, S>,
    executor: &Executor<'_, '_, Self::Context, S>
) -> ExecutionResult<S>
[src]

Resolves the value of a single field on this GraphQLValue. Read more

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

Resolves the provided selection_set against this GraphQLValue. Read more

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

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

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
[src]

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>>
[src]

Resolves the value of a single field on this GraphQLValueAsync. Read more

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>>
[src]

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

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>>
[src]

Resolves the provided selection_set against this GraphQLValueAsync. Read more

Auto Trait Implementations

impl<'a, QueryT, MutationT, SubscriptionT, S> RefUnwindSafe for RootNode<'a, QueryT, MutationT, SubscriptionT, S> where
    MutationT: RefUnwindSafe,
    QueryT: RefUnwindSafe,
    S: RefUnwindSafe,
    SubscriptionT: RefUnwindSafe,
    <MutationT as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
    <QueryT as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
    <SubscriptionT as GraphQLValue<S>>::TypeInfo: RefUnwindSafe

impl<'a, QueryT, MutationT, SubscriptionT, S> Send for RootNode<'a, QueryT, MutationT, SubscriptionT, S> where
    MutationT: Send,
    QueryT: Send,
    S: Send,
    SubscriptionT: Send,
    <MutationT as GraphQLValue<S>>::TypeInfo: Send,
    <QueryT as GraphQLValue<S>>::TypeInfo: Send,
    <SubscriptionT as GraphQLValue<S>>::TypeInfo: Send

impl<'a, QueryT, MutationT, SubscriptionT, S> Sync for RootNode<'a, QueryT, MutationT, SubscriptionT, S> where
    MutationT: Sync,
    QueryT: Sync,
    S: Sync,
    SubscriptionT: Sync,
    <MutationT as GraphQLValue<S>>::TypeInfo: Sync,
    <QueryT as GraphQLValue<S>>::TypeInfo: Sync,
    <SubscriptionT as GraphQLValue<S>>::TypeInfo: Sync

impl<'a, QueryT, MutationT, SubscriptionT, S> Unpin for RootNode<'a, QueryT, MutationT, SubscriptionT, S> where
    MutationT: Unpin,
    QueryT: Unpin,
    S: Unpin,
    SubscriptionT: Unpin,
    <MutationT as GraphQLValue<S>>::TypeInfo: Unpin,
    <QueryT as GraphQLValue<S>>::TypeInfo: Unpin,
    <SubscriptionT as GraphQLValue<S>>::TypeInfo: Unpin

impl<'a, QueryT, MutationT, SubscriptionT, S> UnwindSafe for RootNode<'a, QueryT, MutationT, SubscriptionT, S> where
    MutationT: UnwindSafe,
    QueryT: UnwindSafe,
    S: UnwindSafe,
    SubscriptionT: UnwindSafe,
    <MutationT as GraphQLValue<S>>::TypeInfo: UnwindSafe,
    <QueryT as GraphQLValue<S>>::TypeInfo: UnwindSafe,
    <SubscriptionT as GraphQLValue<S>>::TypeInfo: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V