async-graphql/src/registry/type.rs

60 lines
1.3 KiB
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 {
2020-03-03 11:15:18 +00:00
Scalar {
name: String,
description: Option<&'static str>,
},
2020-03-03 03:48:00 +00:00
Object {
2020-03-03 11:15:18 +00:00
name: &'static str,
description: Option<&'static str>,
2020-03-03 03:48:00 +00:00
fields: Vec<Field>,
},
Interface {
2020-03-03 11:15:18 +00:00
name: &'static str,
description: Option<&'static str>,
2020-03-03 03:48:00 +00:00
fields: Vec<Field>,
possible_types: Vec<usize>,
},
Union {
2020-03-03 11:15:18 +00:00
name: &'static str,
description: Option<&'static str>,
2020-03-03 03:48:00 +00:00
possible_types: Vec<usize>,
},
Enum {
2020-03-03 11:15:18 +00:00
name: &'static str,
description: Option<&'static str>,
2020-03-03 03:48:00 +00:00
enum_values: Vec<EnumValue>,
},
InputObject {
2020-03-03 11:15:18 +00:00
name: &'static str,
description: Option<&'static str>,
2020-03-03 03:48:00 +00:00
input_fields: Vec<InputValue>,
},
List {
of_type: usize,
},
NonNull {
of_type: usize,
},
2020-03-02 00:24:49 +00:00
}