Support graphql ListType (#2061)

master
Tim Griesser 2017-06-08 12:34:35 -04:00 committed by Christopher Chedeau
parent 883e637fa9
commit df26cc05cc
3 changed files with 37 additions and 0 deletions

View File

@ -250,6 +250,14 @@ function genericPrint(path, options, print) {
]);
}
case "ListType": {
return concat([
"[",
path.call(print, "type"),
"]"
])
}
default:
throw new Error("unknown graphql type: " + JSON.stringify(n.kind));
}

View File

@ -10,6 +10,14 @@ $bar: String = "Long string here", $arg: String = "Hello world!",,,,,
$nonNull: String!) {
hello
}
query lists($foo: [Int ], $bar: [Int!], $arg: [ Int! ]!) {
ok
}
query listslong($foo: [String ], $bar: [String!], $arg: [ Int! ]!, $veryLongName: [ Int! ]) {
ok
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
query short($foo: ComplexType, $site: Site = MOBILE, $nonNull: Int!) {
hello
@ -24,4 +32,17 @@ query long(
) {
hello
}
query lists($foo: [Int], $bar: [Int!], $arg: [Int!]!) {
ok
}
query listslong(
$foo: [String],
$bar: [String!],
$arg: [Int!]!,
$veryLongName: [Int!]
) {
ok
}
`;

View File

@ -7,3 +7,11 @@ $bar: String = "Long string here", $arg: String = "Hello world!",,,,,
$nonNull: String!) {
hello
}
query lists($foo: [Int ], $bar: [Int!], $arg: [ Int! ]!) {
ok
}
query listslong($foo: [String ], $bar: [String!], $arg: [ Int! ]!, $veryLongName: [ Int! ]) {
ok
}