wundergraph 0.1.1

A GraphQL ORM build on top of diesel
Documentation

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

Short example

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

# fn main() {}

Where to find things

Everything required for basic usage of wundergraph is exposed through wundergraph::prelude. wundergraph::query_builder::selection contains functionality to manual extend or implement a query entity, wundergraph::query_builder::mutations contains similar functionality for mutations. wundergraph::scalar provides the implementation of the internal used juniper scalar value type. wundergraph::error contains the definition of the internal error type. wundergraph::diesel_ext and wundergraph::juniper_ext provide extension traits and types for the corresponding crates. wundergraph::helper contains wundergraph specific helper types.