Support graphql NonNullType (#2060)
parent
126727380d
commit
e9045e4bcf
|
@ -243,6 +243,13 @@ function genericPrint(path, options, print) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "NonNullType": {
|
||||||
|
return concat([
|
||||||
|
path.call(print, "type"),
|
||||||
|
"!"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Error("unknown graphql type: " + JSON.stringify(n.kind));
|
throw new Error("unknown graphql type: " + JSON.stringify(n.kind));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`variable_definitions.graphql 1`] = `
|
exports[`variable_definitions.graphql 1`] = `
|
||||||
query short($foo:ComplexType, $site : Site = MOBILE) {
|
query short($foo:ComplexType, $site : Site = MOBILE, $nonNull: Int!) {
|
||||||
hello
|
hello
|
||||||
}
|
}
|
||||||
|
|
||||||
query long($foo: ComplexType, $site: Float = 124241.12312,
|
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
|
hello
|
||||||
}
|
}
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
query short($foo: ComplexType, $site: Site = MOBILE) {
|
query short($foo: ComplexType, $site: Site = MOBILE, $nonNull: Int!) {
|
||||||
hello
|
hello
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +19,8 @@ query long(
|
||||||
$foo: ComplexType,
|
$foo: ComplexType,
|
||||||
$site: Float = 124241.12312,
|
$site: Float = 124241.12312,
|
||||||
$bar: String = "Long string here",
|
$bar: String = "Long string here",
|
||||||
$arg: String = "Hello world!"
|
$arg: String = "Hello world!",
|
||||||
|
$nonNull: String!
|
||||||
) {
|
) {
|
||||||
hello
|
hello
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
query short($foo:ComplexType, $site : Site = MOBILE) {
|
query short($foo:ComplexType, $site : Site = MOBILE, $nonNull: Int!) {
|
||||||
hello
|
hello
|
||||||
}
|
}
|
||||||
|
|
||||||
query long($foo: ComplexType, $site: Float = 124241.12312,
|
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
|
hello
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue