Crates.io | wundergraph_derive |
lib.rs | wundergraph_derive |
version | 0.1.0 |
source | src |
created_at | 2019-11-07 22:42:29.151989 |
updated_at | 2019-11-07 22:42:29.151989 |
description | Internal proc macro implementation for wundergraph |
homepage | |
repository | https://github.com/weiznich/wundergraph |
max_upload_size | |
id | 179185 |
size | 56,993 |
Wundergraph provides a platform to easily expose your database through a GraphQL interface.
This library is currently a prof of concept. Expect bugs and crashes everywhere
For a full example application see the example project
#[macro_use] extern crate diesel;
use wundergraph::prelude::*;
table! {
heros {
id -> Integer,
name -> Text,
hair_color -> Nullable<Text>,
species -> Integer,
}
}
table! {
species {
id -> Integer,
name -> Text,
}
}
#[derive(Clone, Debug, Identifiable, WundergraphEntity)]
#[table_name = "heros"]
pub struct Hero {
id: i32,
name: String,
hair_color: Option<String>,
species: HasOne<i32, Species>,
}
#[derive(Clone, Debug, Identifiable, WundergraphEntity)]
#[table_name = "species"]
pub struct Species {
id: i32,
name: String,
heros: HasMany<Hero, heros::species>,
}
wundergraph::query_object!{
Query {
Hero,
Species,
}
}
Licensed under either of these:
Unless you explicitly state otherwise, any contribution you intentionally submit for inclusion in the work, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.