INNER CODE UNIT · Rust

query_document

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

fn query_document(query_string: &str) -> Result<QueryDocument, BoxError> {
    let document = graphql_parser::parse_query(query_string)
        .map_err(|err| GeneralError(format!("Query parser error: {}", err)))?
        .into_static();
    Ok(document)
}

fn get_set_query_from_file(query_path: &std::path::Path) -> (String, QueryDocument) {
    get_set_cached(&QUERY_CACHE, query_path, || {
        let query_string = read_file(query_path).unwrap();
        let query_document = query_document(&query_string).unwrap();
        (query_string, query_document)
    })
}

fn get_set_schema_from_file(schema_path: &std::path::Path) -> Schema {
    get_set_cached(&SCHEMA_CACHE, schema_path, || {
        let schema_extension = schema_path

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…