INNER CODE UNIT · Rust

generate_module_token_stream_inner

graphql-rust/graphql-client · graphql_client_codegen/src/lib.rs:120

fn generate_module_token_stream_inner(
    query: &(String, QueryDocument),
    schema: &Schema,
    options: GraphQLClientCodegenOptions,
) -> Result<TokenStream, BoxError> {
    let (query_string, query_document) = query;

    // We need to qualify the query with the path to the crate it is part of
    let query = crate::query::resolve(schema, query_document)?;

    // Determine which operation we are generating code for. This will be used in operationName.
    let operations = options
        .operation_name
        .as_ref()
        .and_then(|operation_name| query.select_operation(operation_name, *options.normalization()))
        .map(|op| vec![op]);

    let operations = match (operations, &options.mode) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…