pub struct OperationBuilder<QueryFragment, Variables = ()> { /* private fields */ }
Expand description
Low level builder for Operation.
Users should prefer to use crate::QueryBuilder, crate::MutationBuilder or crate::SubscriptionBuilder where possible, unless they need the control offered by this builder.
Implementations§
Source§impl<Fragment, Variables> OperationBuilder<Fragment, Variables>where
Fragment: QueryFragment,
Variables: QueryVariables,
impl<Fragment, Variables> OperationBuilder<Fragment, Variables>where
Fragment: QueryFragment,
Variables: QueryVariables,
Sourcepub fn query() -> Selfwhere
Fragment::SchemaType: QueryRoot,
pub fn query() -> Selfwhere
Fragment::SchemaType: QueryRoot,
Creates an OperationBuilder
for a query operation
Sourcepub fn mutation() -> Selfwhere
Fragment::SchemaType: MutationRoot,
pub fn mutation() -> Selfwhere
Fragment::SchemaType: MutationRoot,
Creates an OperationBuilder
for a mutation operation
Sourcepub fn subscription() -> Selfwhere
Fragment::SchemaType: SubscriptionRoot,
pub fn subscription() -> Selfwhere
Fragment::SchemaType: SubscriptionRoot,
Creates an OperationBuilder
for a subscription operation
Sourcepub fn with_variables(self, variables: Variables) -> Self
pub fn with_variables(self, variables: Variables) -> Self
Adds variables for the operation
Sourcepub fn set_variables(&mut self, variables: Variables)
pub fn set_variables(&mut self, variables: Variables)
Sets variables for the operation
Sourcepub fn with_feature_enabled(self, feature: &str) -> Self
pub fn with_feature_enabled(self, feature: &str) -> Self
Enables a feature for the operation
Sourcepub fn enable_feature(&mut self, feature: &str)
pub fn enable_feature(&mut self, feature: &str)
Sets an enabled feature for the operation
Sourcepub fn with_operation_name(self, name: &str) -> Self
pub fn with_operation_name(self, name: &str) -> Self
Adds a name to the operation
Sourcepub fn set_operation_name(&mut self, name: &str)
pub fn set_operation_name(&mut self, name: &str)
Sets a name for the operation
Sourcepub fn build(
self,
) -> Result<Operation<Fragment, Variables>, OperationBuildError>
pub fn build( self, ) -> Result<Operation<Fragment, Variables>, OperationBuildError>
Tries to build an Operation
Sourcepub fn build_with_variables_inlined(
self,
) -> Result<Operation<Fragment, ()>, OperationBuildError>where
Variables: QueryVariableLiterals,
pub fn build_with_variables_inlined(
self,
) -> Result<Operation<Fragment, ()>, OperationBuildError>where
Variables: QueryVariableLiterals,
Builds an Operation with all of the current variables inlined into the executable document as arguments.
You should derive QueryVariableLiterals
on your QueryArguments
struct to use this
functionality.