Support graphql NonNullType (#2060)

This commit is contained in:
Tim Griesser authored and Christopher Chedeau committed 2017-06-08 09:20:41 -07:00
1 parent 126727380d
commit e9045e4bcf
3 files changed
+16 -6

No files matched your search

+7
View File
@@ -243,6 +243,13 @@ function genericPrint(path, options, print) {
);
}
case "NonNullType": {
return concat([
path.call(print, "type"),
"!"
]);
}
default:
throw new Error("unknown graphql type: " + JSON.stringify(n.kind));
}
@@ -1,16 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`variable_definitions.graphql 1`] = `
query short($foo:ComplexType, $site : Site = MOBILE) {
query short($foo:ComplexType, $site : Site = MOBILE, $nonNull: Int!) {
hello
}
query long($foo: ComplexType, $site: Float = 124241.12312,
$bar: String = "Long string here", $arg: String = "Hello world!",,,,) {
$bar: String = "Long string here", $arg: String = "Hello world!",,,,,
$nonNull: String!) {
hello
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
query short($foo: ComplexType, $site: Site = MOBILE) {
query short($foo: ComplexType, $site: Site = MOBILE, $nonNull: Int!) {
hello
}
@@ -18,7 +19,8 @@ query long(
$foo: ComplexType,
$site: Float = 124241.12312,
$bar: String = "Long string here",
$arg: String = "Hello world!"
$arg: String = "Hello world!",
$nonNull: String!
) {
hello
}
@@ -1,8 +1,9 @@
query short($foo:ComplexType, $site : Site = MOBILE) {
query short($foo:ComplexType, $site : Site = MOBILE, $nonNull: Int!) {
hello
}
query long($foo: ComplexType, $site: Float = 124241.12312,
$bar: String = "Long string here", $arg: String = "Hello world!",,,,) {
$bar: String = "Long string here", $arg: String = "Hello world!",,,,,
$nonNull: String!) {
hello
}