Version 4.5.0

This commit is contained in:
Neo committed 2025-12-19 05:51:58 -08:00
1 parent 1a0c7fd3c2
commit f79dcf067a
3791 files changed
+248032 -76372

No files matched your search

@@ -0,0 +1,17 @@
<?php
namespace GraphQL\Language\AST;
class ArgumentNode extends Node
{
public $kind = NodeKind::ARGUMENT;
/**
* @var ValueNode
*/
public $value;
/**
* @var NameNode
*/
public $name;
}
@@ -0,0 +1,13 @@
<?php
namespace GraphQL\Language\AST;
class BooleanValueNode extends Node implements ValueNode
{
public $kind = NodeKind::BOOLEAN;
/**
* @var string
*/
public $value;
}
@@ -0,0 +1,11 @@
<?php
namespace GraphQL\Language\AST;
interface DefinitionNode
{
/**
* export type DefinitionNode = OperationDefinitionNode
* | FragmentDefinitionNode
* | TypeSystemDefinitionNode // experimental non-spec addition.
*/
}
@@ -0,0 +1,25 @@
<?php
namespace GraphQL\Language\AST;
class DirectiveDefinitionNode extends Node implements TypeSystemDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::DIRECTIVE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var ArgumentNode[]
*/
public $arguments;
/**
* @var NameNode[]
*/
public $locations;
}
@@ -0,0 +1,17 @@
<?php
namespace GraphQL\Language\AST;
class DirectiveNode extends Node
{
public $kind = NodeKind::DIRECTIVE;
/**
* @var NameNode
*/
public $name;
/**
* @var ArgumentNode[]
*/
public $arguments;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class DocumentNode extends Node
{
public $kind = NodeKind::DOCUMENT;
/**
* @var DefinitionNode[]
*/
public $definitions;
}
@@ -0,0 +1,30 @@
<?php
namespace GraphQL\Language\AST;
class EnumTypeDefinitionNode extends Node implements TypeDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::ENUM_TYPE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var EnumValueDefinitionNode[]
*/
public $values;
/**
* @var string
*/
public $description;
}
@@ -0,0 +1,25 @@
<?php
namespace GraphQL\Language\AST;
class EnumValueDefinitionNode extends Node
{
/**
* @var string
*/
public $kind = NodeKind::ENUM_VALUE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var string
*/
public $description;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class EnumValueNode extends Node implements ValueNode
{
public $kind = NodeKind::ENUM;
/**
* @var string
*/
public $value;
}
@@ -0,0 +1,35 @@
<?php
namespace GraphQL\Language\AST;
class FieldDefinitionNode extends Node
{
/**
* @var string
*/
public $kind = NodeKind::FIELD_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var InputValueDefinitionNode[]
*/
public $arguments;
/**
* @var TypeNode
*/
public $type;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var string
*/
public $description;
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace GraphQL\Language\AST;
class FieldNode extends Node implements SelectionNode
{
public $kind = NodeKind::FIELD;
/**
* @var NameNode
*/
public $name;
/**
* @var NameNode|null
*/
public $alias;
/**
* @var ArgumentNode[]|null
*/
public $arguments;
/**
* @var DirectiveNode[]|null
*/
public $directives;
/**
* @var SelectionSetNode|null
*/
public $selectionSet;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class FloatValueNode extends Node implements ValueNode
{
public $kind = NodeKind::FLOAT;
/**
* @var string
*/
public $value;
}
@@ -0,0 +1,27 @@
<?php
namespace GraphQL\Language\AST;
class FragmentDefinitionNode extends Node implements DefinitionNode, HasSelectionSet
{
public $kind = NodeKind::FRAGMENT_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var NamedTypeNode
*/
public $typeCondition;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var SelectionSetNode
*/
public $selectionSet;
}
@@ -0,0 +1,17 @@
<?php
namespace GraphQL\Language\AST;
class FragmentSpreadNode extends Node implements SelectionNode
{
public $kind = NodeKind::FRAGMENT_SPREAD;
/**
* @var NameNode
*/
public $name;
/**
* @var DirectiveNode[]
*/
public $directives;
}
@@ -0,0 +1,10 @@
<?php
namespace GraphQL\Language\AST;
interface HasSelectionSet
{
/**
* export type DefinitionNode = OperationDefinitionNode
* | FragmentDefinitionNode
*/
}
@@ -0,0 +1,22 @@
<?php
namespace GraphQL\Language\AST;
class InlineFragmentNode extends Node implements SelectionNode
{
public $kind = NodeKind::INLINE_FRAGMENT;
/**
* @var NamedTypeNode
*/
public $typeCondition;
/**
* @var DirectiveNode[]|null
*/
public $directives;
/**
* @var SelectionSetNode
*/
public $selectionSet;
}
@@ -0,0 +1,30 @@
<?php
namespace GraphQL\Language\AST;
class InputObjectTypeDefinitionNode extends Node implements TypeDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::INPUT_OBJECT_TYPE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var InputValueDefinitionNode[]
*/
public $fields;
/**
* @var string
*/
public $description;
}
@@ -0,0 +1,35 @@
<?php
namespace GraphQL\Language\AST;
class InputValueDefinitionNode extends Node
{
/**
* @var string
*/
public $kind = NodeKind::INPUT_VALUE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var TypeNode
*/
public $type;
/**
* @var ValueNode
*/
public $defaultValue;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var string
*/
public $description;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class IntValueNode extends Node implements ValueNode
{
public $kind = NodeKind::INT;
/**
* @var string
*/
public $value;
}
@@ -0,0 +1,30 @@
<?php
namespace GraphQL\Language\AST;
class InterfaceTypeDefinitionNode extends Node implements TypeDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::INTERFACE_TYPE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var FieldDefinitionNode[]
*/
public $fields = [];
/**
* @var string
*/
public $description;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class ListTypeNode extends Node implements TypeNode
{
public $kind = NodeKind::LIST_TYPE;
/**
* @var Node
*/
public $type;
}
@@ -0,0 +1,13 @@
<?php
namespace GraphQL\Language\AST;
class ListValueNode extends Node implements ValueNode
{
public $kind = NodeKind::LST;
/**
* @var ValueNode[]
*/
public $values;
}
+72
View File
@@ -0,0 +1,72 @@
<?php
namespace GraphQL\Language\AST;
use GraphQL\Language\Source;
use GraphQL\Language\Token;
/**
* Contains a range of UTF-8 character offsets and token references that
* identify the region of the source from which the AST derived.
*/
class Location
{
/**
* The character offset at which this Node begins.
*
* @var int
*/
public $start;
/**
* The character offset at which this Node ends.
*
* @var int
*/
public $end;
/**
* The Token at which this Node begins.
*
* @var Token
*/
public $startToken;
/**
* The Token at which this Node ends.
*
* @var Token
*/
public $endToken;
/**
* The Source document the AST represents.
*
* @var Source|null
*/
public $source;
/**
* @param $start
* @param $end
* @return static
*/
public static function create($start, $end)
{
$tmp = new static();
$tmp->start = $start;
$tmp->end = $end;
return $tmp;
}
public function __construct(Token $startToken = null, Token $endToken = null, Source $source = null)
{
$this->startToken = $startToken;
$this->endToken = $endToken;
$this->source = $source;
if ($startToken && $endToken) {
$this->start = $startToken->start;
$this->end = $endToken->end;
}
}
}
+12
View File
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class NameNode extends Node implements TypeNode
{
public $kind = NodeKind::NAME;
/**
* @var string
*/
public $value;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class NamedTypeNode extends Node implements TypeNode
{
public $kind = NodeKind::NAMED_TYPE;
/**
* @var NameNode
*/
public $name;
}
+146
View File
@@ -0,0 +1,146 @@
<?php
namespace GraphQL\Language\AST;
use GraphQL\Error\InvariantViolation;
use GraphQL\Utils\Utils;
abstract class Node
{
/**
type Node = NameNode
| DocumentNode
| OperationDefinitionNode
| VariableDefinitionNode
| VariableNode
| SelectionSetNode
| FieldNode
| ArgumentNode
| FragmentSpreadNode
| InlineFragmentNode
| FragmentDefinitionNode
| IntValueNode
| FloatValueNode
| StringValueNode
| BooleanValueNode
| EnumValueNode
| ListValueNode
| ObjectValueNode
| ObjectFieldNode
| DirectiveNode
| ListTypeNode
| NonNullTypeNode
*/
public $kind;
/**
* @var Location
*/
public $loc;
/**
* @param array $vars
*/
public function __construct(array $vars)
{
if (!empty($vars)) {
Utils::assign($this, $vars);
}
}
/**
* @return $this
*/
public function cloneDeep()
{
return $this->cloneValue($this);
}
/**
* @param $value
* @return array|Node
*/
private function cloneValue($value)
{
if (is_array($value)) {
$cloned = [];
foreach ($value as $key => $arrValue) {
$cloned[$key] = $this->cloneValue($arrValue);
}
} else if ($value instanceof Node) {
$cloned = clone $value;
foreach (get_object_vars($cloned) as $prop => $propValue) {
$cloned->{$prop} = $this->cloneValue($propValue);
}
} else {
$cloned = $value;
}
return $cloned;
}
/**
* @return string
*/
public function __toString()
{
$tmp = $this->toArray(true);
return json_encode($tmp);
}
/**
* @param bool $recursive
* @return array
*/
public function toArray($recursive = false)
{
if ($recursive) {
return $this->recursiveToArray($this);
} else {
$tmp = (array) $this;
$tmp['loc'] = [
'start' => $this->loc->start,
'end' => $this->loc->end
];
return $tmp;
}
}
/**
* @param Node $node
* @return array
*/
private function recursiveToArray(Node $node)
{
$result = [
'kind' => $node->kind,
'loc' => [
'start' => $node->loc->start,
'end' => $node->loc->end
]
];
foreach (get_object_vars($node) as $prop => $propValue) {
if (isset($result[$prop]))
continue;
if (is_array($propValue) || $propValue instanceof NodeList) {
$tmp = [];
foreach ($propValue as $tmp1) {
$tmp[] = $tmp1 instanceof Node ? $this->recursiveToArray($tmp1) : (array) $tmp1;
}
} else if ($propValue instanceof Node) {
$tmp = $this->recursiveToArray($propValue);
} else if (is_scalar($propValue) || null === $propValue) {
$tmp = $propValue;
} else {
$tmp = null;
}
$result[$prop] = $tmp;
}
return $result;
}
}
+135
View File
@@ -0,0 +1,135 @@
<?php
namespace GraphQL\Language\AST;
class NodeKind
{
// constants from language/kinds.js:
const NAME = 'Name';
// Document
const DOCUMENT = 'Document';
const OPERATION_DEFINITION = 'OperationDefinition';
const VARIABLE_DEFINITION = 'VariableDefinition';
const VARIABLE = 'Variable';
const SELECTION_SET = 'SelectionSet';
const FIELD = 'Field';
const ARGUMENT = 'Argument';
// Fragments
const FRAGMENT_SPREAD = 'FragmentSpread';
const INLINE_FRAGMENT = 'InlineFragment';
const FRAGMENT_DEFINITION = 'FragmentDefinition';
// Values
const INT = 'IntValue';
const FLOAT = 'FloatValue';
const STRING = 'StringValue';
const BOOLEAN = 'BooleanValue';
const ENUM = 'EnumValue';
const NULL = 'NullValue';
const LST = 'ListValue';
const OBJECT = 'ObjectValue';
const OBJECT_FIELD = 'ObjectField';
// Directives
const DIRECTIVE = 'Directive';
// Types
const NAMED_TYPE = 'NamedType';
const LIST_TYPE = 'ListType';
const NON_NULL_TYPE = 'NonNullType';
// Type System Definitions
const SCHEMA_DEFINITION = 'SchemaDefinition';
const OPERATION_TYPE_DEFINITION = 'OperationTypeDefinition';
// Type Definitions
const SCALAR_TYPE_DEFINITION = 'ScalarTypeDefinition';
const OBJECT_TYPE_DEFINITION = 'ObjectTypeDefinition';
const FIELD_DEFINITION = 'FieldDefinition';
const INPUT_VALUE_DEFINITION = 'InputValueDefinition';
const INTERFACE_TYPE_DEFINITION = 'InterfaceTypeDefinition';
const UNION_TYPE_DEFINITION = 'UnionTypeDefinition';
const ENUM_TYPE_DEFINITION = 'EnumTypeDefinition';
const ENUM_VALUE_DEFINITION = 'EnumValueDefinition';
const INPUT_OBJECT_TYPE_DEFINITION = 'InputObjectTypeDefinition';
// Type Extensions
const TYPE_EXTENSION_DEFINITION = 'TypeExtensionDefinition';
// Directive Definitions
const DIRECTIVE_DEFINITION = 'DirectiveDefinition';
/**
* @todo conver to const array when moving to PHP5.6
* @var array
*/
public static $classMap = [
NodeKind::NAME => NameNode::class,
// Document
NodeKind::DOCUMENT => DocumentNode::class,
NodeKind::OPERATION_DEFINITION => OperationDefinitionNode::class,
NodeKind::VARIABLE_DEFINITION => VariableDefinitionNode::class,
NodeKind::VARIABLE => VariableNode::class,
NodeKind::SELECTION_SET => SelectionSetNode::class,
NodeKind::FIELD => FieldNode::class,
NodeKind::ARGUMENT => ArgumentNode::class,
// Fragments
NodeKind::FRAGMENT_SPREAD => FragmentSpreadNode::class,
NodeKind::INLINE_FRAGMENT => InlineFragmentNode::class,
NodeKind::FRAGMENT_DEFINITION => FragmentDefinitionNode::class,
// Values
NodeKind::INT => IntValueNode::class,
NodeKind::FLOAT => FloatValueNode::class,
NodeKind::STRING => StringValueNode::class,
NodeKind::BOOLEAN => BooleanValueNode::class,
NodeKind::ENUM => EnumValueNode::class,
NodeKind::NULL => NullValueNode::class,
NodeKind::LST => ListValueNode::class,
NodeKind::OBJECT => ObjectValueNode::class,
NodeKind::OBJECT_FIELD => ObjectFieldNode::class,
// Directives
NodeKind::DIRECTIVE => DirectiveNode::class,
// Types
NodeKind::NAMED_TYPE => NamedTypeNode::class,
NodeKind::LIST_TYPE => ListTypeNode::class,
NodeKind::NON_NULL_TYPE => NonNullTypeNode::class,
// Type System Definitions
NodeKind::SCHEMA_DEFINITION => SchemaDefinitionNode::class,
NodeKind::OPERATION_TYPE_DEFINITION => OperationTypeDefinitionNode::class,
// Type Definitions
NodeKind::SCALAR_TYPE_DEFINITION => ScalarTypeDefinitionNode::class,
NodeKind::OBJECT_TYPE_DEFINITION => ObjectTypeDefinitionNode::class,
NodeKind::FIELD_DEFINITION => FieldDefinitionNode::class,
NodeKind::INPUT_VALUE_DEFINITION => InputValueDefinitionNode::class,
NodeKind::INTERFACE_TYPE_DEFINITION => InterfaceTypeDefinitionNode::class,
NodeKind::UNION_TYPE_DEFINITION => UnionTypeDefinitionNode::class,
NodeKind::ENUM_TYPE_DEFINITION => EnumTypeDefinitionNode::class,
NodeKind::ENUM_VALUE_DEFINITION => EnumValueDefinitionNode::class,
NodeKind::INPUT_OBJECT_TYPE_DEFINITION =>InputObjectTypeDefinitionNode::class,
// Type Extensions
NodeKind::TYPE_EXTENSION_DEFINITION => TypeExtensionDefinitionNode::class,
// Directive Definitions
NodeKind::DIRECTIVE_DEFINITION => DirectiveDefinitionNode::class
];
}
+121
View File
@@ -0,0 +1,121 @@
<?php
namespace GraphQL\Language\AST;
use GraphQL\Utils\AST;
/**
* Class NodeList
*
* @package GraphQL\Utils
*/
class NodeList implements \ArrayAccess, \IteratorAggregate, \Countable
{
/**
* @var array
*/
private $nodes;
/**
* @param array $nodes
* @return static
*/
public static function create(array $nodes)
{
return new static($nodes);
}
/**
* NodeList constructor.
* @param array $nodes
*/
public function __construct(array $nodes)
{
$this->nodes = $nodes;
}
/**
* @param mixed $offset
* @return bool
*/
public function offsetExists($offset)
{
return isset($this->nodes[$offset]);
}
/**
* @param mixed $offset
* @return mixed
*/
public function offsetGet($offset)
{
$item = $this->nodes[$offset];
if (is_array($item) && isset($item['kind'])) {
$this->nodes[$offset] = $item = AST::fromArray($item);
}
return $item;
}
/**
* @param mixed $offset
* @param mixed $value
*/
public function offsetSet($offset, $value)
{
if (is_array($value) && isset($value['kind'])) {
$value = AST::fromArray($value);
}
$this->nodes[$offset] = $value;
}
/**
* @param mixed $offset
*/
public function offsetUnset($offset)
{
unset($this->nodes[$offset]);
}
/**
* @param int $offset
* @param int $length
* @param mixed $replacement
* @return NodeList
*/
public function splice($offset, $length, $replacement = null)
{
return new NodeList(array_splice($this->nodes, $offset, $length, $replacement));
}
/**
* @param $list
* @return NodeList
*/
public function merge($list)
{
if ($list instanceof NodeList) {
$list = $list->nodes;
}
return new NodeList(array_merge($this->nodes, $list));
}
/**
* @return \Generator
*/
public function getIterator()
{
$count = count($this->nodes);
for ($i = 0; $i < $count; $i++) {
yield $this->offsetGet($i);
}
}
/**
* @return int
*/
public function count()
{
return count($this->nodes);
}
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class NonNullTypeNode extends Node implements TypeNode
{
public $kind = NodeKind::NON_NULL_TYPE;
/**
* @var NameNode | ListTypeNode
*/
public $type;
}
@@ -0,0 +1,7 @@
<?php
namespace GraphQL\Language\AST;
class NullValueNode extends Node implements ValueNode
{
public $kind = NodeKind::NULL;
}
@@ -0,0 +1,18 @@
<?php
namespace GraphQL\Language\AST;
class ObjectFieldNode extends Node
{
public $kind = NodeKind::OBJECT_FIELD;
/**
* @var NameNode
*/
public $name;
/**
* @var ValueNode
*/
public $value;
}
@@ -0,0 +1,35 @@
<?php
namespace GraphQL\Language\AST;
class ObjectTypeDefinitionNode extends Node implements TypeDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::OBJECT_TYPE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var NamedTypeNode[]
*/
public $interfaces = [];
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var FieldDefinitionNode[]
*/
public $fields;
/**
* @var string
*/
public $description;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class ObjectValueNode extends Node implements ValueNode
{
public $kind = NodeKind::OBJECT;
/**
* @var ObjectFieldNode[]
*/
public $fields;
}
@@ -0,0 +1,35 @@
<?php
namespace GraphQL\Language\AST;
class OperationDefinitionNode extends Node implements DefinitionNode, HasSelectionSet
{
/**
* @var string
*/
public $kind = NodeKind::OPERATION_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var string (oneOf 'query', 'mutation'))
*/
public $operation;
/**
* @var VariableDefinitionNode[]
*/
public $variableDefinitions;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var SelectionSetNode
*/
public $selectionSet;
}
@@ -0,0 +1,22 @@
<?php
namespace GraphQL\Language\AST;
class OperationTypeDefinitionNode extends Node
{
/**
* @var string
*/
public $kind = NodeKind::OPERATION_TYPE_DEFINITION;
/**
* One of 'query' | 'mutation' | 'subscription'
*
* @var string
*/
public $operation;
/**
* @var NamedTypeNode
*/
public $type;
}
@@ -0,0 +1,25 @@
<?php
namespace GraphQL\Language\AST;
class ScalarTypeDefinitionNode extends Node implements TypeDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::SCALAR_TYPE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var string
*/
public $description;
}
@@ -0,0 +1,20 @@
<?php
namespace GraphQL\Language\AST;
class SchemaDefinitionNode extends Node implements TypeSystemDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::SCHEMA_DEFINITION;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var OperationTypeDefinitionNode[]
*/
public $operationTypes;
}
@@ -0,0 +1,9 @@
<?php
namespace GraphQL\Language\AST;
interface SelectionNode
{
/**
* export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode
*/
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class SelectionSetNode extends Node
{
public $kind = NodeKind::SELECTION_SET;
/**
* @var SelectionNode[]
*/
public $selections;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class StringValueNode extends Node implements ValueNode
{
public $kind = NodeKind::STRING;
/**
* @var string
*/
public $value;
}
@@ -0,0 +1,14 @@
<?php
namespace GraphQL\Language\AST;
interface TypeDefinitionNode extends TypeSystemDefinitionNode
{
/**
export type TypeDefinitionNode = ScalarTypeDefinitionNode
| ObjectTypeDefinitionNode
| InterfaceTypeDefinitionNode
| UnionTypeDefinitionNode
| EnumTypeDefinitionNode
| InputObjectTypeDefinitionNode
*/
}
@@ -0,0 +1,15 @@
<?php
namespace GraphQL\Language\AST;
class TypeExtensionDefinitionNode extends Node implements TypeSystemDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::TYPE_EXTENSION_DEFINITION;
/**
* @var ObjectTypeDefinitionNode
*/
public $definition;
}
+13
View File
@@ -0,0 +1,13 @@
<?php
namespace GraphQL\Language\AST;
interface TypeNode
{
/**
export type TypeNode = NamedTypeNode
| ListTypeNode
| NonNullTypeNode
*/
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
interface TypeSystemDefinitionNode extends DefinitionNode
{
/**
export type TypeSystemDefinitionNode = SchemaDefinitionNode
| TypeDefinitionNode
| TypeExtensionDefinitionNode
| DirectiveDefinitionNode
*/
}
@@ -0,0 +1,30 @@
<?php
namespace GraphQL\Language\AST;
class UnionTypeDefinitionNode extends Node implements TypeDefinitionNode
{
/**
* @var string
*/
public $kind = NodeKind::UNION_TYPE_DEFINITION;
/**
* @var NameNode
*/
public $name;
/**
* @var DirectiveNode[]
*/
public $directives;
/**
* @var NamedTypeNode[]
*/
public $types = [];
/**
* @var string
*/
public $description;
}
+17
View File
@@ -0,0 +1,17 @@
<?php
namespace GraphQL\Language\AST;
/**
export type ValueNode = VariableNode
| IntValueNode
| FloatValueNode
| StringValueNode
| BooleanValueNode
| EnumValueNode
| ListValueNode
| ObjectValueNode
*/
interface ValueNode
{
}
@@ -0,0 +1,22 @@
<?php
namespace GraphQL\Language\AST;
class VariableDefinitionNode extends Node implements DefinitionNode
{
public $kind = NodeKind::VARIABLE_DEFINITION;
/**
* @var VariableNode
*/
public $variable;
/**
* @var TypeNode
*/
public $type;
/**
* @var ValueNode|null
*/
public $defaultValue;
}
@@ -0,0 +1,12 @@
<?php
namespace GraphQL\Language\AST;
class VariableNode extends Node
{
public $kind = NodeKind::VARIABLE;
/**
* @var NameNode
*/
public $name;
}