mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-04-10 04:31:02 +00:00
Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
|
f438a726cd | ||
|
464b8fee6e | ||
|
9a8c1b09e3 | ||
|
96047246c6 | ||
|
26b445515f | ||
|
8a8a354943 | ||
|
dc0616edaf |
10 changed files with 738 additions and 37 deletions
|
@ -1,4 +1,9 @@
|
|||
# Changelog
|
||||
#### v0.11.6
|
||||
- Switched to MIT License
|
||||
- Restored `noLocation` option for parser
|
||||
- Several minor bugfixes and improvements
|
||||
|
||||
#### v0.11.5
|
||||
- Allow objects with __toString in IDType
|
||||
|
||||
|
|
41
LICENSE
41
LICENSE
|
@ -1,28 +1,21 @@
|
|||
Copyright (c) 2015, webonyx
|
||||
All rights reserved.
|
||||
MIT License
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
Copyright (c) 2015-present, Webonyx, LLC.
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of graphql-php nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "webonyx/graphql-php",
|
||||
"description": "A PHP port of GraphQL reference implementation",
|
||||
"type": "library",
|
||||
"license": "BSD",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/webonyx/graphql-php",
|
||||
"keywords": [
|
||||
"graphql",
|
||||
|
|
|
@ -99,10 +99,12 @@ abstract class Node
|
|||
} else {
|
||||
$tmp = (array) $this;
|
||||
|
||||
$tmp['loc'] = [
|
||||
'start' => $this->loc->start,
|
||||
'end' => $this->loc->end
|
||||
];
|
||||
if ($this->loc) {
|
||||
$tmp['loc'] = [
|
||||
'start' => $this->loc->start,
|
||||
'end' => $this->loc->end
|
||||
];
|
||||
}
|
||||
|
||||
return $tmp;
|
||||
}
|
||||
|
@ -116,16 +118,22 @@ abstract class Node
|
|||
{
|
||||
$result = [
|
||||
'kind' => $node->kind,
|
||||
'loc' => [
|
||||
];
|
||||
|
||||
if ($node->loc) {
|
||||
$result['loc'] = [
|
||||
'start' => $node->loc->start,
|
||||
'end' => $node->loc->end
|
||||
]
|
||||
];
|
||||
];
|
||||
}
|
||||
|
||||
foreach (get_object_vars($node) as $prop => $propValue) {
|
||||
if (isset($result[$prop]))
|
||||
continue;
|
||||
|
||||
if ($prop === 'loc' && $propValue === null)
|
||||
continue;
|
||||
|
||||
if (is_array($propValue) || $propValue instanceof NodeList) {
|
||||
$tmp = [];
|
||||
foreach ($propValue as $tmp1) {
|
||||
|
|
|
@ -482,9 +482,9 @@ class Helper
|
|||
throw new RequestError('Missing "Content-Type" header');
|
||||
}
|
||||
|
||||
if (stripos('application/graphql', $contentType[0]) !== false) {
|
||||
if (stripos($contentType[0], 'application/graphql') !== false) {
|
||||
$bodyParams = ['query' => $request->getBody()->getContents()];
|
||||
} else if (stripos('application/json', $contentType[0]) !== false) {
|
||||
} else if (stripos($contentType[0], 'application/json') !== false) {
|
||||
$bodyParams = $request->getParsedBody();
|
||||
|
||||
if (null === $bodyParams) {
|
||||
|
|
|
@ -251,11 +251,11 @@ class Schema
|
|||
|
||||
foreach ($types as $index => $type) {
|
||||
if (!$type instanceof Type) {
|
||||
throw new InvariantViolation(
|
||||
throw new InvariantViolation(sprintf(
|
||||
'Each entry of schema types must be instance of GraphQL\Type\Definition\Type but entry at %s is %s',
|
||||
$index,
|
||||
Utils::printSafe($type)
|
||||
);
|
||||
));
|
||||
}
|
||||
yield $type;
|
||||
}
|
||||
|
|
|
@ -336,7 +336,7 @@ class Utils
|
|||
return 'false';
|
||||
}
|
||||
if (true === $var) {
|
||||
return 'false';
|
||||
return 'true';
|
||||
}
|
||||
if (is_string($var)) {
|
||||
return "\"$var\"";
|
||||
|
|
|
@ -96,6 +96,12 @@ class DocumentValidator
|
|||
if (null === $rules) {
|
||||
$rules = static::allRules();
|
||||
}
|
||||
|
||||
if (true === is_array($rules) && 0 === count($rules)) {
|
||||
// Skip validation if there are no rules
|
||||
return [];
|
||||
}
|
||||
|
||||
$typeInfo = $typeInfo ?: new TypeInfo($schema);
|
||||
$errors = static::visitUsingRules($schema, $typeInfo, $ast, $rules);
|
||||
return $errors;
|
||||
|
|
|
@ -26,6 +26,23 @@ class SerializationTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertNodesAreEqual($parsedAst, $actualAst);
|
||||
}
|
||||
|
||||
public function testSerializeSupportsNoLocationOption()
|
||||
{
|
||||
$kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql');
|
||||
$ast = Parser::parse($kitchenSink, ['noLocation' => true]);
|
||||
$expectedAst = json_decode(file_get_contents(__DIR__ . '/kitchen-sink-noloc.ast'), true);
|
||||
$this->assertEquals($expectedAst, $ast->toArray(true));
|
||||
}
|
||||
|
||||
public function testUnserializeSupportsNoLocationOption()
|
||||
{
|
||||
$kitchenSink = file_get_contents(__DIR__ . '/kitchen-sink.graphql');
|
||||
$serializedAst = json_decode(file_get_contents(__DIR__ . '/kitchen-sink-noloc.ast'), true);
|
||||
$actualAst = AST::fromArray($serializedAst);
|
||||
$parsedAst = Parser::parse($kitchenSink, ['noLocation' => true]);
|
||||
$this->assertNodesAreEqual($parsedAst, $actualAst);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two nodes by actually iterating over all NodeLists, properly comparing locations (ignoring tokens), etc
|
||||
*
|
||||
|
|
672
tests/Language/kitchen-sink-noloc.ast
Normal file
672
tests/Language/kitchen-sink-noloc.ast
Normal file
|
@ -0,0 +1,672 @@
|
|||
{
|
||||
"kind": "Document",
|
||||
"definitions": [
|
||||
{
|
||||
"kind": "OperationDefinition",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "queryName"
|
||||
},
|
||||
"operation": "query",
|
||||
"variableDefinitions": [
|
||||
{
|
||||
"kind": "VariableDefinition",
|
||||
"variable": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "foo"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"kind": "NamedType",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "ComplexType"
|
||||
}
|
||||
},
|
||||
"defaultValue": null
|
||||
},
|
||||
{
|
||||
"kind": "VariableDefinition",
|
||||
"variable": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "site"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"kind": "NamedType",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "Site"
|
||||
}
|
||||
},
|
||||
"defaultValue": {
|
||||
"kind": "EnumValue",
|
||||
"value": "MOBILE"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "node"
|
||||
},
|
||||
"alias": {
|
||||
"kind": "Name",
|
||||
"value": "whoever123is"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "ListValue",
|
||||
"values": [
|
||||
{
|
||||
"kind": "IntValue",
|
||||
"value": "123"
|
||||
},
|
||||
{
|
||||
"kind": "IntValue",
|
||||
"value": "456"
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "id"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "id"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
},
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
"typeCondition": {
|
||||
"kind": "NamedType",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "User"
|
||||
}
|
||||
},
|
||||
"directives": [
|
||||
{
|
||||
"kind": "Directive",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "defer"
|
||||
},
|
||||
"arguments": []
|
||||
}
|
||||
],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "field2"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "id"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
},
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "field1"
|
||||
},
|
||||
"alias": {
|
||||
"kind": "Name",
|
||||
"value": "alias"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "IntValue",
|
||||
"value": "10"
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "first"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "foo"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "after"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": [
|
||||
{
|
||||
"kind": "Directive",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "include"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "foo"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "if"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "id"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
},
|
||||
{
|
||||
"kind": "FragmentSpread",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "frag"
|
||||
},
|
||||
"directives": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
"typeCondition": null,
|
||||
"directives": [
|
||||
{
|
||||
"kind": "Directive",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "skip"
|
||||
},
|
||||
"arguments": [
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "foo"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "unless"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "id"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "InlineFragment",
|
||||
"typeCondition": null,
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "id"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "OperationDefinition",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "likeStory"
|
||||
},
|
||||
"operation": "mutation",
|
||||
"variableDefinitions": [],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "like"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "IntValue",
|
||||
"value": "123"
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "story"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": [
|
||||
{
|
||||
"kind": "Directive",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "defer"
|
||||
},
|
||||
"arguments": []
|
||||
}
|
||||
],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "story"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "id"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "OperationDefinition",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "StoryLikeSubscription"
|
||||
},
|
||||
"operation": "subscription",
|
||||
"variableDefinitions": [
|
||||
{
|
||||
"kind": "VariableDefinition",
|
||||
"variable": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "input"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"kind": "NamedType",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "StoryLikeSubscribeInput"
|
||||
}
|
||||
},
|
||||
"defaultValue": null
|
||||
}
|
||||
],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "storyLikeSubscribe"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "input"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "input"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "story"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "likers"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "count"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "likeSentence"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "text"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "FragmentDefinition",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "frag"
|
||||
},
|
||||
"typeCondition": {
|
||||
"kind": "NamedType",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "Friend"
|
||||
}
|
||||
},
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "foo"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "size"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "size"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "Variable",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "b"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "bar"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "ObjectValue",
|
||||
"fields": [
|
||||
{
|
||||
"kind": "ObjectField",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "key"
|
||||
},
|
||||
"value": {
|
||||
"kind": "StringValue",
|
||||
"value": "value"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "obj"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "OperationDefinition",
|
||||
"name": null,
|
||||
"operation": "query",
|
||||
"variableDefinitions": null,
|
||||
"directives": [],
|
||||
"selectionSet": {
|
||||
"kind": "SelectionSet",
|
||||
"selections": [
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "unnamed"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "BooleanValue",
|
||||
"value": true
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "truthy"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "BooleanValue",
|
||||
"value": false
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "falsey"
|
||||
}
|
||||
},
|
||||
{
|
||||
"kind": "Argument",
|
||||
"value": {
|
||||
"kind": "NullValue"
|
||||
},
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "nullish"
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
},
|
||||
{
|
||||
"kind": "Field",
|
||||
"name": {
|
||||
"kind": "Name",
|
||||
"value": "query"
|
||||
},
|
||||
"alias": null,
|
||||
"arguments": [],
|
||||
"directives": [],
|
||||
"selectionSet": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Reference in a new issue