pub struct GraphQLClientCodegenOptions {
pub mode: CodegenMode,
pub operation_name: Option<String>,
pub struct_name: Option<String>,
/* private fields */
}
Expand description
Used to configure code generation.
Fields§
§mode: CodegenMode
Which context is this code generation effort taking place.
operation_name: Option<String>
Name of the operation we want to generate code for. If it does not match, we use all queries.
struct_name: Option<String>
The name of implementation target struct.
Implementations§
Source§impl GraphQLClientCodegenOptions
impl GraphQLClientCodegenOptions
Sourcepub fn new(mode: CodegenMode) -> GraphQLClientCodegenOptions
pub fn new(mode: CodegenMode) -> GraphQLClientCodegenOptions
Creates an empty options object with default params. It probably wants to be configured.
Sourcepub fn set_query_file(&mut self, path: PathBuf)
pub fn set_query_file(&mut self, path: PathBuf)
A path to a file to include in the module to force Cargo to take into account changes in the query files when recompiling.
Sourcepub fn variables_derives(&self) -> Option<&str>
pub fn variables_derives(&self) -> Option<&str>
Comma-separated list of additional traits we want to derive for variables.
Sourcepub fn set_variables_derives(&mut self, variables_derives: String)
pub fn set_variables_derives(&mut self, variables_derives: String)
Comma-separated list of additional traits we want to derive for variables.
Sourcepub fn all_variable_derives(&self) -> impl Iterator<Item = &str>
pub fn all_variable_derives(&self) -> impl Iterator<Item = &str>
All the variable derives to be rendered.
Sourcepub fn all_response_derives(&self) -> impl Iterator<Item = &str>
pub fn all_response_derives(&self) -> impl Iterator<Item = &str>
Traits we want to derive for responses.
Sourcepub fn additional_response_derives(&self) -> impl Iterator<Item = &str>
pub fn additional_response_derives(&self) -> impl Iterator<Item = &str>
Additional traits we want to derive for responses.
Sourcepub fn set_response_derives(&mut self, response_derives: String)
pub fn set_response_derives(&mut self, response_derives: String)
Comma-separated list of additional traits we want to derive for responses.
Sourcepub fn set_deprecation_strategy(
&mut self,
deprecation_strategy: DeprecationStrategy,
)
pub fn set_deprecation_strategy( &mut self, deprecation_strategy: DeprecationStrategy, )
The deprecation strategy to adopt.
Sourcepub fn set_module_visibility(&mut self, visibility: Visibility)
pub fn set_module_visibility(&mut self, visibility: Visibility)
Target module visibility.
Sourcepub fn set_struct_name(&mut self, struct_name: String)
pub fn set_struct_name(&mut self, struct_name: String)
The name of implementation target struct.
Sourcepub fn set_operation_name(&mut self, operation_name: String)
pub fn set_operation_name(&mut self, operation_name: String)
Name of the operation we want to generate code for. If none is selected, it means all operations.
Sourcepub fn schema_file(&self) -> Option<&Path>
pub fn schema_file(&self) -> Option<&Path>
A path to a file to include in the module to force Cargo to take into account changes in the schema files when recompiling.
Sourcepub fn query_file(&self) -> Option<&Path>
pub fn query_file(&self) -> Option<&Path>
A path to a file to include in the module to force Cargo to take into account changes in the query files when recompiling.
Sourcepub fn set_struct_ident(&mut self, ident: Ident)
pub fn set_struct_ident(&mut self, ident: Ident)
The identifier to use when referring to the struct implementing GraphQLQuery, if any.
Sourcepub fn struct_ident(&self) -> Option<&Ident>
pub fn struct_ident(&self) -> Option<&Ident>
The identifier to use when referring to the struct implementing GraphQLQuery, if any.
Sourcepub fn set_normalization(&mut self, norm: Normalization)
pub fn set_normalization(&mut self, norm: Normalization)
Set the normalization mode for the generated code.
Sourcepub fn normalization(&self) -> &Normalization
pub fn normalization(&self) -> &Normalization
The normalization mode for the generated code.
Sourcepub fn custom_scalars_module(&self) -> Option<&Path>
pub fn custom_scalars_module(&self) -> Option<&Path>
Get the custom scalar definitions module
Sourcepub fn set_custom_scalars_module(&mut self, module: Path)
pub fn set_custom_scalars_module(&mut self, module: Path)
Set the custom scalar definitions module
Sourcepub fn extern_enums(&self) -> &[String]
pub fn extern_enums(&self) -> &[String]
Get the externally defined enums type names
Sourcepub fn set_extern_enums(&mut self, enums: Vec<String>)
pub fn set_extern_enums(&mut self, enums: Vec<String>)
Set the externally defined enums type names
Sourcepub fn set_fragments_other_variant(&mut self, fragments_other_variant: bool)
pub fn set_fragments_other_variant(&mut self, fragments_other_variant: bool)
Set the graphql client codegen options’s fragments other variant.
Sourcepub fn fragments_other_variant(&self) -> &bool
pub fn fragments_other_variant(&self) -> &bool
Get a reference to the graphql client codegen options’s fragments other variant.
Sourcepub fn set_skip_serializing_none(&mut self, skip_serializing_none: bool)
pub fn set_skip_serializing_none(&mut self, skip_serializing_none: bool)
Set the graphql client codegen option’s skip none value.
Sourcepub fn skip_serializing_none(&self) -> &bool
pub fn skip_serializing_none(&self) -> &bool
Get a reference to the graphql client codegen option’s skip none value.
Auto Trait Implementations§
impl Freeze for GraphQLClientCodegenOptions
impl RefUnwindSafe for GraphQLClientCodegenOptions
impl !Send for GraphQLClientCodegenOptions
impl !Sync for GraphQLClientCodegenOptions
impl Unpin for GraphQLClientCodegenOptions
impl UnwindSafe for GraphQLClientCodegenOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more