juniper/integration_tests/juniper_2018_edition_tests/src/main.rs
theduke d015a3ca66 (ci) Check formatting with cargo fmt (#302)
This adds a new extra CI job for checking the formatting
with cargo fmt --check.
2018-12-19 10:27:49 -08:00

34 lines
748 B
Rust

/// A VERY minimal test case that ensures that
/// macros and custom derives work in 2018 edition crates.
/// This can be removed once juniper is refactored to the 2018 edition.
#[derive(juniper::GraphQLEnum, PartialEq, Eq, Clone, Copy, Debug)]
enum TaskStatus {
Todo,
Done,
Closed,
}
#[derive(juniper::GraphQLObject, Clone, Debug)]
struct Task {
pub id: i32,
pub status: TaskStatus,
pub title: String,
pub description: Option<String>,
}
#[derive(juniper::GraphQLInputObject, Clone, Debug)]
struct TaskCreate {
pub title: String,
pub description: Option<String>,
}
struct Query;
juniper::graphql_object!(Query: () |&self| {
field task(id: i32) -> Task {
unimplemented!()
}
});
fn main() {}