codegen-for-async-graphql

Crates.iocodegen-for-async-graphql
lib.rscodegen-for-async-graphql
version0.2.6
sourcesrc
created_at2020-07-06 09:41:50.28186
updated_at2020-07-09 10:56:40.648552
descriptionInternal code generation crate for async-graphql
homepagehttps://github.com/atsuhiro/codegen-for-async-graphql
repositoryhttps://github.com/atsuhiro/codegen-for-async-graphql
max_upload_size
id261901
size96,119
Atsuhiro Takahashi (atsuhiro)

documentation

README

codegen-for-async-graphql

codecov

Usage

cargo codegen-for-async-graphql --schema {path_to_schema} --output {path_to_output}
# cargo codegen-for-async-graphql --schema ./schema.graphql --output src/models
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()
Commit count: 47

cargo fmt