d015a3ca66
This adds a new extra CI job for checking the formatting with cargo fmt --check.
34 lines
748 B
Rust
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() {}
|