Function graphql_id::select_operation[][src]

pub fn select_operation(
    query: &str,
    operation_name: &str
) -> Result<String, GraphQLError>

Select an operation in the query and remove the unused fragments and other operations

Examples

    use graphql_id::*;
    let query = "
        query A { foo }
        query B { bar }
    ";
    select_operation(&query, &"A"); // -> "query A { foo }"