diff --git a/index.html b/index.html index c45a349..35b187e 100755 --- a/index.html +++ b/index.html @@ -280,5 +280,5 @@ existing PHP frameworks, add support for Relay, etc.
diff --git a/mkdocs/search_index.json b/mkdocs/search_index.json index b6dc2ec..b251f80 100755 --- a/mkdocs/search_index.json +++ b/mkdocs/search_index.json @@ -487,7 +487,7 @@ }, { "location": "/reference/", - "text": "GraphQL\\GraphQL\n\n\nThis is the primary facade for fulfilling GraphQL operations.\nSee \nrelated documentation\n.\n\n\nClass Methods:\n \n\n\n/**\n * Executes graphql query.\n *\n * More sophisticated GraphQL servers, such as those which persist queries,\n * may wish to separate the validation and execution phases to a static time\n * tooling step, and a server runtime step.\n *\n * Available options:\n *\n * schema:\n * The GraphQL type system to use when validating and executing a query.\n * source:\n * A GraphQL language formatted string representing the requested operation.\n * rootValue:\n * The value provided as the first argument to resolver functions on the top\n * level type (e.g. the query object type).\n * context:\n * The value provided as the third argument to all resolvers.\n * Use this to pass current session, user data, etc\n * variableValues:\n * A mapping of variable name to runtime value to use for all variables\n * defined in the requestString.\n * operationName:\n * The name of the operation to use if requestString contains multiple\n * possible operations. Can be omitted if requestString contains only\n * one operation.\n * fieldResolver:\n * A resolver function to use when one is not provided by the schema.\n * If not provided, the default field resolver is used (which looks for a\n * value on the source value with the field's name).\n * validationRules:\n * A set of rules for query validation step. Default value is all available rules.\n * Empty array would allow to skip query validation (may be convenient for persisted\n * queries which are validated before persisting and assumed valid during execution)\n *\n * @api\n * @param \\GraphQL\\Type\\Schema $schema\n * @param string|DocumentNode $source\n * @param mixed $rootValue\n * @param mixed $context\n * @param array|null $variableValues\n * @param string|null $operationName\n * @param callable $fieldResolver\n * @param array $validationRules\n *\n * @return ExecutionResult\n */\nstatic function executeQuery(\n GraphQL\\Type\\Schema $schema,\n $source,\n $rootValue = null,\n $context = null,\n $variableValues = null,\n $operationName = null,\n callable $fieldResolver = null,\n array $validationRules = null\n)\n\n\n\n\n/**\n * Same as executeQuery(), but requires PromiseAdapter and always returns a Promise.\n * Useful for Async PHP platforms.\n *\n * @api\n * @param PromiseAdapter $promiseAdapter\n * @param \\GraphQL\\Type\\Schema $schema\n * @param string|DocumentNode $source\n * @param mixed $rootValue\n * @param mixed $context\n * @param array|null $variableValues\n * @param string|null $operationName\n * @param callable $fieldResolver\n * @param array $validationRules\n *\n * @return Promise\n */\nstatic function promiseToExecute(\n GraphQL\\Executor\\Promise\\PromiseAdapter $promiseAdapter,\n GraphQL\\Type\\Schema $schema,\n $source,\n $rootValue = null,\n $context = null,\n $variableValues = null,\n $operationName = null,\n callable $fieldResolver = null,\n array $validationRules = null\n)\n\n\n\n\n/**\n * Returns directives defined in GraphQL spec\n *\n * @api\n * @return Directive[]\n */\nstatic function getStandardDirectives()\n\n\n\n\n/**\n * Returns types defined in GraphQL spec\n *\n * @api\n * @return Type[]\n */\nstatic function getStandardTypes()\n\n\n\n\n/**\n * Returns standard validation rules implementing GraphQL spec\n *\n * @api\n * @return AbstractValidationRule[]\n */\nstatic function getStandardValidationRules()\n\n\n\n\nGraphQL\\Type\\Definition\\Type\n\n\nRegistry of standard GraphQL types\nand a base class for all other types.\n\n\nClass Methods:\n \n\n\n/**\n * @api\n * @return IDType\n */\nstatic function id()\n\n\n\n\n/**\n * @api\n * @return StringType\n */\nstatic function string()\n\n\n\n\n/**\n * @api\n * @return BooleanType\n */\nstatic function boolean()\n\n\n\n\n/**\n * @api\n * @return IntType\n */\nstatic function int()\n\n\n\n\n/**\n * @api\n * @return FloatType\n */\nstatic function float()\n\n\n\n\n/**\n * @api\n * @param ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType|ListOfType|NonNull $wrappedType\n * @return ListOfType\n */\nstatic function listOf($wrappedType)\n\n\n\n\n/**\n * @api\n * @param ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType|ListOfType $wrappedType\n * @return NonNull\n */\nstatic function nonNull($wrappedType)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return bool\n */\nstatic function isInputType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return bool\n */\nstatic function isOutputType($type)\n\n\n\n\n/**\n * @api\n * @param $type\n * @return bool\n */\nstatic function isLeafType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return bool\n */\nstatic function isCompositeType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return bool\n */\nstatic function isAbstractType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType|ListOfType\n */\nstatic function getNullableType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType\n */\nstatic function getNamedType($type)\n\n\n\n\nGraphQL\\Type\\Definition\\ResolveInfo\n\n\nStructure containing information useful for field resolution process.\nPassed as 3rd argument to every field resolver. See \ndocs on field resolving (data fetching)\n.\n\n\nClass Props:\n \n\n\n/**\n * The name of the field being resolved\n *\n * @api\n * @var string\n */\npublic $fieldName;\n\n/**\n * AST of all nodes referencing this field in the query.\n *\n * @api\n * @var FieldNode[]\n */\npublic $fieldNodes;\n\n/**\n * Expected return type of the field being resolved\n *\n * @api\n * @var ScalarType|ObjectType|InterfaceType|UnionType|EnumType|ListOfType|NonNull\n */\npublic $returnType;\n\n/**\n * Parent type of the field being resolved\n *\n * @api\n * @var ObjectType\n */\npublic $parentType;\n\n/**\n * Path to this field from the very root value\n *\n * @api\n * @var array\n */\npublic $path;\n\n/**\n * Instance of a schema used for execution\n *\n * @api\n * @var Schema\n */\npublic $schema;\n\n/**\n * AST of all fragments defined in query\n *\n * @api\n * @var FragmentDefinitionNode[]\n */\npublic $fragments;\n\n/**\n * Root value passed to query execution\n *\n * @api\n * @var mixed\n */\npublic $rootValue;\n\n/**\n * AST of operation definition node (query, mutation)\n *\n * @api\n * @var OperationDefinitionNode\n */\npublic $operation;\n\n/**\n * Array of variables passed to query execution\n *\n * @api\n * @var array\n */\npublic $variableValues;\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Helper method that returns names of all fields selected in query for\n * $this->fieldName up to $depth levels\n *\n * Example:\n * query MyQuery{\n * {\n * root {\n * id,\n * nested {\n * nested1\n * nested2 {\n * nested3\n * }\n * }\n * }\n * }\n *\n * Given this ResolveInfo instance is a part of \"root\" field resolution, and $depth === 1,\n * method will return:\n * [\n * 'id' => true,\n * 'nested' => [\n * nested1 => true,\n * nested2 => true\n * ]\n * ]\n *\n * Warning: this method it is a naive implementation which does not take into account\n * conditional typed fragments. So use it with care for fields of interface and union types.\n *\n * @api\n * @param int $depth How many levels to include in output\n * @return array\n */\nfunction getFieldSelection($depth = 0)\n\n\n\n\nGraphQL\\Type\\Definition\\DirectiveLocation\n\n\nList of available directive locations\n\n\nClass Constants:\n \n\n\nconst IFACE = \"INTERFACE\";\nconst SUBSCRIPTION = \"SUBSCRIPTION\";\nconst FRAGMENT_SPREAD = \"FRAGMENT_SPREAD\";\nconst QUERY = \"QUERY\";\nconst MUTATION = \"MUTATION\";\nconst FRAGMENT_DEFINITION = \"FRAGMENT_DEFINITION\";\nconst INPUT_OBJECT = \"INPUT_OBJECT\";\nconst INLINE_FRAGMENT = \"INLINE_FRAGMENT\";\nconst UNION = \"UNION\";\nconst SCALAR = \"SCALAR\";\nconst FIELD_DEFINITION = \"FIELD_DEFINITION\";\nconst ARGUMENT_DEFINITION = \"ARGUMENT_DEFINITION\";\nconst ENUM = \"ENUM\";\nconst OBJECT = \"OBJECT\";\nconst ENUM_VALUE = \"ENUM_VALUE\";\nconst FIELD = \"FIELD\";\nconst SCHEMA = \"SCHEMA\";\nconst INPUT_FIELD_DEFINITION = \"INPUT_FIELD_DEFINITION\";\n\n\n\n\nGraphQL\\Type\\SchemaConfig\n\n\nSchema configuration class.\nCould be passed directly to schema constructor. List of options accepted by \ncreate\n method is\n\ndescribed in docs\n.\n\n\nUsage example:\n\n\n$config = SchemaConfig::create()\n ->setQuery($myQueryType)\n ->setTypeLoader($myTypeLoader);\n\n$schema = new Schema($config);\n\n\n\nClass Methods:\n \n\n\n/**\n * Converts an array of options to instance of SchemaConfig\n * (or just returns empty config when array is not passed).\n *\n * @api\n * @param array $options\n * @return SchemaConfig\n */\nstatic function create(array $options = [])\n\n\n\n\n/**\n * @api\n * @param ObjectType $query\n * @return SchemaConfig\n */\nfunction setQuery(GraphQL\\Type\\Definition\\ObjectType $query)\n\n\n\n\n/**\n * @api\n * @param ObjectType $mutation\n * @return SchemaConfig\n */\nfunction setMutation(GraphQL\\Type\\Definition\\ObjectType $mutation)\n\n\n\n\n/**\n * @api\n * @param ObjectType $subscription\n * @return SchemaConfig\n */\nfunction setSubscription(GraphQL\\Type\\Definition\\ObjectType $subscription)\n\n\n\n\n/**\n * @api\n * @param Type[]|callable $types\n * @return SchemaConfig\n */\nfunction setTypes($types)\n\n\n\n\n/**\n * @api\n * @param Directive[] $directives\n * @return SchemaConfig\n */\nfunction setDirectives(array $directives)\n\n\n\n\n/**\n * @api\n * @param callable $typeLoader\n * @return SchemaConfig\n */\nfunction setTypeLoader(callable $typeLoader)\n\n\n\n\n/**\n * @api\n * @return ObjectType\n */\nfunction getQuery()\n\n\n\n\n/**\n * @api\n * @return ObjectType\n */\nfunction getMutation()\n\n\n\n\n/**\n * @api\n * @return ObjectType\n */\nfunction getSubscription()\n\n\n\n\n/**\n * @api\n * @return Type[]\n */\nfunction getTypes()\n\n\n\n\n/**\n * @api\n * @return Directive[]\n */\nfunction getDirectives()\n\n\n\n\n/**\n * @api\n * @return callable\n */\nfunction getTypeLoader()\n\n\n\n\nGraphQL\\Type\\Schema\n\n\nSchema Definition (see \nrelated docs\n)\n\n\nA Schema is created by supplying the root types of each type of operation:\nquery, mutation (optional) and subscription (optional). A schema definition is\nthen supplied to the validator and executor. Usage Example:\n\n\n$schema = new GraphQL\\Type\\Schema([\n 'query' => $MyAppQueryRootType,\n 'mutation' => $MyAppMutationRootType,\n]);\n\n\n\nOr using Schema Config instance:\n\n\n$config = GraphQL\\Type\\SchemaConfig::create()\n ->setQuery($MyAppQueryRootType)\n ->setMutation($MyAppMutationRootType);\n\n$schema = new GraphQL\\Type\\Schema($config);\n\n\n\nClass Methods:\n \n\n\n/**\n * Schema constructor.\n *\n * @api\n * @param array|SchemaConfig $config\n */\nfunction __construct($config)\n\n\n\n\n/**\n * Returns schema query type\n *\n * @api\n * @return ObjectType\n */\nfunction getQueryType()\n\n\n\n\n/**\n * Returns schema mutation type\n *\n * @api\n * @return ObjectType|null\n */\nfunction getMutationType()\n\n\n\n\n/**\n * Returns schema subscription\n *\n * @api\n * @return ObjectType|null\n */\nfunction getSubscriptionType()\n\n\n\n\n/**\n * @api\n * @return SchemaConfig\n */\nfunction getConfig()\n\n\n\n\n/**\n * Returns array of all types in this schema. Keys of this array represent type names, values are instances\n * of corresponding type definitions\n *\n * This operation requires full schema scan. Do not use in production environment.\n *\n * @api\n * @return Type[]\n */\nfunction getTypeMap()\n\n\n\n\n/**\n * Returns type by it's name\n *\n * @api\n * @param string $name\n * @return Type\n */\nfunction getType($name)\n\n\n\n\n/**\n * Returns all possible concrete types for given abstract type\n * (implementations for interfaces and members of union type for unions)\n *\n * This operation requires full schema scan. Do not use in production environment.\n *\n * @api\n * @param AbstractType $abstractType\n * @return ObjectType[]\n */\nfunction getPossibleTypes(GraphQL\\Type\\Definition\\AbstractType $abstractType)\n\n\n\n\n/**\n * Returns true if object type is concrete type of given abstract type\n * (implementation for interfaces and members of union type for unions)\n *\n * @api\n * @param AbstractType $abstractType\n * @param ObjectType $possibleType\n * @return bool\n */\nfunction isPossibleType(\n GraphQL\\Type\\Definition\\AbstractType $abstractType,\n GraphQL\\Type\\Definition\\ObjectType $possibleType\n)\n\n\n\n\n/**\n * Returns a list of directives supported by this schema\n *\n * @api\n * @return Directive[]\n */\nfunction getDirectives()\n\n\n\n\n/**\n * Returns instance of directive by name\n *\n * @api\n * @param $name\n * @return Directive\n */\nfunction getDirective($name)\n\n\n\n\n/**\n * Validates schema.\n *\n * This operation requires full schema scan. Do not use in production environment.\n *\n * @api\n * @throws InvariantViolation\n */\nfunction assertValid()\n\n\n\n\nGraphQL\\Language\\Parser\n\n\nParses string containing GraphQL query or \ntype definition\n to Abstract Syntax Tree.\n\n\nClass Methods:\n \n\n\n/**\n * Given a GraphQL source, parses it into a `GraphQL\\Language\\AST\\DocumentNode`.\n * Throws `GraphQL\\Error\\SyntaxError` if a syntax error is encountered.\n *\n * Available options:\n *\n * noLocation: boolean,\n * (By default, the parser creates AST nodes that know the location\n * in the source that they correspond to. This configuration flag\n * disables that behavior for performance or testing.)\n *\n * @api\n * @param Source|string $source\n * @param array $options\n * @return DocumentNode\n */\nstatic function parse($source, array $options = [])\n\n\n\n\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws `GraphQL\\Error\\SyntaxError` if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: `GraphQL\\Utils\\AST::valueFromAST()`.\n *\n * @api\n * @param Source|string $source\n * @param array $options\n * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode\n */\nstatic function parseValue($source, array $options = [])\n\n\n\n\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws `GraphQL\\Error\\SyntaxError` if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: `GraphQL\\Utils\\AST::typeFromAST()`.\n *\n * @api\n * @param Source|string $source\n * @param array $options\n * @return ListTypeNode|NameNode|NonNullTypeNode\n */\nstatic function parseType($source, array $options = [])\n\n\n\n\nGraphQL\\Language\\Printer\n\n\nPrints AST to string. Capable of printing GraphQL queries and Type definition language.\nUseful for pretty-printing queries or printing back AST for logging, documentation, etc.\n\n\nUsage example:\n\n\n$query = 'query myQuery {someField}';\n$ast = GraphQL\\Language\\Parser::parse($query);\n$printed = GraphQL\\Language\\Printer::doPrint($ast);\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Prints AST to string. Capable of printing GraphQL queries and Type definition language.\n *\n * @api\n * @param Node $ast\n * @return string\n */\nstatic function doPrint($ast)\n\n\n\n\nGraphQL\\Language\\Visitor\n\n\nUtility for efficient AST traversal and modification.\n\n\nvisit()\n will walk through an AST using a depth first traversal, calling\nthe visitor's enter function at each node in the traversal, and calling the\nleave function after visiting that node and all of it's child nodes.\n\n\nBy returning different values from the enter and leave functions, the\nbehavior of the visitor can be altered, including skipping over a sub-tree of\nthe AST (by returning false), editing the AST by returning a value or null\nto remove the value, or to stop the whole traversal by returning BREAK.\n\n\nWhen using \nvisit()\n to edit an AST, the original AST will not be modified, and\na new version of the AST with the changes applied will be returned from the\nvisit function.\n\n\n$editedAST = Visitor::visit($ast, [\n 'enter' => function ($node, $key, $parent, $path, $ancestors) {\n // return\n // null: no action\n // Visitor::skipNode(): skip visiting this node\n // Visitor::stop(): stop visiting altogether\n // Visitor::removeNode(): delete this node\n // any value: replace this node with the returned value\n },\n 'leave' => function ($node, $key, $parent, $path, $ancestors) {\n // return\n // null: no action\n // Visitor::stop(): stop visiting altogether\n // Visitor::removeNode(): delete this node\n // any value: replace this node with the returned value\n }\n]);\n\n\n\nAlternatively to providing enter() and leave() functions, a visitor can\ninstead provide functions named the same as the \nkinds of AST nodes\n,\nor enter/leave visitors at a named key, leading to four permutations of\nvisitor API:\n\n\n1) Named visitors triggered when entering a node a specific kind.\n\n\nVisitor::visit($ast, [\n 'Kind' => function ($node) {\n // enter the \"Kind\" node\n }\n]);\n\n\n\n2) Named visitors that trigger upon entering and leaving a node of\n a specific kind.\n\n\nVisitor::visit($ast, [\n 'Kind' => [\n 'enter' => function ($node) {\n // enter the \"Kind\" node\n }\n 'leave' => function ($node) {\n // leave the \"Kind\" node\n }\n ]\n]);\n\n\n\n3) Generic visitors that trigger upon entering and leaving any node.\n\n\nVisitor::visit($ast, [\n 'enter' => function ($node) {\n // enter any node\n },\n 'leave' => function ($node) {\n // leave any node\n }\n]);\n\n\n\n4) Parallel visitors for entering and leaving nodes of a specific kind.\n\n\nVisitor::visit($ast, [\n 'enter' => [\n 'Kind' => function($node) {\n // enter the \"Kind\" node\n }\n },\n 'leave' => [\n 'Kind' => function ($node) {\n // leave the \"Kind\" node\n }\n ]\n]);\n\n\n\nClass Methods:\n \n\n\n/**\n * Visit the AST (see class description for details)\n *\n * @api\n * @param Node $root\n * @param array $visitor\n * @param array $keyMap\n * @return Node|mixed\n * @throws \\Exception\n */\nstatic function visit($root, $visitor, $keyMap = null)\n\n\n\n\n/**\n * Returns marker for visitor break\n *\n * @api\n * @return VisitorOperation\n */\nstatic function stop()\n\n\n\n\n/**\n * Returns marker for skipping current node\n *\n * @api\n * @return VisitorOperation\n */\nstatic function skipNode()\n\n\n\n\n/**\n * Returns marker for removing a node\n *\n * @api\n * @return VisitorOperation\n */\nstatic function removeNode()\n\n\n\n\nGraphQL\\Language\\AST\\NodeKind\n\n\nClass Constants:\n \n\n\nconst NAME = \"Name\";\nconst DOCUMENT = \"Document\";\nconst OPERATION_DEFINITION = \"OperationDefinition\";\nconst VARIABLE_DEFINITION = \"VariableDefinition\";\nconst VARIABLE = \"Variable\";\nconst SELECTION_SET = \"SelectionSet\";\nconst FIELD = \"Field\";\nconst ARGUMENT = \"Argument\";\nconst FRAGMENT_SPREAD = \"FragmentSpread\";\nconst INLINE_FRAGMENT = \"InlineFragment\";\nconst FRAGMENT_DEFINITION = \"FragmentDefinition\";\nconst INT = \"IntValue\";\nconst FLOAT = \"FloatValue\";\nconst STRING = \"StringValue\";\nconst BOOLEAN = \"BooleanValue\";\nconst ENUM = \"EnumValue\";\nconst NULL = \"NullValue\";\nconst LST = \"ListValue\";\nconst OBJECT = \"ObjectValue\";\nconst OBJECT_FIELD = \"ObjectField\";\nconst DIRECTIVE = \"Directive\";\nconst NAMED_TYPE = \"NamedType\";\nconst LIST_TYPE = \"ListType\";\nconst NON_NULL_TYPE = \"NonNullType\";\nconst SCHEMA_DEFINITION = \"SchemaDefinition\";\nconst OPERATION_TYPE_DEFINITION = \"OperationTypeDefinition\";\nconst SCALAR_TYPE_DEFINITION = \"ScalarTypeDefinition\";\nconst OBJECT_TYPE_DEFINITION = \"ObjectTypeDefinition\";\nconst FIELD_DEFINITION = \"FieldDefinition\";\nconst INPUT_VALUE_DEFINITION = \"InputValueDefinition\";\nconst INTERFACE_TYPE_DEFINITION = \"InterfaceTypeDefinition\";\nconst UNION_TYPE_DEFINITION = \"UnionTypeDefinition\";\nconst ENUM_TYPE_DEFINITION = \"EnumTypeDefinition\";\nconst ENUM_VALUE_DEFINITION = \"EnumValueDefinition\";\nconst INPUT_OBJECT_TYPE_DEFINITION = \"InputObjectTypeDefinition\";\nconst TYPE_EXTENSION_DEFINITION = \"TypeExtensionDefinition\";\nconst DIRECTIVE_DEFINITION = \"DirectiveDefinition\";\n\n\n\n\nGraphQL\\Executor\\Executor\n\n\nImplements the \"Evaluating requests\" section of the GraphQL specification.\n\n\nClass Methods:\n \n\n\n/**\n * Executes DocumentNode against given $schema.\n *\n * Always returns ExecutionResult and never throws. All errors which occur during operation\n * execution are collected in `$result->errors`.\n *\n * @api\n * @param Schema $schema\n * @param DocumentNode $ast\n * @param $rootValue\n * @param $contextValue\n * @param array|\\ArrayAccess $variableValues\n * @param null $operationName\n * @param callable $fieldResolver\n *\n * @return ExecutionResult|Promise\n */\nstatic function execute(\n GraphQL\\Type\\Schema $schema,\n GraphQL\\Language\\AST\\DocumentNode $ast,\n $rootValue = null,\n $contextValue = null,\n $variableValues = null,\n $operationName = null,\n callable $fieldResolver = null\n)\n\n\n\n\n/**\n * Same as execute(), but requires promise adapter and returns a promise which is always\n * fulfilled with an instance of ExecutionResult and never rejected.\n *\n * Useful for async PHP platforms.\n *\n * @api\n * @param PromiseAdapter $promiseAdapter\n * @param Schema $schema\n * @param DocumentNode $ast\n * @param null $rootValue\n * @param null $contextValue\n * @param null $variableValues\n * @param null $operationName\n * @param callable|null $fieldResolver\n * @return Promise\n */\nstatic function promiseToExecute(\n GraphQL\\Executor\\Promise\\PromiseAdapter $promiseAdapter,\n GraphQL\\Type\\Schema $schema,\n GraphQL\\Language\\AST\\DocumentNode $ast,\n $rootValue = null,\n $contextValue = null,\n $variableValues = null,\n $operationName = null,\n callable $fieldResolver = null\n)\n\n\n\n\nGraphQL\\Executor\\ExecutionResult\n\n\nReturned after \nquery execution\n.\nRepresents both - result of successful execution and of a failed one\n(with errors collected in \nerrors\n prop)\n\n\nCould be converted to \nspec-compliant\n\nserializable array using \ntoArray()\n\n\nClass Props:\n \n\n\n/**\n * Data collected from resolvers during query execution\n *\n * @api\n * @var array\n */\npublic $data;\n\n/**\n * Errors registered during query execution.\n *\n * If an error was caused by exception thrown in resolver, $error->getPrevious() would\n * contain original exception.\n *\n * @api\n * @var \\GraphQL\\Error\\Error[]\n */\npublic $errors;\n\n/**\n * User-defined serializable array of extensions included in serialized result.\n * Conforms to\n *\n * @api\n * @var array\n */\npublic $extensions;\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Define custom error formatting (must conform to http://facebook.github.io/graphql/#sec-Errors)\n *\n * Expected signature is: function (GraphQL\\Error\\Error $error): array\n *\n * Default formatter is \"GraphQL\\Error\\FormattedError::createFromException\"\n *\n * Expected returned value must be an array:\n * array(\n * 'message' => 'errorMessage',\n * // ... other keys\n * );\n *\n * @api\n * @param callable $errorFormatter\n * @return $this\n */\nfunction setErrorFormatter(callable $errorFormatter)\n\n\n\n\n/**\n * Define custom logic for error handling (filtering, logging, etc).\n *\n * Expected handler signature is: function (array $errors, callable $formatter): array\n *\n * Default handler is:\n * function (array $errors, callable $formatter) {\n * return array_map($formatter, $errors);\n * }\n *\n * @api\n * @param callable $handler\n * @return $this\n */\nfunction setErrorsHandler(callable $handler)\n\n\n\n\n/**\n * Converts GraphQL query result to spec-compliant serializable array using provided\n * errors handler and formatter.\n *\n * If debug argument is passed, output of error formatter is enriched which debugging information\n * (\"debugMessage\", \"trace\" keys depending on flags).\n *\n * $debug argument must be either bool (only adds \"debugMessage\" to result) or sum of flags from\n * GraphQL\\Error\\Debug\n *\n * @api\n * @param bool|int $debug\n * @return array\n */\nfunction toArray($debug = false)\n\n\n\n\nGraphQL\\Executor\\Promise\\PromiseAdapter\n\n\nProvides a means for integration of async PHP platforms (\nrelated docs\n)\n\n\nInterface Methods:\n \n\n\n/**\n * Return true if the value is a promise or a deferred of the underlying platform\n *\n * @api\n * @param mixed $value\n * @return bool\n */\nfunction isThenable($value)\n\n\n\n\n/**\n * Converts thenable of the underlying platform into GraphQL\\Executor\\Promise\\Promise instance\n *\n * @api\n * @param object $thenable\n * @return Promise\n */\nfunction convertThenable($thenable)\n\n\n\n\n/**\n * Accepts our Promise wrapper, extracts adopted promise out of it and executes actual `then` logic described\n * in Promises/A+ specs. Then returns new wrapped instance of GraphQL\\Executor\\Promise\\Promise.\n *\n * @api\n * @param Promise $promise\n * @param callable|null $onFulfilled\n * @param callable|null $onRejected\n *\n * @return Promise\n */\nfunction then(\n GraphQL\\Executor\\Promise\\Promise $promise,\n callable $onFulfilled = null,\n callable $onRejected = null\n)\n\n\n\n\n/**\n * Creates a Promise\n *\n * Expected resolver signature:\n * function(callable $resolve, callable $reject)\n *\n * @api\n * @param callable $resolver\n * @return Promise\n */\nfunction create(callable $resolver)\n\n\n\n\n/**\n * Creates a fulfilled Promise for a value if the value is not a promise.\n *\n * @api\n * @param mixed $value\n * @return Promise\n */\nfunction createFulfilled($value = null)\n\n\n\n\n/**\n * Creates a rejected promise for a reason if the reason is not a promise. If\n * the provided reason is a promise, then it is returned as-is.\n *\n * @api\n * @param \\Throwable $reason\n * @return Promise\n */\nfunction createRejected($reason)\n\n\n\n\n/**\n * Given an array of promises (or values), returns a promise that is fulfilled when all the\n * items in the array are fulfilled.\n *\n * @api\n * @param array $promisesOrValues Promises or values.\n * @return Promise\n */\nfunction all(array $promisesOrValues)\n\n\n\n\nGraphQL\\Validator\\DocumentValidator\n\n\nImplements the \"Validation\" section of the spec.\n\n\nValidation runs synchronously, returning an array of encountered errors, or\nan empty array if no errors were encountered and the document is valid.\n\n\nA list of specific validation rules may be provided. If not provided, the\ndefault list of rules defined by the GraphQL specification will be used.\n\n\nEach validation rule is an instance of GraphQL\\Validator\\Rules\\AbstractValidationRule\nwhich returns a visitor (see the \nGraphQL\\Language\\Visitor API\n).\n\n\nVisitor methods are expected to return an instance of \nGraphQL\\Error\\Error\n,\nor array of such instances when invalid.\n\n\nOptionally a custom TypeInfo instance may be provided. If not provided, one\nwill be created from the provided schema.\n\n\nClass Methods:\n \n\n\n/**\n * Primary method for query validation. See class description for details.\n *\n * @api\n * @param Schema $schema\n * @param DocumentNode $ast\n * @param AbstractValidationRule[]|null $rules\n * @param TypeInfo|null $typeInfo\n * @return Error[]\n */\nstatic function validate(\n GraphQL\\Type\\Schema $schema,\n GraphQL\\Language\\AST\\DocumentNode $ast,\n array $rules = null,\n GraphQL\\Utils\\TypeInfo $typeInfo = null\n)\n\n\n\n\n/**\n * Returns all global validation rules.\n *\n * @api\n * @return AbstractValidationRule[]\n */\nstatic function allRules()\n\n\n\n\n/**\n * Returns global validation rule by name. Standard rules are named by class name, so\n * example usage for such rules:\n *\n * $rule = DocumentValidator::getRule(GraphQL\\Validator\\Rules\\QueryComplexity::class);\n *\n * @api\n * @param string $name\n * @return AbstractValidationRule\n */\nstatic function getRule($name)\n\n\n\n\n/**\n * Add rule to list of global validation rules\n *\n * @api\n * @param AbstractValidationRule $rule\n */\nstatic function addRule(GraphQL\\Validator\\Rules\\AbstractValidationRule $rule)\n\n\n\n\nGraphQL\\Error\\Error\n\n\nDescribes an Error found during the parse, validate, or\nexecute phases of performing a GraphQL operation. In addition to a message\nand stack trace, it also includes information about the locations in a\nGraphQL document and/or execution result that correspond to the Error.\n\n\nWhen the error was caused by an exception thrown in resolver, original exception\nis available via \ngetPrevious()\n.\n\n\nAlso read related docs on \nerror handling\n\n\nClass extends standard PHP \n\\Exception\n, so all standard methods of base \n\\Exception\n class\nare available in addition to those listed below.\n\n\nClass Constants:\n \n\n\nconst CATEGORY_GRAPHQL = \"graphql\";\nconst CATEGORY_INTERNAL = \"internal\";\n\n\n\n\nClass Methods:\n \n\n\n/**\n * An array of locations within the source GraphQL document which correspond to this error.\n *\n * Each entry has information about `line` and `column` within source GraphQL document:\n * $location->line;\n * $location->column;\n *\n * Errors during validation often contain multiple locations, for example to\n * point out to field mentioned in multiple fragments. Errors during execution include a\n * single location, the field which produced the error.\n *\n * @api\n * @return SourceLocation[]\n */\nfunction getLocations()\n\n\n\n\n/**\n * Returns an array describing the path from the root value to the field which produced this error.\n * Only included for execution errors.\n *\n * @api\n * @return array|null\n */\nfunction getPath()\n\n\n\n\nGraphQL\\Error\\Warning\n\n\nEncapsulates warnings produced by the library.\n\n\nWarnings can be suppressed (individually or all) if required.\nAlso it is possible to override warning handler (which is \ntrigger_error()\n by default)\n\n\nClass Constants:\n \n\n\nconst WARNING_NAME = 1;\nconst WARNING_ASSIGN = 2;\nconst WARNING_CONFIG = 4;\nconst WARNING_FULL_SCHEMA_SCAN = 8;\nconst WARNING_CONFIG_DEPRECATION = 16;\nconst WARNING_NOT_A_TYPE = 32;\nconst ALL = 63;\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Sets warning handler which can intercept all system warnings.\n * When not set, trigger_error() is used to notify about warnings.\n *\n * @api\n * @param callable|null $warningHandler\n */\nstatic function setWarningHandler(callable $warningHandler = null)\n\n\n\n\n/**\n * Suppress warning by id (has no effect when custom warning handler is set)\n *\n * Usage example:\n * Warning::suppress(Warning::WARNING_NOT_A_TYPE)\n *\n * When passing true - suppresses all warnings.\n *\n * @api\n * @param bool|int $suppress\n */\nstatic function suppress($suppress = false)\n\n\n\n\n/**\n * Re-enable previously suppressed warning by id\n *\n * Usage example:\n * Warning::suppress(Warning::WARNING_NOT_A_TYPE)\n *\n * When passing true - re-enables all warnings.\n *\n * @api\n * @param bool|int $enable\n */\nstatic function enable($enable = false)\n\n\n\n\nGraphQL\\Error\\ClientAware\n\n\nThis interface is used for \ndefault error formatting\n.\n\n\nOnly errors implementing this interface (and returning true from \nisClientSafe()\n)\nwill be formatted with original error message.\n\n\nAll other errors will be formatted with generic \"Internal server error\".\n\n\nInterface Methods:\n \n\n\n/**\n * Returns true when exception message is safe to be displayed to a client.\n *\n * @api\n * @return bool\n */\nfunction isClientSafe()\n\n\n\n\n/**\n * Returns string describing a category of the error.\n *\n * Value \"graphql\" is reserved for errors produced by query parsing or validation, do not use it.\n *\n * @api\n * @return string\n */\nfunction getCategory()\n\n\n\n\nGraphQL\\Error\\Debug\n\n\nCollection of flags for \nerror debugging\n.\n\n\nClass Constants:\n \n\n\nconst INCLUDE_DEBUG_MESSAGE = 1;\nconst INCLUDE_TRACE = 2;\nconst RETHROW_INTERNAL_EXCEPTIONS = 4;\n\n\n\n\nGraphQL\\Error\\FormattedError\n\n\nThis class is used for \ndefault error formatting\n.\nIt converts PHP exceptions to \nspec-compliant errors\n\nand provides tools for error debugging.\n\n\nClass Methods:\n \n\n\n/**\n * Set default error message for internal errors formatted using createFormattedError().\n * This value can be overridden by passing 3rd argument to `createFormattedError()`.\n *\n * @api\n * @param string $msg\n */\nstatic function setInternalErrorMessage($msg)\n\n\n\n\n/**\n * Standard GraphQL error formatter. Converts any exception to array\n * conforming to GraphQL spec.\n *\n * This method only exposes exception message when exception implements ClientAware interface\n * (or when debug flags are passed).\n *\n * For a list of available debug flags see GraphQL\\Error\\Debug constants.\n *\n * @api\n * @param \\Throwable $e\n * @param bool|int $debug\n * @param string $internalErrorMessage\n * @return array\n * @throws \\Throwable\n */\nstatic function createFromException($e, $debug = false, $internalErrorMessage = null)\n\n\n\n\n/**\n * Returns error trace as serializable array\n *\n * @api\n * @param \\Throwable $error\n * @return array\n */\nstatic function toSafeTrace($error)\n\n\n\n\nGraphQL\\Server\\StandardServer\n\n\nGraphQL server compatible with both: \nexpress-graphql\n\nand \nApollo Server\n.\nUsage Example:\n\n\n$server = new StandardServer([\n 'schema' => $mySchema\n]);\n$server->handleRequest();\n\n\n\nOr using \nServerConfig\n instance:\n\n\n$config = GraphQL\\Server\\ServerConfig::create()\n ->setSchema($mySchema)\n ->setContext($myContext);\n\n$server = new GraphQL\\Server\\StandardServer($config);\n$server->handleRequest();\n\n\n\nSee \ndedicated section in docs\n for details.\n\n\nClass Methods:\n \n\n\n/**\n * Converts and exception to error and sends spec-compliant HTTP 500 error.\n * Useful when an exception is thrown somewhere outside of server execution context\n * (e.g. during schema instantiation).\n *\n * @api\n * @param \\Throwable $error\n * @param bool $debug\n * @param bool $exitWhenDone\n */\nstatic function send500Error($error, $debug = false, $exitWhenDone = false)\n\n\n\n\n/**\n * Creates new instance of a standard GraphQL HTTP server\n *\n * @api\n * @param ServerConfig|array $config\n */\nfunction __construct($config)\n\n\n\n\n/**\n * Parses HTTP request, executes and emits response (using standard PHP `header` function and `echo`)\n *\n * By default (when $parsedBody is not set) it uses PHP globals to parse a request.\n * It is possible to implement request parsing elsewhere (e.g. using framework Request instance)\n * and then pass it to the server.\n *\n * See `executeRequest()` if you prefer to emit response yourself\n * (e.g. using Response object of some framework)\n *\n * @api\n * @param OperationParams|OperationParams[] $parsedBody\n * @param bool $exitWhenDone\n */\nfunction handleRequest($parsedBody = null, $exitWhenDone = false)\n\n\n\n\n/**\n * Executes GraphQL operation and returns execution result\n * (or promise when promise adapter is different from SyncPromiseAdapter).\n *\n * By default (when $parsedBody is not set) it uses PHP globals to parse a request.\n * It is possible to implement request parsing elsewhere (e.g. using framework Request instance)\n * and then pass it to the server.\n *\n * PSR-7 compatible method executePsrRequest() does exactly this.\n *\n * @api\n * @param OperationParams|OperationParams[] $parsedBody\n * @return ExecutionResult|ExecutionResult[]|Promise\n * @throws InvariantViolation\n */\nfunction executeRequest($parsedBody = null)\n\n\n\n\n/**\n * Executes PSR-7 request and fulfills PSR-7 response.\n *\n * See `executePsrRequest()` if you prefer to create response yourself\n * (e.g. using specific JsonResponse instance of some framework).\n *\n * @api\n * @param ServerRequestInterface $request\n * @param ResponseInterface $response\n * @param StreamInterface $writableBodyStream\n * @return ResponseInterface|Promise\n */\nfunction processPsrRequest(\n Psr\\Http\\Message\\ServerRequestInterface $request,\n Psr\\Http\\Message\\ResponseInterface $response,\n Psr\\Http\\Message\\StreamInterface $writableBodyStream\n)\n\n\n\n\n/**\n * Executes GraphQL operation and returns execution result\n * (or promise when promise adapter is different from SyncPromiseAdapter)\n *\n * @api\n * @param ServerRequestInterface $request\n * @return ExecutionResult|ExecutionResult[]|Promise\n */\nfunction executePsrRequest(Psr\\Http\\Message\\ServerRequestInterface $request)\n\n\n\n\n/**\n * Returns an instance of Server helper, which contains most of the actual logic for\n * parsing / validating / executing request (which could be re-used by other server implementations)\n *\n * @api\n * @return Helper\n */\nfunction getHelper()\n\n\n\n\nGraphQL\\Server\\ServerConfig\n\n\nServer configuration class.\nCould be passed directly to server constructor. List of options accepted by \ncreate\n method is\n\ndescribed in docs\n.\n\n\nUsage example:\n\n\n$config = GraphQL\\Server\\ServerConfig::create()\n ->setSchema($mySchema)\n ->setContext($myContext);\n\n$server = new GraphQL\\Server\\StandardServer($config);\n\n\n\nClass Methods:\n \n\n\n/**\n * Converts an array of options to instance of ServerConfig\n * (or just returns empty config when array is not passed).\n *\n * @api\n * @param array $config\n * @return ServerConfig\n */\nstatic function create(array $config = [])\n\n\n\n\n/**\n * @api\n * @param Schema $schema\n * @return $this\n */\nfunction setSchema(GraphQL\\Type\\Schema $schema)\n\n\n\n\n/**\n * @api\n * @param mixed|\\Closure $context\n * @return $this\n */\nfunction setContext($context)\n\n\n\n\n/**\n * @api\n * @param mixed|\\Closure $rootValue\n * @return $this\n */\nfunction setRootValue($rootValue)\n\n\n\n\n/**\n * Expects function(Throwable $e) : array\n *\n * @api\n * @param callable $errorFormatter\n * @return $this\n */\nfunction setErrorFormatter(callable $errorFormatter)\n\n\n\n\n/**\n * Expects function(array $errors, callable $formatter) : array\n *\n * @api\n * @param callable $handler\n * @return $this\n */\nfunction setErrorsHandler(callable $handler)\n\n\n\n\n/**\n * Set validation rules for this server.\n *\n * @api\n * @param array|callable\n * @return $this\n */\nfunction setValidationRules($validationRules)\n\n\n\n\n/**\n * @api\n * @param callable $fieldResolver\n * @return $this\n */\nfunction setFieldResolver(callable $fieldResolver)\n\n\n\n\n/**\n * Expects function($queryId, OperationParams $params) : string|DocumentNode\n *\n * This function must return query string or valid DocumentNode.\n *\n * @api\n * @param callable $persistentQueryLoader\n * @return $this\n */\nfunction setPersistentQueryLoader(callable $persistentQueryLoader)\n\n\n\n\n/**\n * Set response debug flags. See GraphQL\\Error\\Debug class for a list of all available flags\n *\n * @api\n * @param bool|int $set\n * @return $this\n */\nfunction setDebug($set = false)\n\n\n\n\n/**\n * Allow batching queries (disabled by default)\n *\n * @api\n * @param bool $enableBatching\n * @return $this\n */\nfunction setQueryBatching($enableBatching)\n\n\n\n\n/**\n * @api\n * @param PromiseAdapter $promiseAdapter\n * @return $this\n */\nfunction setPromiseAdapter(GraphQL\\Executor\\Promise\\PromiseAdapter $promiseAdapter)\n\n\n\n\nGraphQL\\Server\\Helper\n\n\nContains functionality that could be re-used by various server implementations\n\n\nClass Methods:\n \n\n\n/**\n * Parses HTTP request using PHP globals and returns GraphQL OperationParams\n * contained in this request. For batched requests it returns an array of OperationParams.\n *\n * This function does not check validity of these params\n * (validation is performed separately in validateOperationParams() method).\n *\n * If $readRawBodyFn argument is not provided - will attempt to read raw request body\n * from `php://input` stream.\n *\n * Internally it normalizes input to $method, $bodyParams and $queryParams and\n * calls `parseRequestParams()` to produce actual return value.\n *\n * For PSR-7 request parsing use `parsePsrRequest()` instead.\n *\n * @api\n * @param callable|null $readRawBodyFn\n * @return OperationParams|OperationParams[]\n * @throws RequestError\n */\nfunction parseHttpRequest(callable $readRawBodyFn = null)\n\n\n\n\n/**\n * Parses normalized request params and returns instance of OperationParams\n * or array of OperationParams in case of batch operation.\n *\n * Returned value is a suitable input for `executeOperation` or `executeBatch` (if array)\n *\n * @api\n * @param string $method\n * @param array $bodyParams\n * @param array $queryParams\n * @return OperationParams|OperationParams[]\n * @throws RequestError\n */\nfunction parseRequestParams($method, array $bodyParams, array $queryParams)\n\n\n\n\n/**\n * Checks validity of OperationParams extracted from HTTP request and returns an array of errors\n * if params are invalid (or empty array when params are valid)\n *\n * @api\n * @param OperationParams $params\n * @return Error[]\n */\nfunction validateOperationParams(GraphQL\\Server\\OperationParams $params)\n\n\n\n\n/**\n * Executes GraphQL operation with given server configuration and returns execution result\n * (or promise when promise adapter is different from SyncPromiseAdapter)\n *\n * @api\n * @param ServerConfig $config\n * @param OperationParams $op\n *\n * @return ExecutionResult|Promise\n */\nfunction executeOperation(GraphQL\\Server\\ServerConfig $config, GraphQL\\Server\\OperationParams $op)\n\n\n\n\n/**\n * Executes batched GraphQL operations with shared promise queue\n * (thus, effectively batching deferreds|promises of all queries at once)\n *\n * @api\n * @param ServerConfig $config\n * @param OperationParams[] $operations\n * @return ExecutionResult[]|Promise\n */\nfunction executeBatch(GraphQL\\Server\\ServerConfig $config, array $operations)\n\n\n\n\n/**\n * Send response using standard PHP `header()` and `echo`.\n *\n * @api\n * @param Promise|ExecutionResult|ExecutionResult[] $result\n * @param bool $exitWhenDone\n */\nfunction sendResponse($result, $exitWhenDone = false)\n\n\n\n\n/**\n * Converts PSR-7 request to OperationParams[]\n *\n * @api\n * @param ServerRequestInterface $request\n * @return array|Helper\n * @throws RequestError\n */\nfunction parsePsrRequest(Psr\\Http\\Message\\ServerRequestInterface $request)\n\n\n\n\n/**\n * Converts query execution result to PSR-7 response\n *\n * @api\n * @param Promise|ExecutionResult|ExecutionResult[] $result\n * @param ResponseInterface $response\n * @param StreamInterface $writableBodyStream\n * @return Promise|ResponseInterface\n */\nfunction toPsrResponse(\n $result,\n Psr\\Http\\Message\\ResponseInterface $response,\n Psr\\Http\\Message\\StreamInterface $writableBodyStream\n)\n\n\n\n\nGraphQL\\Server\\OperationParams\n\n\nStructure representing parsed HTTP parameters for GraphQL operation\n\n\nClass Props:\n \n\n\n/**\n * Id of the query (when using persistent queries).\n *\n * Valid aliases (case-insensitive):\n * - id\n * - queryId\n * - documentId\n *\n * @api\n * @var string\n */\npublic $queryId;\n\n/**\n * @api\n * @var string\n */\npublic $query;\n\n/**\n * @api\n * @var string\n */\npublic $operation;\n\n/**\n * @api\n * @var array\n */\npublic $variables;\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Creates an instance from given array\n *\n * @api\n * @param array $params\n * @param bool $readonly\n * @return OperationParams\n */\nstatic function create(array $params, $readonly = false)\n\n\n\n\n/**\n * @api\n * @param string $key\n * @return mixed\n */\nfunction getOriginalInput($key)\n\n\n\n\n/**\n * Indicates that operation is executed in read-only context\n * (e.g. via HTTP GET request)\n *\n * @api\n * @return bool\n */\nfunction isReadOnly()\n\n\n\n\nGraphQL\\Utils\\BuildSchema\n\n\nBuild instance of \nGraphQL\\Type\\Schema\n out of type language definition (string or parsed AST)\nSee \nsection in docs\n for details.\n\n\nClass Methods:\n \n\n\n/**\n * This takes the ast of a schema document produced by the parse function in\n * GraphQL\\Language\\Parser.\n *\n * If no schema definition is provided, then it will look for types named Query\n * and Mutation.\n *\n * Given that AST it constructs a GraphQL\\Type\\Schema. The resulting schema\n * has no resolve methods, so execution will use default resolvers.\n *\n * @api\n * @param DocumentNode $ast\n * @param callable $typeConfigDecorator\n * @return Schema\n * @throws Error\n */\nstatic function buildAST(GraphQL\\Language\\AST\\DocumentNode $ast, callable $typeConfigDecorator = null)\n\n\n\n\n/**\n * A helper function to build a GraphQLSchema directly from a source\n * document.\n *\n * @api\n * @param DocumentNode|Source|string $source\n * @param callable $typeConfigDecorator\n * @return Schema\n */\nstatic function build($source, callable $typeConfigDecorator = null)\n\n\n\n\nGraphQL\\Utils\\AST\n\n\nVarious utilities dealing with AST\n\n\nClass Methods:\n \n\n\n/**\n * Convert representation of AST as an associative array to instance of GraphQL\\Language\\AST\\Node.\n *\n * For example:\n *\n * ```php\n * Node::fromArray([\n * 'kind' => 'ListValue',\n * 'values' => [\n * ['kind' => 'StringValue', 'value' => 'my str'],\n * ['kind' => 'StringValue', 'value' => 'my other str']\n * ],\n * 'loc' => ['start' => 21, 'end' => 25]\n * ]);\n * ```\n *\n * Will produce instance of `ListValueNode` where `values` prop is a lazily-evaluated `NodeList`\n * returning instances of `StringValueNode` on access.\n *\n * This is a reverse operation for AST::toArray($node)\n *\n * @api\n * @param array $node\n * @return Node\n */\nstatic function fromArray(array $node)\n\n\n\n\n/**\n * Convert AST node to serializable array\n *\n * @api\n * @param Node $node\n * @return array\n */\nstatic function toArray(GraphQL\\Language\\AST\\Node $node)\n\n\n\n\n/**\n * Produces a GraphQL Value AST given a PHP value.\n *\n * Optionally, a GraphQL type may be provided, which will be used to\n * disambiguate between value primitives.\n *\n * | PHP Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Assoc Array | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Int | Int |\n * | Float | Int / Float |\n * | Mixed | Enum Value |\n * | null | NullValue |\n *\n * @api\n * @param $value\n * @param InputType $type\n * @return ObjectValueNode|ListValueNode|BooleanValueNode|IntValueNode|FloatValueNode|EnumValueNode|StringValueNode|NullValueNode\n */\nstatic function astFromValue($value, GraphQL\\Type\\Definition\\InputType $type)\n\n\n\n\n/**\n * Produces a PHP value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `null` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | PHP Value |\n * | -------------------- | ------------- |\n * | Input Object | Assoc Array |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Int / Float |\n * | Enum Value | Mixed |\n * | Null Value | null |\n *\n * @api\n * @param $valueNode\n * @param InputType $type\n * @param null $variables\n * @return array|null|\\stdClass\n * @throws \\Exception\n */\nstatic function valueFromAST($valueNode, GraphQL\\Type\\Definition\\InputType $type, $variables = null)\n\n\n\n\n/**\n * Returns type definition for given AST Type node\n *\n * @api\n * @param Schema $schema\n * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode\n * @return Type\n * @throws InvariantViolation\n */\nstatic function typeFromAST(GraphQL\\Type\\Schema $schema, $inputTypeNode)\n\n\n\n\n/**\n * Returns operation type (\"query\", \"mutation\" or \"subscription\") given a document and operation name\n *\n * @api\n * @param DocumentNode $document\n * @param string $operationName\n * @return bool\n */\nstatic function getOperation(GraphQL\\Language\\AST\\DocumentNode $document, $operationName = null)\n\n\n\n\nGraphQL\\Utils\\SchemaPrinter\n\n\nGiven an instance of Schema, prints it in GraphQL type language.\n\n\nClass Methods:\n \n\n\n/**\n * @api\n * @param Schema $schema\n * @return string\n */\nstatic function doPrint(GraphQL\\Type\\Schema $schema)\n\n\n\n\n/**\n * @api\n * @param Schema $schema\n * @return string\n */\nstatic function printIntrosepctionSchema(GraphQL\\Type\\Schema $schema)", + "text": "GraphQL\\GraphQL\n\n\nThis is the primary facade for fulfilling GraphQL operations.\nSee \nrelated documentation\n.\n\n\nClass Methods:\n \n\n\n/**\n * Executes graphql query.\n *\n * More sophisticated GraphQL servers, such as those which persist queries,\n * may wish to separate the validation and execution phases to a static time\n * tooling step, and a server runtime step.\n *\n * Available options:\n *\n * schema:\n * The GraphQL type system to use when validating and executing a query.\n * source:\n * A GraphQL language formatted string representing the requested operation.\n * rootValue:\n * The value provided as the first argument to resolver functions on the top\n * level type (e.g. the query object type).\n * context:\n * The value provided as the third argument to all resolvers.\n * Use this to pass current session, user data, etc\n * variableValues:\n * A mapping of variable name to runtime value to use for all variables\n * defined in the requestString.\n * operationName:\n * The name of the operation to use if requestString contains multiple\n * possible operations. Can be omitted if requestString contains only\n * one operation.\n * fieldResolver:\n * A resolver function to use when one is not provided by the schema.\n * If not provided, the default field resolver is used (which looks for a\n * value on the source value with the field's name).\n * validationRules:\n * A set of rules for query validation step. Default value is all available rules.\n * Empty array would allow to skip query validation (may be convenient for persisted\n * queries which are validated before persisting and assumed valid during execution)\n *\n * @api\n * @param \\GraphQL\\Type\\Schema $schema\n * @param string|DocumentNode $source\n * @param mixed $rootValue\n * @param mixed $context\n * @param array|null $variableValues\n * @param string|null $operationName\n * @param callable $fieldResolver\n * @param array $validationRules\n *\n * @return ExecutionResult\n */\nstatic function executeQuery(\n GraphQL\\Type\\Schema $schema,\n $source,\n $rootValue = null,\n $context = null,\n $variableValues = null,\n $operationName = null,\n callable $fieldResolver = null,\n array $validationRules = null\n)\n\n\n\n\n/**\n * Same as executeQuery(), but requires PromiseAdapter and always returns a Promise.\n * Useful for Async PHP platforms.\n *\n * @api\n * @param PromiseAdapter $promiseAdapter\n * @param \\GraphQL\\Type\\Schema $schema\n * @param string|DocumentNode $source\n * @param mixed $rootValue\n * @param mixed $context\n * @param array|null $variableValues\n * @param string|null $operationName\n * @param callable $fieldResolver\n * @param array $validationRules\n *\n * @return Promise\n */\nstatic function promiseToExecute(\n GraphQL\\Executor\\Promise\\PromiseAdapter $promiseAdapter,\n GraphQL\\Type\\Schema $schema,\n $source,\n $rootValue = null,\n $context = null,\n $variableValues = null,\n $operationName = null,\n callable $fieldResolver = null,\n array $validationRules = null\n)\n\n\n\n\n/**\n * Returns directives defined in GraphQL spec\n *\n * @api\n * @return Directive[]\n */\nstatic function getStandardDirectives()\n\n\n\n\n/**\n * Returns types defined in GraphQL spec\n *\n * @api\n * @return Type[]\n */\nstatic function getStandardTypes()\n\n\n\n\n/**\n * Returns standard validation rules implementing GraphQL spec\n *\n * @api\n * @return AbstractValidationRule[]\n */\nstatic function getStandardValidationRules()\n\n\n\n\nGraphQL\\Type\\Definition\\Type\n\n\nRegistry of standard GraphQL types\nand a base class for all other types.\n\n\nClass Methods:\n \n\n\n/**\n * @api\n * @return IDType\n */\nstatic function id()\n\n\n\n\n/**\n * @api\n * @return StringType\n */\nstatic function string()\n\n\n\n\n/**\n * @api\n * @return BooleanType\n */\nstatic function boolean()\n\n\n\n\n/**\n * @api\n * @return IntType\n */\nstatic function int()\n\n\n\n\n/**\n * @api\n * @return FloatType\n */\nstatic function float()\n\n\n\n\n/**\n * @api\n * @param ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType|ListOfType|NonNull $wrappedType\n * @return ListOfType\n */\nstatic function listOf($wrappedType)\n\n\n\n\n/**\n * @api\n * @param ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType|ListOfType $wrappedType\n * @return NonNull\n */\nstatic function nonNull($wrappedType)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return bool\n */\nstatic function isInputType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return bool\n */\nstatic function isOutputType($type)\n\n\n\n\n/**\n * @api\n * @param $type\n * @return bool\n */\nstatic function isLeafType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return bool\n */\nstatic function isCompositeType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return bool\n */\nstatic function isAbstractType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType|ListOfType\n */\nstatic function getNullableType($type)\n\n\n\n\n/**\n * @api\n * @param Type $type\n * @return ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType\n */\nstatic function getNamedType($type)\n\n\n\n\nGraphQL\\Type\\Definition\\ResolveInfo\n\n\nStructure containing information useful for field resolution process.\nPassed as 3rd argument to every field resolver. See \ndocs on field resolving (data fetching)\n.\n\n\nClass Props:\n \n\n\n/**\n * The name of the field being resolved\n *\n * @api\n * @var string\n */\npublic $fieldName;\n\n/**\n * AST of all nodes referencing this field in the query.\n *\n * @api\n * @var FieldNode[]\n */\npublic $fieldNodes;\n\n/**\n * Expected return type of the field being resolved\n *\n * @api\n * @var ScalarType|ObjectType|InterfaceType|UnionType|EnumType|ListOfType|NonNull\n */\npublic $returnType;\n\n/**\n * Parent type of the field being resolved\n *\n * @api\n * @var ObjectType\n */\npublic $parentType;\n\n/**\n * Path to this field from the very root value\n *\n * @api\n * @var array\n */\npublic $path;\n\n/**\n * Instance of a schema used for execution\n *\n * @api\n * @var Schema\n */\npublic $schema;\n\n/**\n * AST of all fragments defined in query\n *\n * @api\n * @var FragmentDefinitionNode[]\n */\npublic $fragments;\n\n/**\n * Root value passed to query execution\n *\n * @api\n * @var mixed\n */\npublic $rootValue;\n\n/**\n * AST of operation definition node (query, mutation)\n *\n * @api\n * @var OperationDefinitionNode\n */\npublic $operation;\n\n/**\n * Array of variables passed to query execution\n *\n * @api\n * @var array\n */\npublic $variableValues;\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Helper method that returns names of all fields selected in query for\n * $this->fieldName up to $depth levels\n *\n * Example:\n * query MyQuery{\n * {\n * root {\n * id,\n * nested {\n * nested1\n * nested2 {\n * nested3\n * }\n * }\n * }\n * }\n *\n * Given this ResolveInfo instance is a part of \"root\" field resolution, and $depth === 1,\n * method will return:\n * [\n * 'id' => true,\n * 'nested' => [\n * nested1 => true,\n * nested2 => true\n * ]\n * ]\n *\n * Warning: this method it is a naive implementation which does not take into account\n * conditional typed fragments. So use it with care for fields of interface and union types.\n *\n * @api\n * @param int $depth How many levels to include in output\n * @return array\n */\nfunction getFieldSelection($depth = 0)\n\n\n\n\nGraphQL\\Type\\Definition\\DirectiveLocation\n\n\nList of available directive locations\n\n\nClass Constants:\n \n\n\nconst IFACE = \"INTERFACE\";\nconst SUBSCRIPTION = \"SUBSCRIPTION\";\nconst FRAGMENT_SPREAD = \"FRAGMENT_SPREAD\";\nconst QUERY = \"QUERY\";\nconst MUTATION = \"MUTATION\";\nconst FRAGMENT_DEFINITION = \"FRAGMENT_DEFINITION\";\nconst INPUT_OBJECT = \"INPUT_OBJECT\";\nconst INLINE_FRAGMENT = \"INLINE_FRAGMENT\";\nconst UNION = \"UNION\";\nconst SCALAR = \"SCALAR\";\nconst FIELD_DEFINITION = \"FIELD_DEFINITION\";\nconst ARGUMENT_DEFINITION = \"ARGUMENT_DEFINITION\";\nconst ENUM = \"ENUM\";\nconst OBJECT = \"OBJECT\";\nconst ENUM_VALUE = \"ENUM_VALUE\";\nconst FIELD = \"FIELD\";\nconst SCHEMA = \"SCHEMA\";\nconst INPUT_FIELD_DEFINITION = \"INPUT_FIELD_DEFINITION\";\n\n\n\n\nGraphQL\\Type\\SchemaConfig\n\n\nSchema configuration class.\nCould be passed directly to schema constructor. List of options accepted by \ncreate\n method is\n\ndescribed in docs\n.\n\n\nUsage example:\n\n\n$config = SchemaConfig::create()\n ->setQuery($myQueryType)\n ->setTypeLoader($myTypeLoader);\n\n$schema = new Schema($config);\n\n\n\nClass Methods:\n \n\n\n/**\n * Converts an array of options to instance of SchemaConfig\n * (or just returns empty config when array is not passed).\n *\n * @api\n * @param array $options\n * @return SchemaConfig\n */\nstatic function create(array $options = [])\n\n\n\n\n/**\n * @api\n * @param ObjectType $query\n * @return SchemaConfig\n */\nfunction setQuery(GraphQL\\Type\\Definition\\ObjectType $query)\n\n\n\n\n/**\n * @api\n * @param ObjectType $mutation\n * @return SchemaConfig\n */\nfunction setMutation(GraphQL\\Type\\Definition\\ObjectType $mutation)\n\n\n\n\n/**\n * @api\n * @param ObjectType $subscription\n * @return SchemaConfig\n */\nfunction setSubscription(GraphQL\\Type\\Definition\\ObjectType $subscription)\n\n\n\n\n/**\n * @api\n * @param Type[]|callable $types\n * @return SchemaConfig\n */\nfunction setTypes($types)\n\n\n\n\n/**\n * @api\n * @param Directive[] $directives\n * @return SchemaConfig\n */\nfunction setDirectives(array $directives)\n\n\n\n\n/**\n * @api\n * @param callable $typeLoader\n * @return SchemaConfig\n */\nfunction setTypeLoader(callable $typeLoader)\n\n\n\n\n/**\n * @api\n * @return ObjectType\n */\nfunction getQuery()\n\n\n\n\n/**\n * @api\n * @return ObjectType\n */\nfunction getMutation()\n\n\n\n\n/**\n * @api\n * @return ObjectType\n */\nfunction getSubscription()\n\n\n\n\n/**\n * @api\n * @return Type[]\n */\nfunction getTypes()\n\n\n\n\n/**\n * @api\n * @return Directive[]\n */\nfunction getDirectives()\n\n\n\n\n/**\n * @api\n * @return callable\n */\nfunction getTypeLoader()\n\n\n\n\nGraphQL\\Type\\Schema\n\n\nSchema Definition (see \nrelated docs\n)\n\n\nA Schema is created by supplying the root types of each type of operation:\nquery, mutation (optional) and subscription (optional). A schema definition is\nthen supplied to the validator and executor. Usage Example:\n\n\n$schema = new GraphQL\\Type\\Schema([\n 'query' => $MyAppQueryRootType,\n 'mutation' => $MyAppMutationRootType,\n]);\n\n\n\nOr using Schema Config instance:\n\n\n$config = GraphQL\\Type\\SchemaConfig::create()\n ->setQuery($MyAppQueryRootType)\n ->setMutation($MyAppMutationRootType);\n\n$schema = new GraphQL\\Type\\Schema($config);\n\n\n\nClass Methods:\n \n\n\n/**\n * Schema constructor.\n *\n * @api\n * @param array|SchemaConfig $config\n */\nfunction __construct($config)\n\n\n\n\n/**\n * Returns schema query type\n *\n * @api\n * @return ObjectType\n */\nfunction getQueryType()\n\n\n\n\n/**\n * Returns schema mutation type\n *\n * @api\n * @return ObjectType|null\n */\nfunction getMutationType()\n\n\n\n\n/**\n * Returns schema subscription\n *\n * @api\n * @return ObjectType|null\n */\nfunction getSubscriptionType()\n\n\n\n\n/**\n * @api\n * @return SchemaConfig\n */\nfunction getConfig()\n\n\n\n\n/**\n * Returns array of all types in this schema. Keys of this array represent type names, values are instances\n * of corresponding type definitions\n *\n * This operation requires full schema scan. Do not use in production environment.\n *\n * @api\n * @return Type[]\n */\nfunction getTypeMap()\n\n\n\n\n/**\n * Returns type by it's name\n *\n * @api\n * @param string $name\n * @return Type\n */\nfunction getType($name)\n\n\n\n\n/**\n * Returns all possible concrete types for given abstract type\n * (implementations for interfaces and members of union type for unions)\n *\n * This operation requires full schema scan. Do not use in production environment.\n *\n * @api\n * @param AbstractType $abstractType\n * @return ObjectType[]\n */\nfunction getPossibleTypes(GraphQL\\Type\\Definition\\AbstractType $abstractType)\n\n\n\n\n/**\n * Returns true if object type is concrete type of given abstract type\n * (implementation for interfaces and members of union type for unions)\n *\n * @api\n * @param AbstractType $abstractType\n * @param ObjectType $possibleType\n * @return bool\n */\nfunction isPossibleType(\n GraphQL\\Type\\Definition\\AbstractType $abstractType,\n GraphQL\\Type\\Definition\\ObjectType $possibleType\n)\n\n\n\n\n/**\n * Returns a list of directives supported by this schema\n *\n * @api\n * @return Directive[]\n */\nfunction getDirectives()\n\n\n\n\n/**\n * Returns instance of directive by name\n *\n * @api\n * @param $name\n * @return Directive\n */\nfunction getDirective($name)\n\n\n\n\n/**\n * Validates schema.\n *\n * This operation requires full schema scan. Do not use in production environment.\n *\n * @api\n * @throws InvariantViolation\n */\nfunction assertValid()\n\n\n\n\nGraphQL\\Language\\Parser\n\n\nParses string containing GraphQL query or \ntype definition\n to Abstract Syntax Tree.\n\n\nClass Methods:\n \n\n\n/**\n * Given a GraphQL source, parses it into a `GraphQL\\Language\\AST\\DocumentNode`.\n * Throws `GraphQL\\Error\\SyntaxError` if a syntax error is encountered.\n *\n * Available options:\n *\n * noLocation: boolean,\n * (By default, the parser creates AST nodes that know the location\n * in the source that they correspond to. This configuration flag\n * disables that behavior for performance or testing.)\n *\n * @api\n * @param Source|string $source\n * @param array $options\n * @return DocumentNode\n */\nstatic function parse($source, array $options = [])\n\n\n\n\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws `GraphQL\\Error\\SyntaxError` if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: `GraphQL\\Utils\\AST::valueFromAST()`.\n *\n * @api\n * @param Source|string $source\n * @param array $options\n * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode\n */\nstatic function parseValue($source, array $options = [])\n\n\n\n\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws `GraphQL\\Error\\SyntaxError` if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: `GraphQL\\Utils\\AST::typeFromAST()`.\n *\n * @api\n * @param Source|string $source\n * @param array $options\n * @return ListTypeNode|NameNode|NonNullTypeNode\n */\nstatic function parseType($source, array $options = [])\n\n\n\n\nGraphQL\\Language\\Printer\n\n\nPrints AST to string. Capable of printing GraphQL queries and Type definition language.\nUseful for pretty-printing queries or printing back AST for logging, documentation, etc.\n\n\nUsage example:\n\n\n$query = 'query myQuery {someField}';\n$ast = GraphQL\\Language\\Parser::parse($query);\n$printed = GraphQL\\Language\\Printer::doPrint($ast);\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Prints AST to string. Capable of printing GraphQL queries and Type definition language.\n *\n * @api\n * @param Node $ast\n * @return string\n */\nstatic function doPrint($ast)\n\n\n\n\nGraphQL\\Language\\Visitor\n\n\nUtility for efficient AST traversal and modification.\n\n\nvisit()\n will walk through an AST using a depth first traversal, calling\nthe visitor's enter function at each node in the traversal, and calling the\nleave function after visiting that node and all of it's child nodes.\n\n\nBy returning different values from the enter and leave functions, the\nbehavior of the visitor can be altered, including skipping over a sub-tree of\nthe AST (by returning false), editing the AST by returning a value or null\nto remove the value, or to stop the whole traversal by returning BREAK.\n\n\nWhen using \nvisit()\n to edit an AST, the original AST will not be modified, and\na new version of the AST with the changes applied will be returned from the\nvisit function.\n\n\n$editedAST = Visitor::visit($ast, [\n 'enter' => function ($node, $key, $parent, $path, $ancestors) {\n // return\n // null: no action\n // Visitor::skipNode(): skip visiting this node\n // Visitor::stop(): stop visiting altogether\n // Visitor::removeNode(): delete this node\n // any value: replace this node with the returned value\n },\n 'leave' => function ($node, $key, $parent, $path, $ancestors) {\n // return\n // null: no action\n // Visitor::stop(): stop visiting altogether\n // Visitor::removeNode(): delete this node\n // any value: replace this node with the returned value\n }\n]);\n\n\n\nAlternatively to providing enter() and leave() functions, a visitor can\ninstead provide functions named the same as the \nkinds of AST nodes\n,\nor enter/leave visitors at a named key, leading to four permutations of\nvisitor API:\n\n\n1) Named visitors triggered when entering a node a specific kind.\n\n\nVisitor::visit($ast, [\n 'Kind' => function ($node) {\n // enter the \"Kind\" node\n }\n]);\n\n\n\n2) Named visitors that trigger upon entering and leaving a node of\n a specific kind.\n\n\nVisitor::visit($ast, [\n 'Kind' => [\n 'enter' => function ($node) {\n // enter the \"Kind\" node\n }\n 'leave' => function ($node) {\n // leave the \"Kind\" node\n }\n ]\n]);\n\n\n\n3) Generic visitors that trigger upon entering and leaving any node.\n\n\nVisitor::visit($ast, [\n 'enter' => function ($node) {\n // enter any node\n },\n 'leave' => function ($node) {\n // leave any node\n }\n]);\n\n\n\n4) Parallel visitors for entering and leaving nodes of a specific kind.\n\n\nVisitor::visit($ast, [\n 'enter' => [\n 'Kind' => function($node) {\n // enter the \"Kind\" node\n }\n },\n 'leave' => [\n 'Kind' => function ($node) {\n // leave the \"Kind\" node\n }\n ]\n]);\n\n\n\nClass Methods:\n \n\n\n/**\n * Visit the AST (see class description for details)\n *\n * @api\n * @param Node $root\n * @param array $visitor\n * @param array $keyMap\n * @return Node|mixed\n * @throws \\Exception\n */\nstatic function visit($root, $visitor, $keyMap = null)\n\n\n\n\n/**\n * Returns marker for visitor break\n *\n * @api\n * @return VisitorOperation\n */\nstatic function stop()\n\n\n\n\n/**\n * Returns marker for skipping current node\n *\n * @api\n * @return VisitorOperation\n */\nstatic function skipNode()\n\n\n\n\n/**\n * Returns marker for removing a node\n *\n * @api\n * @return VisitorOperation\n */\nstatic function removeNode()\n\n\n\n\nGraphQL\\Language\\AST\\NodeKind\n\n\nClass Constants:\n \n\n\nconst NAME = \"Name\";\nconst DOCUMENT = \"Document\";\nconst OPERATION_DEFINITION = \"OperationDefinition\";\nconst VARIABLE_DEFINITION = \"VariableDefinition\";\nconst VARIABLE = \"Variable\";\nconst SELECTION_SET = \"SelectionSet\";\nconst FIELD = \"Field\";\nconst ARGUMENT = \"Argument\";\nconst FRAGMENT_SPREAD = \"FragmentSpread\";\nconst INLINE_FRAGMENT = \"InlineFragment\";\nconst FRAGMENT_DEFINITION = \"FragmentDefinition\";\nconst INT = \"IntValue\";\nconst FLOAT = \"FloatValue\";\nconst STRING = \"StringValue\";\nconst BOOLEAN = \"BooleanValue\";\nconst ENUM = \"EnumValue\";\nconst NULL = \"NullValue\";\nconst LST = \"ListValue\";\nconst OBJECT = \"ObjectValue\";\nconst OBJECT_FIELD = \"ObjectField\";\nconst DIRECTIVE = \"Directive\";\nconst NAMED_TYPE = \"NamedType\";\nconst LIST_TYPE = \"ListType\";\nconst NON_NULL_TYPE = \"NonNullType\";\nconst SCHEMA_DEFINITION = \"SchemaDefinition\";\nconst OPERATION_TYPE_DEFINITION = \"OperationTypeDefinition\";\nconst SCALAR_TYPE_DEFINITION = \"ScalarTypeDefinition\";\nconst OBJECT_TYPE_DEFINITION = \"ObjectTypeDefinition\";\nconst FIELD_DEFINITION = \"FieldDefinition\";\nconst INPUT_VALUE_DEFINITION = \"InputValueDefinition\";\nconst INTERFACE_TYPE_DEFINITION = \"InterfaceTypeDefinition\";\nconst UNION_TYPE_DEFINITION = \"UnionTypeDefinition\";\nconst ENUM_TYPE_DEFINITION = \"EnumTypeDefinition\";\nconst ENUM_VALUE_DEFINITION = \"EnumValueDefinition\";\nconst INPUT_OBJECT_TYPE_DEFINITION = \"InputObjectTypeDefinition\";\nconst TYPE_EXTENSION_DEFINITION = \"TypeExtensionDefinition\";\nconst DIRECTIVE_DEFINITION = \"DirectiveDefinition\";\n\n\n\n\nGraphQL\\Executor\\Executor\n\n\nImplements the \"Evaluating requests\" section of the GraphQL specification.\n\n\nClass Methods:\n \n\n\n/**\n * Executes DocumentNode against given $schema.\n *\n * Always returns ExecutionResult and never throws. All errors which occur during operation\n * execution are collected in `$result->errors`.\n *\n * @api\n * @param Schema $schema\n * @param DocumentNode $ast\n * @param $rootValue\n * @param $contextValue\n * @param array|\\ArrayAccess $variableValues\n * @param null $operationName\n * @param callable $fieldResolver\n *\n * @return ExecutionResult|Promise\n */\nstatic function execute(\n GraphQL\\Type\\Schema $schema,\n GraphQL\\Language\\AST\\DocumentNode $ast,\n $rootValue = null,\n $contextValue = null,\n $variableValues = null,\n $operationName = null,\n callable $fieldResolver = null\n)\n\n\n\n\n/**\n * Same as execute(), but requires promise adapter and returns a promise which is always\n * fulfilled with an instance of ExecutionResult and never rejected.\n *\n * Useful for async PHP platforms.\n *\n * @api\n * @param PromiseAdapter $promiseAdapter\n * @param Schema $schema\n * @param DocumentNode $ast\n * @param null $rootValue\n * @param null $contextValue\n * @param null $variableValues\n * @param null $operationName\n * @param callable|null $fieldResolver\n * @return Promise\n */\nstatic function promiseToExecute(\n GraphQL\\Executor\\Promise\\PromiseAdapter $promiseAdapter,\n GraphQL\\Type\\Schema $schema,\n GraphQL\\Language\\AST\\DocumentNode $ast,\n $rootValue = null,\n $contextValue = null,\n $variableValues = null,\n $operationName = null,\n callable $fieldResolver = null\n)\n\n\n\n\nGraphQL\\Executor\\ExecutionResult\n\n\nReturned after \nquery execution\n.\nRepresents both - result of successful execution and of a failed one\n(with errors collected in \nerrors\n prop)\n\n\nCould be converted to \nspec-compliant\n\nserializable array using \ntoArray()\n\n\nClass Props:\n \n\n\n/**\n * Data collected from resolvers during query execution\n *\n * @api\n * @var array\n */\npublic $data;\n\n/**\n * Errors registered during query execution.\n *\n * If an error was caused by exception thrown in resolver, $error->getPrevious() would\n * contain original exception.\n *\n * @api\n * @var \\GraphQL\\Error\\Error[]\n */\npublic $errors;\n\n/**\n * User-defined serializable array of extensions included in serialized result.\n * Conforms to\n *\n * @api\n * @var array\n */\npublic $extensions;\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Define custom error formatting (must conform to http://facebook.github.io/graphql/#sec-Errors)\n *\n * Expected signature is: function (GraphQL\\Error\\Error $error): array\n *\n * Default formatter is \"GraphQL\\Error\\FormattedError::createFromException\"\n *\n * Expected returned value must be an array:\n * array(\n * 'message' => 'errorMessage',\n * // ... other keys\n * );\n *\n * @api\n * @param callable $errorFormatter\n * @return $this\n */\nfunction setErrorFormatter(callable $errorFormatter)\n\n\n\n\n/**\n * Define custom logic for error handling (filtering, logging, etc).\n *\n * Expected handler signature is: function (array $errors, callable $formatter): array\n *\n * Default handler is:\n * function (array $errors, callable $formatter) {\n * return array_map($formatter, $errors);\n * }\n *\n * @api\n * @param callable $handler\n * @return $this\n */\nfunction setErrorsHandler(callable $handler)\n\n\n\n\n/**\n * Converts GraphQL query result to spec-compliant serializable array using provided\n * errors handler and formatter.\n *\n * If debug argument is passed, output of error formatter is enriched which debugging information\n * (\"debugMessage\", \"trace\" keys depending on flags).\n *\n * $debug argument must be either bool (only adds \"debugMessage\" to result) or sum of flags from\n * GraphQL\\Error\\Debug\n *\n * @api\n * @param bool|int $debug\n * @return array\n */\nfunction toArray($debug = false)\n\n\n\n\nGraphQL\\Executor\\Promise\\PromiseAdapter\n\n\nProvides a means for integration of async PHP platforms (\nrelated docs\n)\n\n\nInterface Methods:\n \n\n\n/**\n * Return true if the value is a promise or a deferred of the underlying platform\n *\n * @api\n * @param mixed $value\n * @return bool\n */\nfunction isThenable($value)\n\n\n\n\n/**\n * Converts thenable of the underlying platform into GraphQL\\Executor\\Promise\\Promise instance\n *\n * @api\n * @param object $thenable\n * @return Promise\n */\nfunction convertThenable($thenable)\n\n\n\n\n/**\n * Accepts our Promise wrapper, extracts adopted promise out of it and executes actual `then` logic described\n * in Promises/A+ specs. Then returns new wrapped instance of GraphQL\\Executor\\Promise\\Promise.\n *\n * @api\n * @param Promise $promise\n * @param callable|null $onFulfilled\n * @param callable|null $onRejected\n *\n * @return Promise\n */\nfunction then(\n GraphQL\\Executor\\Promise\\Promise $promise,\n callable $onFulfilled = null,\n callable $onRejected = null\n)\n\n\n\n\n/**\n * Creates a Promise\n *\n * Expected resolver signature:\n * function(callable $resolve, callable $reject)\n *\n * @api\n * @param callable $resolver\n * @return Promise\n */\nfunction create(callable $resolver)\n\n\n\n\n/**\n * Creates a fulfilled Promise for a value if the value is not a promise.\n *\n * @api\n * @param mixed $value\n * @return Promise\n */\nfunction createFulfilled($value = null)\n\n\n\n\n/**\n * Creates a rejected promise for a reason if the reason is not a promise. If\n * the provided reason is a promise, then it is returned as-is.\n *\n * @api\n * @param \\Throwable $reason\n * @return Promise\n */\nfunction createRejected($reason)\n\n\n\n\n/**\n * Given an array of promises (or values), returns a promise that is fulfilled when all the\n * items in the array are fulfilled.\n *\n * @api\n * @param array $promisesOrValues Promises or values.\n * @return Promise\n */\nfunction all(array $promisesOrValues)\n\n\n\n\nGraphQL\\Validator\\DocumentValidator\n\n\nImplements the \"Validation\" section of the spec.\n\n\nValidation runs synchronously, returning an array of encountered errors, or\nan empty array if no errors were encountered and the document is valid.\n\n\nA list of specific validation rules may be provided. If not provided, the\ndefault list of rules defined by the GraphQL specification will be used.\n\n\nEach validation rule is an instance of GraphQL\\Validator\\Rules\\AbstractValidationRule\nwhich returns a visitor (see the \nGraphQL\\Language\\Visitor API\n).\n\n\nVisitor methods are expected to return an instance of \nGraphQL\\Error\\Error\n,\nor array of such instances when invalid.\n\n\nOptionally a custom TypeInfo instance may be provided. If not provided, one\nwill be created from the provided schema.\n\n\nClass Methods:\n \n\n\n/**\n * Primary method for query validation. See class description for details.\n *\n * @api\n * @param Schema $schema\n * @param DocumentNode $ast\n * @param AbstractValidationRule[]|null $rules\n * @param TypeInfo|null $typeInfo\n * @return Error[]\n */\nstatic function validate(\n GraphQL\\Type\\Schema $schema,\n GraphQL\\Language\\AST\\DocumentNode $ast,\n array $rules = null,\n GraphQL\\Utils\\TypeInfo $typeInfo = null\n)\n\n\n\n\n/**\n * Returns all global validation rules.\n *\n * @api\n * @return AbstractValidationRule[]\n */\nstatic function allRules()\n\n\n\n\n/**\n * Returns global validation rule by name. Standard rules are named by class name, so\n * example usage for such rules:\n *\n * $rule = DocumentValidator::getRule(GraphQL\\Validator\\Rules\\QueryComplexity::class);\n *\n * @api\n * @param string $name\n * @return AbstractValidationRule\n */\nstatic function getRule($name)\n\n\n\n\n/**\n * Add rule to list of global validation rules\n *\n * @api\n * @param AbstractValidationRule $rule\n */\nstatic function addRule(GraphQL\\Validator\\Rules\\AbstractValidationRule $rule)\n\n\n\n\nGraphQL\\Error\\Error\n\n\nDescribes an Error found during the parse, validate, or\nexecute phases of performing a GraphQL operation. In addition to a message\nand stack trace, it also includes information about the locations in a\nGraphQL document and/or execution result that correspond to the Error.\n\n\nWhen the error was caused by an exception thrown in resolver, original exception\nis available via \ngetPrevious()\n.\n\n\nAlso read related docs on \nerror handling\n\n\nClass extends standard PHP \n\\Exception\n, so all standard methods of base \n\\Exception\n class\nare available in addition to those listed below.\n\n\nClass Constants:\n \n\n\nconst CATEGORY_GRAPHQL = \"graphql\";\nconst CATEGORY_INTERNAL = \"internal\";\n\n\n\n\nClass Methods:\n \n\n\n/**\n * An array of locations within the source GraphQL document which correspond to this error.\n *\n * Each entry has information about `line` and `column` within source GraphQL document:\n * $location->line;\n * $location->column;\n *\n * Errors during validation often contain multiple locations, for example to\n * point out to field mentioned in multiple fragments. Errors during execution include a\n * single location, the field which produced the error.\n *\n * @api\n * @return SourceLocation[]\n */\nfunction getLocations()\n\n\n\n\n/**\n * Returns an array describing the path from the root value to the field which produced this error.\n * Only included for execution errors.\n *\n * @api\n * @return array|null\n */\nfunction getPath()\n\n\n\n\nGraphQL\\Error\\Warning\n\n\nEncapsulates warnings produced by the library.\n\n\nWarnings can be suppressed (individually or all) if required.\nAlso it is possible to override warning handler (which is \ntrigger_error()\n by default)\n\n\nClass Constants:\n \n\n\nconst WARNING_NAME = 1;\nconst WARNING_ASSIGN = 2;\nconst WARNING_CONFIG = 4;\nconst WARNING_FULL_SCHEMA_SCAN = 8;\nconst WARNING_CONFIG_DEPRECATION = 16;\nconst WARNING_NOT_A_TYPE = 32;\nconst ALL = 63;\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Sets warning handler which can intercept all system warnings.\n * When not set, trigger_error() is used to notify about warnings.\n *\n * @api\n * @param callable|null $warningHandler\n */\nstatic function setWarningHandler(callable $warningHandler = null)\n\n\n\n\n/**\n * Suppress warning by id (has no effect when custom warning handler is set)\n *\n * Usage example:\n * Warning::suppress(Warning::WARNING_NOT_A_TYPE)\n *\n * When passing true - suppresses all warnings.\n *\n * @api\n * @param bool|int $suppress\n */\nstatic function suppress($suppress = false)\n\n\n\n\n/**\n * Re-enable previously suppressed warning by id\n *\n * Usage example:\n * Warning::suppress(Warning::WARNING_NOT_A_TYPE)\n *\n * When passing true - re-enables all warnings.\n *\n * @api\n * @param bool|int $enable\n */\nstatic function enable($enable = false)\n\n\n\n\nGraphQL\\Error\\ClientAware\n\n\nThis interface is used for \ndefault error formatting\n.\n\n\nOnly errors implementing this interface (and returning true from \nisClientSafe()\n)\nwill be formatted with original error message.\n\n\nAll other errors will be formatted with generic \"Internal server error\".\n\n\nInterface Methods:\n \n\n\n/**\n * Returns true when exception message is safe to be displayed to a client.\n *\n * @api\n * @return bool\n */\nfunction isClientSafe()\n\n\n\n\n/**\n * Returns string describing a category of the error.\n *\n * Value \"graphql\" is reserved for errors produced by query parsing or validation, do not use it.\n *\n * @api\n * @return string\n */\nfunction getCategory()\n\n\n\n\nGraphQL\\Error\\Debug\n\n\nCollection of flags for \nerror debugging\n.\n\n\nClass Constants:\n \n\n\nconst INCLUDE_DEBUG_MESSAGE = 1;\nconst INCLUDE_TRACE = 2;\nconst RETHROW_INTERNAL_EXCEPTIONS = 4;\n\n\n\n\nGraphQL\\Error\\FormattedError\n\n\nThis class is used for \ndefault error formatting\n.\nIt converts PHP exceptions to \nspec-compliant errors\n\nand provides tools for error debugging.\n\n\nClass Methods:\n \n\n\n/**\n * Set default error message for internal errors formatted using createFormattedError().\n * This value can be overridden by passing 3rd argument to `createFormattedError()`.\n *\n * @api\n * @param string $msg\n */\nstatic function setInternalErrorMessage($msg)\n\n\n\n\n/**\n * Standard GraphQL error formatter. Converts any exception to array\n * conforming to GraphQL spec.\n *\n * This method only exposes exception message when exception implements ClientAware interface\n * (or when debug flags are passed).\n *\n * For a list of available debug flags see GraphQL\\Error\\Debug constants.\n *\n * @api\n * @param \\Throwable $e\n * @param bool|int $debug\n * @param string $internalErrorMessage\n * @return array\n * @throws \\Throwable\n */\nstatic function createFromException($e, $debug = false, $internalErrorMessage = null)\n\n\n\n\n/**\n * Returns error trace as serializable array\n *\n * @api\n * @param \\Throwable $error\n * @return array\n */\nstatic function toSafeTrace($error)\n\n\n\n\nGraphQL\\Server\\StandardServer\n\n\nGraphQL server compatible with both: \nexpress-graphql\n\nand \nApollo Server\n.\nUsage Example:\n\n\n$server = new StandardServer([\n 'schema' => $mySchema\n]);\n$server->handleRequest();\n\n\n\nOr using \nServerConfig\n instance:\n\n\n$config = GraphQL\\Server\\ServerConfig::create()\n ->setSchema($mySchema)\n ->setContext($myContext);\n\n$server = new GraphQL\\Server\\StandardServer($config);\n$server->handleRequest();\n\n\n\nSee \ndedicated section in docs\n for details.\n\n\nClass Methods:\n \n\n\n/**\n * Converts and exception to error and sends spec-compliant HTTP 500 error.\n * Useful when an exception is thrown somewhere outside of server execution context\n * (e.g. during schema instantiation).\n *\n * @api\n * @param \\Throwable $error\n * @param bool $debug\n * @param bool $exitWhenDone\n */\nstatic function send500Error($error, $debug = false, $exitWhenDone = false)\n\n\n\n\n/**\n * Creates new instance of a standard GraphQL HTTP server\n *\n * @api\n * @param ServerConfig|array $config\n */\nfunction __construct($config)\n\n\n\n\n/**\n * Parses HTTP request, executes and emits response (using standard PHP `header` function and `echo`)\n *\n * By default (when $parsedBody is not set) it uses PHP globals to parse a request.\n * It is possible to implement request parsing elsewhere (e.g. using framework Request instance)\n * and then pass it to the server.\n *\n * See `executeRequest()` if you prefer to emit response yourself\n * (e.g. using Response object of some framework)\n *\n * @api\n * @param OperationParams|OperationParams[] $parsedBody\n * @param bool $exitWhenDone\n */\nfunction handleRequest($parsedBody = null, $exitWhenDone = false)\n\n\n\n\n/**\n * Executes GraphQL operation and returns execution result\n * (or promise when promise adapter is different from SyncPromiseAdapter).\n *\n * By default (when $parsedBody is not set) it uses PHP globals to parse a request.\n * It is possible to implement request parsing elsewhere (e.g. using framework Request instance)\n * and then pass it to the server.\n *\n * PSR-7 compatible method executePsrRequest() does exactly this.\n *\n * @api\n * @param OperationParams|OperationParams[] $parsedBody\n * @return ExecutionResult|ExecutionResult[]|Promise\n * @throws InvariantViolation\n */\nfunction executeRequest($parsedBody = null)\n\n\n\n\n/**\n * Executes PSR-7 request and fulfills PSR-7 response.\n *\n * See `executePsrRequest()` if you prefer to create response yourself\n * (e.g. using specific JsonResponse instance of some framework).\n *\n * @api\n * @param ServerRequestInterface $request\n * @param ResponseInterface $response\n * @param StreamInterface $writableBodyStream\n * @return ResponseInterface|Promise\n */\nfunction processPsrRequest(\n Psr\\Http\\Message\\ServerRequestInterface $request,\n Psr\\Http\\Message\\ResponseInterface $response,\n Psr\\Http\\Message\\StreamInterface $writableBodyStream\n)\n\n\n\n\n/**\n * Executes GraphQL operation and returns execution result\n * (or promise when promise adapter is different from SyncPromiseAdapter)\n *\n * @api\n * @param ServerRequestInterface $request\n * @return ExecutionResult|ExecutionResult[]|Promise\n */\nfunction executePsrRequest(Psr\\Http\\Message\\ServerRequestInterface $request)\n\n\n\n\n/**\n * Returns an instance of Server helper, which contains most of the actual logic for\n * parsing / validating / executing request (which could be re-used by other server implementations)\n *\n * @api\n * @return Helper\n */\nfunction getHelper()\n\n\n\n\nGraphQL\\Server\\ServerConfig\n\n\nServer configuration class.\nCould be passed directly to server constructor. List of options accepted by \ncreate\n method is\n\ndescribed in docs\n.\n\n\nUsage example:\n\n\n$config = GraphQL\\Server\\ServerConfig::create()\n ->setSchema($mySchema)\n ->setContext($myContext);\n\n$server = new GraphQL\\Server\\StandardServer($config);\n\n\n\nClass Methods:\n \n\n\n/**\n * Converts an array of options to instance of ServerConfig\n * (or just returns empty config when array is not passed).\n *\n * @api\n * @param array $config\n * @return ServerConfig\n */\nstatic function create(array $config = [])\n\n\n\n\n/**\n * @api\n * @param Schema $schema\n * @return $this\n */\nfunction setSchema(GraphQL\\Type\\Schema $schema)\n\n\n\n\n/**\n * @api\n * @param mixed|\\Closure $context\n * @return $this\n */\nfunction setContext($context)\n\n\n\n\n/**\n * @api\n * @param mixed|\\Closure $rootValue\n * @return $this\n */\nfunction setRootValue($rootValue)\n\n\n\n\n/**\n * Expects function(Throwable $e) : array\n *\n * @api\n * @param callable $errorFormatter\n * @return $this\n */\nfunction setErrorFormatter(callable $errorFormatter)\n\n\n\n\n/**\n * Expects function(array $errors, callable $formatter) : array\n *\n * @api\n * @param callable $handler\n * @return $this\n */\nfunction setErrorsHandler(callable $handler)\n\n\n\n\n/**\n * Set validation rules for this server.\n *\n * @api\n * @param array|callable\n * @return $this\n */\nfunction setValidationRules($validationRules)\n\n\n\n\n/**\n * @api\n * @param callable $fieldResolver\n * @return $this\n */\nfunction setFieldResolver(callable $fieldResolver)\n\n\n\n\n/**\n * Expects function($queryId, OperationParams $params) : string|DocumentNode\n *\n * This function must return query string or valid DocumentNode.\n *\n * @api\n * @param callable $persistentQueryLoader\n * @return $this\n */\nfunction setPersistentQueryLoader(callable $persistentQueryLoader)\n\n\n\n\n/**\n * Set response debug flags. See GraphQL\\Error\\Debug class for a list of all available flags\n *\n * @api\n * @param bool|int $set\n * @return $this\n */\nfunction setDebug($set = false)\n\n\n\n\n/**\n * Allow batching queries (disabled by default)\n *\n * @api\n * @param bool $enableBatching\n * @return $this\n */\nfunction setQueryBatching($enableBatching)\n\n\n\n\n/**\n * @api\n * @param PromiseAdapter $promiseAdapter\n * @return $this\n */\nfunction setPromiseAdapter(GraphQL\\Executor\\Promise\\PromiseAdapter $promiseAdapter)\n\n\n\n\nGraphQL\\Server\\Helper\n\n\nContains functionality that could be re-used by various server implementations\n\n\nClass Methods:\n \n\n\n/**\n * Parses HTTP request using PHP globals and returns GraphQL OperationParams\n * contained in this request. For batched requests it returns an array of OperationParams.\n *\n * This function does not check validity of these params\n * (validation is performed separately in validateOperationParams() method).\n *\n * If $readRawBodyFn argument is not provided - will attempt to read raw request body\n * from `php://input` stream.\n *\n * Internally it normalizes input to $method, $bodyParams and $queryParams and\n * calls `parseRequestParams()` to produce actual return value.\n *\n * For PSR-7 request parsing use `parsePsrRequest()` instead.\n *\n * @api\n * @param callable|null $readRawBodyFn\n * @return OperationParams|OperationParams[]\n * @throws RequestError\n */\nfunction parseHttpRequest(callable $readRawBodyFn = null)\n\n\n\n\n/**\n * Parses normalized request params and returns instance of OperationParams\n * or array of OperationParams in case of batch operation.\n *\n * Returned value is a suitable input for `executeOperation` or `executeBatch` (if array)\n *\n * @api\n * @param string $method\n * @param array $bodyParams\n * @param array $queryParams\n * @return OperationParams|OperationParams[]\n * @throws RequestError\n */\nfunction parseRequestParams($method, array $bodyParams, array $queryParams)\n\n\n\n\n/**\n * Checks validity of OperationParams extracted from HTTP request and returns an array of errors\n * if params are invalid (or empty array when params are valid)\n *\n * @api\n * @param OperationParams $params\n * @return Error[]\n */\nfunction validateOperationParams(GraphQL\\Server\\OperationParams $params)\n\n\n\n\n/**\n * Executes GraphQL operation with given server configuration and returns execution result\n * (or promise when promise adapter is different from SyncPromiseAdapter)\n *\n * @api\n * @param ServerConfig $config\n * @param OperationParams $op\n *\n * @return ExecutionResult|Promise\n */\nfunction executeOperation(GraphQL\\Server\\ServerConfig $config, GraphQL\\Server\\OperationParams $op)\n\n\n\n\n/**\n * Executes batched GraphQL operations with shared promise queue\n * (thus, effectively batching deferreds|promises of all queries at once)\n *\n * @api\n * @param ServerConfig $config\n * @param OperationParams[] $operations\n * @return ExecutionResult[]|Promise\n */\nfunction executeBatch(GraphQL\\Server\\ServerConfig $config, array $operations)\n\n\n\n\n/**\n * Send response using standard PHP `header()` and `echo`.\n *\n * @api\n * @param Promise|ExecutionResult|ExecutionResult[] $result\n * @param bool $exitWhenDone\n */\nfunction sendResponse($result, $exitWhenDone = false)\n\n\n\n\n/**\n * Converts PSR-7 request to OperationParams[]\n *\n * @api\n * @param ServerRequestInterface $request\n * @return array|Helper\n * @throws RequestError\n */\nfunction parsePsrRequest(Psr\\Http\\Message\\ServerRequestInterface $request)\n\n\n\n\n/**\n * Converts query execution result to PSR-7 response\n *\n * @api\n * @param Promise|ExecutionResult|ExecutionResult[] $result\n * @param ResponseInterface $response\n * @param StreamInterface $writableBodyStream\n * @return Promise|ResponseInterface\n */\nfunction toPsrResponse(\n $result,\n Psr\\Http\\Message\\ResponseInterface $response,\n Psr\\Http\\Message\\StreamInterface $writableBodyStream\n)\n\n\n\n\nGraphQL\\Server\\OperationParams\n\n\nStructure representing parsed HTTP parameters for GraphQL operation\n\n\nClass Props:\n \n\n\n/**\n * Id of the query (when using persistent queries).\n *\n * Valid aliases (case-insensitive):\n * - id\n * - queryId\n * - documentId\n *\n * @api\n * @var string\n */\npublic $queryId;\n\n/**\n * @api\n * @var string\n */\npublic $query;\n\n/**\n * @api\n * @var string\n */\npublic $operation;\n\n/**\n * @api\n * @var array\n */\npublic $variables;\n\n\n\n\nClass Methods:\n \n\n\n/**\n * Creates an instance from given array\n *\n * @api\n * @param array $params\n * @param bool $readonly\n * @return OperationParams\n */\nstatic function create(array $params, $readonly = false)\n\n\n\n\n/**\n * @api\n * @param string $key\n * @return mixed\n */\nfunction getOriginalInput($key)\n\n\n\n\n/**\n * Indicates that operation is executed in read-only context\n * (e.g. via HTTP GET request)\n *\n * @api\n * @return bool\n */\nfunction isReadOnly()\n\n\n\n\nGraphQL\\Utils\\BuildSchema\n\n\nBuild instance of \nGraphQL\\Type\\Schema\n out of type language definition (string or parsed AST)\nSee \nsection in docs\n for details.\n\n\nClass Methods:\n \n\n\n/**\n * This takes the ast of a schema document produced by the parse function in\n * GraphQL\\Language\\Parser.\n *\n * If no schema definition is provided, then it will look for types named Query\n * and Mutation.\n *\n * Given that AST it constructs a GraphQL\\Type\\Schema. The resulting schema\n * has no resolve methods, so execution will use default resolvers.\n *\n * @api\n * @param DocumentNode $ast\n * @param callable $typeConfigDecorator\n * @return Schema\n * @throws Error\n */\nstatic function buildAST(GraphQL\\Language\\AST\\DocumentNode $ast, callable $typeConfigDecorator = null)\n\n\n\n\n/**\n * A helper function to build a GraphQLSchema directly from a source\n * document.\n *\n * @api\n * @param DocumentNode|Source|string $source\n * @param callable $typeConfigDecorator\n * @return Schema\n */\nstatic function build($source, callable $typeConfigDecorator = null)\n\n\n\n\nGraphQL\\Utils\\AST\n\n\nVarious utilities dealing with AST\n\n\nClass Methods:\n \n\n\n/**\n * Convert representation of AST as an associative array to instance of GraphQL\\Language\\AST\\Node.\n *\n * For example:\n *\n * ```php\n * AST::fromArray([\n * 'kind' => 'ListValue',\n * 'values' => [\n * ['kind' => 'StringValue', 'value' => 'my str'],\n * ['kind' => 'StringValue', 'value' => 'my other str']\n * ],\n * 'loc' => ['start' => 21, 'end' => 25]\n * ]);\n * ```\n *\n * Will produce instance of `ListValueNode` where `values` prop is a lazily-evaluated `NodeList`\n * returning instances of `StringValueNode` on access.\n *\n * This is a reverse operation for AST::toArray($node)\n *\n * @api\n * @param array $node\n * @return Node\n */\nstatic function fromArray(array $node)\n\n\n\n\n/**\n * Convert AST node to serializable array\n *\n * @api\n * @param Node $node\n * @return array\n */\nstatic function toArray(GraphQL\\Language\\AST\\Node $node)\n\n\n\n\n/**\n * Produces a GraphQL Value AST given a PHP value.\n *\n * Optionally, a GraphQL type may be provided, which will be used to\n * disambiguate between value primitives.\n *\n * | PHP Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Assoc Array | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Int | Int |\n * | Float | Int / Float |\n * | Mixed | Enum Value |\n * | null | NullValue |\n *\n * @api\n * @param $value\n * @param InputType $type\n * @return ObjectValueNode|ListValueNode|BooleanValueNode|IntValueNode|FloatValueNode|EnumValueNode|StringValueNode|NullValueNode\n */\nstatic function astFromValue($value, GraphQL\\Type\\Definition\\InputType $type)\n\n\n\n\n/**\n * Produces a PHP value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `null` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | PHP Value |\n * | -------------------- | ------------- |\n * | Input Object | Assoc Array |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Int / Float |\n * | Enum Value | Mixed |\n * | Null Value | null |\n *\n * @api\n * @param $valueNode\n * @param InputType $type\n * @param null $variables\n * @return array|null|\\stdClass\n * @throws \\Exception\n */\nstatic function valueFromAST($valueNode, GraphQL\\Type\\Definition\\InputType $type, $variables = null)\n\n\n\n\n/**\n * Returns type definition for given AST Type node\n *\n * @api\n * @param Schema $schema\n * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode\n * @return Type\n * @throws InvariantViolation\n */\nstatic function typeFromAST(GraphQL\\Type\\Schema $schema, $inputTypeNode)\n\n\n\n\n/**\n * Returns operation type (\"query\", \"mutation\" or \"subscription\") given a document and operation name\n *\n * @api\n * @param DocumentNode $document\n * @param string $operationName\n * @return bool\n */\nstatic function getOperation(GraphQL\\Language\\AST\\DocumentNode $document, $operationName = null)\n\n\n\n\nGraphQL\\Utils\\SchemaPrinter\n\n\nGiven an instance of Schema, prints it in GraphQL type language.\n\n\nClass Methods:\n \n\n\n/**\n * @api\n * @param Schema $schema\n * @return string\n */\nstatic function doPrint(GraphQL\\Type\\Schema $schema)\n\n\n\n\n/**\n * @api\n * @param Schema $schema\n * @return string\n */\nstatic function printIntrosepctionSchema(GraphQL\\Type\\Schema $schema)", "title": "Class Reference" }, { @@ -612,7 +612,7 @@ }, { "location": "/reference/#graphqlutilsast", - "text": "Various utilities dealing with AST Class Methods: /**\n * Convert representation of AST as an associative array to instance of GraphQL\\Language\\AST\\Node.\n *\n * For example:\n *\n * ```php\n * Node::fromArray([\n * 'kind' => 'ListValue',\n * 'values' => [\n * ['kind' => 'StringValue', 'value' => 'my str'],\n * ['kind' => 'StringValue', 'value' => 'my other str']\n * ],\n * 'loc' => ['start' => 21, 'end' => 25]\n * ]);\n * ```\n *\n * Will produce instance of `ListValueNode` where `values` prop is a lazily-evaluated `NodeList`\n * returning instances of `StringValueNode` on access.\n *\n * This is a reverse operation for AST::toArray($node)\n *\n * @api\n * @param array $node\n * @return Node\n */\nstatic function fromArray(array $node) /**\n * Convert AST node to serializable array\n *\n * @api\n * @param Node $node\n * @return array\n */\nstatic function toArray(GraphQL\\Language\\AST\\Node $node) /**\n * Produces a GraphQL Value AST given a PHP value.\n *\n * Optionally, a GraphQL type may be provided, which will be used to\n * disambiguate between value primitives.\n *\n * | PHP Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Assoc Array | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Int | Int |\n * | Float | Int / Float |\n * | Mixed | Enum Value |\n * | null | NullValue |\n *\n * @api\n * @param $value\n * @param InputType $type\n * @return ObjectValueNode|ListValueNode|BooleanValueNode|IntValueNode|FloatValueNode|EnumValueNode|StringValueNode|NullValueNode\n */\nstatic function astFromValue($value, GraphQL\\Type\\Definition\\InputType $type) /**\n * Produces a PHP value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `null` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | PHP Value |\n * | -------------------- | ------------- |\n * | Input Object | Assoc Array |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Int / Float |\n * | Enum Value | Mixed |\n * | Null Value | null |\n *\n * @api\n * @param $valueNode\n * @param InputType $type\n * @param null $variables\n * @return array|null|\\stdClass\n * @throws \\Exception\n */\nstatic function valueFromAST($valueNode, GraphQL\\Type\\Definition\\InputType $type, $variables = null) /**\n * Returns type definition for given AST Type node\n *\n * @api\n * @param Schema $schema\n * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode\n * @return Type\n * @throws InvariantViolation\n */\nstatic function typeFromAST(GraphQL\\Type\\Schema $schema, $inputTypeNode) /**\n * Returns operation type (\"query\", \"mutation\" or \"subscription\") given a document and operation name\n *\n * @api\n * @param DocumentNode $document\n * @param string $operationName\n * @return bool\n */\nstatic function getOperation(GraphQL\\Language\\AST\\DocumentNode $document, $operationName = null)", + "text": "Various utilities dealing with AST Class Methods: /**\n * Convert representation of AST as an associative array to instance of GraphQL\\Language\\AST\\Node.\n *\n * For example:\n *\n * ```php\n * AST::fromArray([\n * 'kind' => 'ListValue',\n * 'values' => [\n * ['kind' => 'StringValue', 'value' => 'my str'],\n * ['kind' => 'StringValue', 'value' => 'my other str']\n * ],\n * 'loc' => ['start' => 21, 'end' => 25]\n * ]);\n * ```\n *\n * Will produce instance of `ListValueNode` where `values` prop is a lazily-evaluated `NodeList`\n * returning instances of `StringValueNode` on access.\n *\n * This is a reverse operation for AST::toArray($node)\n *\n * @api\n * @param array $node\n * @return Node\n */\nstatic function fromArray(array $node) /**\n * Convert AST node to serializable array\n *\n * @api\n * @param Node $node\n * @return array\n */\nstatic function toArray(GraphQL\\Language\\AST\\Node $node) /**\n * Produces a GraphQL Value AST given a PHP value.\n *\n * Optionally, a GraphQL type may be provided, which will be used to\n * disambiguate between value primitives.\n *\n * | PHP Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Assoc Array | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Int | Int |\n * | Float | Int / Float |\n * | Mixed | Enum Value |\n * | null | NullValue |\n *\n * @api\n * @param $value\n * @param InputType $type\n * @return ObjectValueNode|ListValueNode|BooleanValueNode|IntValueNode|FloatValueNode|EnumValueNode|StringValueNode|NullValueNode\n */\nstatic function astFromValue($value, GraphQL\\Type\\Definition\\InputType $type) /**\n * Produces a PHP value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `null` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | PHP Value |\n * | -------------------- | ------------- |\n * | Input Object | Assoc Array |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Int / Float |\n * | Enum Value | Mixed |\n * | Null Value | null |\n *\n * @api\n * @param $valueNode\n * @param InputType $type\n * @param null $variables\n * @return array|null|\\stdClass\n * @throws \\Exception\n */\nstatic function valueFromAST($valueNode, GraphQL\\Type\\Definition\\InputType $type, $variables = null) /**\n * Returns type definition for given AST Type node\n *\n * @api\n * @param Schema $schema\n * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode\n * @return Type\n * @throws InvariantViolation\n */\nstatic function typeFromAST(GraphQL\\Type\\Schema $schema, $inputTypeNode) /**\n * Returns operation type (\"query\", \"mutation\" or \"subscription\") given a document and operation name\n *\n * @api\n * @param DocumentNode $document\n * @param string $operationName\n * @return bool\n */\nstatic function getOperation(GraphQL\\Language\\AST\\DocumentNode $document, $operationName = null)", "title": "GraphQL\\Utils\\AST" }, { diff --git a/reference/index.html b/reference/index.html index 7c4c53e..63f069e 100755 --- a/reference/index.html +++ b/reference/index.html @@ -2064,7 +2064,7 @@ static function build($source, callable $typeConfigDecorator = null) * For example: * * ```php - * Node::fromArray([ + * AST::fromArray([ * 'kind' => 'ListValue', * 'values' => [ * ['kind' => 'StringValue', 'value' => 'my str'], diff --git a/sitemap.xml b/sitemap.xml index f349543..781dff5 100755 --- a/sitemap.xml +++ b/sitemap.xml @@ -4,7 +4,7 @@