Trait cynic::QueryFragment

source ·
pub trait QueryFragment<'de>: Deserialize<'de> {
    type SchemaType;
    type Variables: QueryVariables;

    const TYPE: Option<&'static str> = None;

    // Required method
    fn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::Variables>);
}
Expand description

Indicates that a type may be used as part of a graphql query.

This will usually be derived, but can be manually implemented if required.

Required Associated Types§

source

type SchemaType

The type in a schema that this QueryFragment represents

source

type Variables: QueryVariables

The variables that are required to execute this QueryFragment

Provided Associated Constants§

source

const TYPE: Option<&'static str> = None

The name of the type in the GraphQL schema

Required Methods§

source

fn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::Variables>)

Adds this fragment to the query being built by builder

Implementations on Foreign Types§

source§

impl<'de> QueryFragment<'de> for bool

source§

impl<'de> QueryFragment<'de> for String

source§

impl<'de, T> QueryFragment<'de> for Arc<T>where Self: Deserialize<'de>, T: QueryFragment<'de>,

§

type SchemaType = <T as QueryFragment<'de>>::SchemaType

§

type Variables = <T as QueryFragment<'de>>::Variables

source§

fn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::Variables>)

source§

impl<'de, T> QueryFragment<'de> for Box<T>where T: QueryFragment<'de>,

§

type SchemaType = <T as QueryFragment<'de>>::SchemaType

§

type Variables = <T as QueryFragment<'de>>::Variables

source§

fn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::Variables>)

source§

impl<'de, T> QueryFragment<'de> for Vec<T>where T: QueryFragment<'de>,

source§

impl<'de, T> QueryFragment<'de> for Rc<T>where Self: Deserialize<'de>, T: QueryFragment<'de>,

§

type SchemaType = <T as QueryFragment<'de>>::SchemaType

§

type Variables = <T as QueryFragment<'de>>::Variables

source§

fn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::Variables>)

source§

impl<'de, T> QueryFragment<'de> for Option<T>where T: QueryFragment<'de>,

Implementors§