Trait cynic::InlineFragments [−][src]
pub trait InlineFragments: Sized {
type TypeLock;
type Arguments: FragmentArguments;
fn graphql_type() -> String;
fn fragments(
context: FragmentContext<'_, Self::Arguments>
) -> Vec<(String, SelectionSet<'static, Self, Self::TypeLock>)>;
fn fallback(
context: FragmentContext<'_, Self::Arguments>
) -> Option<SelectionSet<'static, Self, Self::TypeLock>>;
}
Expand description
Indicates that a type may be used to select one or more members of an interface/union type.
Similar to a collection of inline fragments in a GraphQL query.
Associated Types
The type lock for the GraphQL interface/union type these fragments are selected on.
The arguments that are required to select these fragments.
Required methods
fn graphql_type() -> String
fn graphql_type() -> String
The GraphQL type name that this InlineFragments
selects
fn fragments(
context: FragmentContext<'_, Self::Arguments>
) -> Vec<(String, SelectionSet<'static, Self, Self::TypeLock>)>
fn fragments(
context: FragmentContext<'_, Self::Arguments>
) -> Vec<(String, SelectionSet<'static, Self, Self::TypeLock>)>
Returns a SelectionSet
that selects the fragments for this type with the arguments provided
in the context
fn fallback(
context: FragmentContext<'_, Self::Arguments>
) -> Option<SelectionSet<'static, Self, Self::TypeLock>>
fn fallback(
context: FragmentContext<'_, Self::Arguments>
) -> Option<SelectionSet<'static, Self, Self::TypeLock>>
Returns an optional fallback SelectionSet
for when the returned type does not match
any of the types supported by this InlineFragments