INNER CODE UNIT · Rust

build_graphql_client_derive_options

graphql-rust/graphql-client · graphql_query_derive/src/lib.rs:58

fn build_graphql_client_derive_options(
    input: &syn::DeriveInput,
    query_path: PathBuf,
) -> Result<GraphQLClientCodegenOptions, syn::Error> {
    let variables_derives = attributes::extract_attr(input, "variables_derives").ok();
    let response_derives = attributes::extract_attr(input, "response_derives").ok();
    let custom_scalars_module = attributes::extract_attr(input, "custom_scalars_module").ok();
    let extern_enums = attributes::extract_attr_list(input, "extern_enums").ok();
    let fragments_other_variant: bool = attributes::extract_fragments_other_variant(input);
    let skip_serializing_none: bool = attributes::extract_skip_serializing_none(input);
    let custom_variable_types = attributes::extract_attr_list(input, "variable_types").ok();
    let custom_response_type = attributes::extract_attr(input, "response_type").ok();

    let mut options = GraphQLClientCodegenOptions::new(CodegenMode::Derive);
    options.set_query_file(query_path);
    options.set_fragments_other_variant(fragments_other_variant);
    options.set_skip_serializing_none(skip_serializing_none);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…