wundergraph

Crates.iowundergraph
lib.rswundergraph
version0.1.2
sourcesrc
created_at2018-03-28 09:10:56.045877
updated_at2020-03-05 20:32:06.327101
descriptionA GraphQL ORM build on top of diesel
homepage
repositoryhttps://github.com/weiznich/wundergraph
max_upload_size
id57879
size499,160
Georg Semmler (weiznich)

documentation

README

Wundergraph

Wundergraph provides a platform to easily expose your database through a GraphQL interface.

Build Status

Example

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,
   }
}

Building

Depending on your backend choice you need to install a native library. libpq is required for the postgresql feature, libsqlite3 for the sqlite feature.

License

Licensed under either of these:

Contributing

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.

Commit count: 141

cargo fmt