Trait cynic::QueryFragment
source · pub trait QueryFragment: Sized {
type SchemaType;
type VariablesFields: QueryVariablesFields;
const TYPE: Option<&'static str> = None;
// Required method
fn query(
builder: SelectionBuilder<'_, Self::SchemaType, Self::VariablesFields>
);
// Provided method
fn name() -> Option<Cow<'static, str>> { ... }
}
Expand description
A trait that marks a type as part of a GraphQL query.
This will usually be derived, but can be manually implemented if required.
Required Associated Types§
sourcetype SchemaType
type SchemaType
The type in a schema that this QueryFragment
represents
sourcetype VariablesFields: QueryVariablesFields
type VariablesFields: QueryVariablesFields
The variables that are required to execute this QueryFragment
Provided Associated Constants§
Required Methods§
sourcefn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::VariablesFields>)
fn query(builder: SelectionBuilder<'_, Self::SchemaType, Self::VariablesFields>)
Adds this fragment to the query being built by builder
Provided Methods§
Object Safety§
This trait is not object safe.