Skip to content

Commit 46c7a27

Browse files
committed
add input types
1 parent ef44b4a commit 46c7a27

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

graphql_query_derive/src/inputs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use std::collections::HashMap;
99
/// Represents an input object type from a GraphQL schema
1010
#[derive(Debug, PartialEq)]
1111
pub struct GqlInput {
12+
pub description: Option<String>,
1213
pub name: String,
1314
pub fields: HashMap<String, GqlObjectField>,
1415
}
@@ -37,6 +38,7 @@ impl GqlInput {
3738
impl ::std::convert::From<graphql_parser::schema::InputObjectType> for GqlInput {
3839
fn from(schema_input: graphql_parser::schema::InputObjectType) -> GqlInput {
3940
GqlInput {
41+
description: schema_input.description,
4042
name: schema_input.name,
4143
fields: schema_input
4244
.fields
@@ -58,6 +60,7 @@ impl ::std::convert::From<graphql_parser::schema::InputObjectType> for GqlInput
5860
impl ::std::convert::From<introspection_response::FullType> for GqlInput {
5961
fn from(schema_input: introspection_response::FullType) -> GqlInput {
6062
GqlInput {
63+
description: schema_input.description,
6164
name: schema_input.name.expect("unnamed input object"),
6265
fields: schema_input
6366
.input_fields
@@ -91,6 +94,7 @@ mod tests {
9194
#[test]
9295
fn gql_input_to_rust() {
9396
let cat = GqlInput {
97+
description: None,
9498
name: "Cat".to_string(),
9599
fields: vec![
96100
(

0 commit comments

Comments
 (0)