async-graphql/src/schema/type.rs

47 lines
916 B
Rust
Raw Normal View History

2020-03-03 03:48:00 +00:00
pub struct InputValue {
pub name: &'static str,
pub description: Option<&'static str>,
pub ty: String,
pub default_value: Option<&'static str>,
}
2020-03-02 11:25:21 +00:00
2020-03-03 03:48:00 +00:00
pub struct Field {
pub name: &'static str,
pub description: Option<&'static str>,
pub args: Vec<InputValue>,
pub ty: String,
pub deprecation: Option<&'static str>,
}
2020-03-02 00:24:49 +00:00
2020-03-03 03:48:00 +00:00
pub struct EnumValue {
pub name: &'static str,
pub description: Option<&'static str>,
pub deprecation: Option<&'static str>,
}
2020-03-02 00:24:49 +00:00
2020-03-03 03:48:00 +00:00
pub enum Type {
Scalar,
Object {
fields: Vec<Field>,
},
Interface {
fields: Vec<Field>,
possible_types: Vec<usize>,
},
Union {
possible_types: Vec<usize>,
},
Enum {
enum_values: Vec<EnumValue>,
},
InputObject {
input_fields: Vec<InputValue>,
},
List {
of_type: usize,
},
NonNull {
of_type: usize,
},
2020-03-02 00:24:49 +00:00
}