codegen-for-async-graphql 0.1.0

Internal code generation crate for async-graphql
codegen-for-async-graphql-0.1.0 is not a library.

codegen-for-async-graphql

codecov

Usage

cargo run --bin cargo-codegen-for-async-graphql path_to_schema.graphql path_to_output_dir
mod models;

use async_graphql::*;

use models::{
  Mutation, Query,
};

let data_source = DataSource {};
let schema = Schema::build(Query {}, Mutation {}, EmptySubscription)
    .register_type::<User>()
    .data(data_source)
    .finish();
let res = schema.execute(query).await;
let json = serde_json::to_string_pretty(&async_graphql::http::GQLResponse(res));
json.unwrap()