Skip to content
This repository has been archived by the owner on Jun 3, 2022. It is now read-only.

atsuhiro/codegen-for-async-graphql

Repository files navigation

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()

Releases

No releases published

Packages

No packages published

Languages