INNER CODE UNIT · Rust

graphql_query_derive_inner

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

fn graphql_query_derive_inner(
    input: proc_macro::TokenStream,
) -> Result<proc_macro::TokenStream, syn::Error> {
    let input = TokenStream::from(input);
    let ast = syn::parse2(input)?;
    let (query_path, schema_path) = build_query_and_schema_path(&ast)?;
    let options = build_graphql_client_derive_options(&ast, query_path.clone())?;

    generate_module_token_stream(query_path, &schema_path, options)
        .map(Into::into)
        .map_err(|err| {
            syn::Error::new_spanned(
                ast,
                format!("Failed to generate GraphQLQuery impl: {}", err),
            )
        })
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…