mirror of
https://github.com/retailcrm/graphql-php.git
synced 2025-02-06 15:59:24 +03:00
commit
9327e75a16
@ -1,23 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GraphQL;
|
namespace GraphQL;
|
||||||
|
|
||||||
use GraphQL\Executor\Promise\Adapter\SyncPromise;
|
use GraphQL\Executor\Promise\Adapter\SyncPromise;
|
||||||
|
|
||||||
class Deferred
|
class Deferred
|
||||||
{
|
{
|
||||||
/**
|
/** @var \SplQueue */
|
||||||
* @var \SplQueue
|
|
||||||
*/
|
|
||||||
private static $queue;
|
private static $queue;
|
||||||
|
|
||||||
/**
|
/** @var callable */
|
||||||
* @var callable
|
|
||||||
*/
|
|
||||||
private $callback;
|
private $callback;
|
||||||
|
|
||||||
/**
|
/** @var SyncPromise */
|
||||||
* @var SyncPromise
|
|
||||||
*/
|
|
||||||
public $promise;
|
public $promise;
|
||||||
|
|
||||||
public static function getQueue()
|
public static function getQueue()
|
||||||
@ -28,7 +25,7 @@ class Deferred
|
|||||||
public static function runQueue()
|
public static function runQueue()
|
||||||
{
|
{
|
||||||
$q = self::$queue;
|
$q = self::$queue;
|
||||||
while ($q && !$q->isEmpty()) {
|
while ($q && ! $q->isEmpty()) {
|
||||||
/** @var self $dfd */
|
/** @var self $dfd */
|
||||||
$dfd = $q->dequeue();
|
$dfd = $q->dequeue();
|
||||||
$dfd->run();
|
$dfd->run();
|
||||||
@ -38,7 +35,7 @@ class Deferred
|
|||||||
public function __construct(callable $callback)
|
public function __construct(callable $callback)
|
||||||
{
|
{
|
||||||
$this->callback = $callback;
|
$this->callback = $callback;
|
||||||
$this->promise = new SyncPromise();
|
$this->promise = new SyncPromise();
|
||||||
self::getQueue()->enqueue($this);
|
self::getQueue()->enqueue($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,7 +44,7 @@ class Deferred
|
|||||||
return $this->promise->then($onFulfilled, $onRejected);
|
return $this->promise->then($onFulfilled, $onRejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function run()
|
public function run() : void
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$cb = $this->callback;
|
$cb = $this->callback;
|
||||||
|
@ -35,6 +35,7 @@ use GraphQL\Utils\TypeInfo;
|
|||||||
use GraphQL\Utils\Utils;
|
use GraphQL\Utils\Utils;
|
||||||
use function array_keys;
|
use function array_keys;
|
||||||
use function array_merge;
|
use function array_merge;
|
||||||
|
use function array_reduce;
|
||||||
use function array_values;
|
use function array_values;
|
||||||
use function get_class;
|
use function get_class;
|
||||||
use function is_array;
|
use function is_array;
|
||||||
@ -68,7 +69,7 @@ class Executor
|
|||||||
self::$UNDEFINED = Utils::undefined();
|
self::$UNDEFINED = Utils::undefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->exeContext = $context;
|
$this->exeContext = $context;
|
||||||
$this->subFieldCache = new \SplObjectStorage();
|
$this->subFieldCache = new \SplObjectStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,7 +286,7 @@ class Executor
|
|||||||
// field and its descendants will be omitted, and sibling fields will still
|
// field and its descendants will be omitted, and sibling fields will still
|
||||||
// be executed. An execution which encounters errors will still result in a
|
// be executed. An execution which encounters errors will still result in a
|
||||||
// resolved Promise.
|
// resolved Promise.
|
||||||
$data = $this->executeOperation($this->exeContext->operation, $this->exeContext->rootValue);
|
$data = $this->executeOperation($this->exeContext->operation, $this->exeContext->rootValue);
|
||||||
$result = $this->buildResponse($data);
|
$result = $this->buildResponse($data);
|
||||||
|
|
||||||
// Note: we deviate here from the reference implementation a bit by always returning promise
|
// Note: we deviate here from the reference implementation a bit by always returning promise
|
||||||
@ -995,8 +996,7 @@ class Executor
|
|||||||
* If the callback does not return a Promise, then this function will also not
|
* If the callback does not return a Promise, then this function will also not
|
||||||
* return a Promise.
|
* return a Promise.
|
||||||
*
|
*
|
||||||
* @param mixed[] $values
|
* @param mixed[] $values
|
||||||
* @param \Closure $callback
|
|
||||||
* @param Promise|mixed|null $initialValue
|
* @param Promise|mixed|null $initialValue
|
||||||
* @return mixed[]
|
* @return mixed[]
|
||||||
*/
|
*/
|
||||||
@ -1291,23 +1291,18 @@ class Executor
|
|||||||
return $this->executeFields($returnType, $result, $path, $subFieldNodes);
|
return $this->executeFields($returnType, $result, $path, $subFieldNodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private function collectSubFields(ObjectType $returnType, $fieldNodes) : ArrayObject
|
||||||
* @param ObjectType $returnType
|
|
||||||
* @param $fieldNodes
|
|
||||||
* @return ArrayObject
|
|
||||||
*/
|
|
||||||
private function collectSubFields(ObjectType $returnType, $fieldNodes): ArrayObject
|
|
||||||
{
|
{
|
||||||
if (!isset($this->subFieldCache[$returnType])) {
|
if (! isset($this->subFieldCache[$returnType])) {
|
||||||
$this->subFieldCache[$returnType] = new \SplObjectStorage();
|
$this->subFieldCache[$returnType] = new \SplObjectStorage();
|
||||||
}
|
}
|
||||||
if (!isset($this->subFieldCache[$returnType][$fieldNodes])) {
|
if (! isset($this->subFieldCache[$returnType][$fieldNodes])) {
|
||||||
// Collect sub-fields to execute to complete this value.
|
// Collect sub-fields to execute to complete this value.
|
||||||
$subFieldNodes = new \ArrayObject();
|
$subFieldNodes = new \ArrayObject();
|
||||||
$visitedFragmentNames = new \ArrayObject();
|
$visitedFragmentNames = new \ArrayObject();
|
||||||
|
|
||||||
foreach ($fieldNodes as $fieldNode) {
|
foreach ($fieldNodes as $fieldNode) {
|
||||||
if (!isset($fieldNode->selectionSet)) {
|
if (! isset($fieldNode->selectionSet)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
182
src/GraphQL.php
182
src/GraphQL.php
@ -1,4 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GraphQL;
|
namespace GraphQL;
|
||||||
|
|
||||||
use GraphQL\Error\Error;
|
use GraphQL\Error\Error;
|
||||||
@ -6,15 +9,19 @@ use GraphQL\Executor\ExecutionResult;
|
|||||||
use GraphQL\Executor\Executor;
|
use GraphQL\Executor\Executor;
|
||||||
use GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter;
|
use GraphQL\Executor\Promise\Adapter\SyncPromiseAdapter;
|
||||||
use GraphQL\Executor\Promise\Promise;
|
use GraphQL\Executor\Promise\Promise;
|
||||||
|
use GraphQL\Executor\Promise\PromiseAdapter;
|
||||||
use GraphQL\Language\AST\DocumentNode;
|
use GraphQL\Language\AST\DocumentNode;
|
||||||
use GraphQL\Language\Parser;
|
use GraphQL\Language\Parser;
|
||||||
use GraphQL\Language\Source;
|
use GraphQL\Language\Source;
|
||||||
use GraphQL\Executor\Promise\PromiseAdapter;
|
|
||||||
use GraphQL\Type\Definition\Directive;
|
use GraphQL\Type\Definition\Directive;
|
||||||
use GraphQL\Type\Definition\Type;
|
use GraphQL\Type\Definition\Type;
|
||||||
|
use GraphQL\Type\Schema as SchemaType;
|
||||||
use GraphQL\Validator\DocumentValidator;
|
use GraphQL\Validator\DocumentValidator;
|
||||||
use GraphQL\Validator\Rules\ValidationRule;
|
|
||||||
use GraphQL\Validator\Rules\QueryComplexity;
|
use GraphQL\Validator\Rules\QueryComplexity;
|
||||||
|
use GraphQL\Validator\Rules\ValidationRule;
|
||||||
|
use function array_values;
|
||||||
|
use function trigger_error;
|
||||||
|
use const E_USER_DEPRECATED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the primary facade for fulfilling GraphQL operations.
|
* This is the primary facade for fulfilling GraphQL operations.
|
||||||
@ -58,32 +65,35 @@ class GraphQL
|
|||||||
* queries which are validated before persisting and assumed valid during execution)
|
* queries which are validated before persisting and assumed valid during execution)
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
* @param \GraphQL\Type\Schema $schema
|
|
||||||
* @param string|DocumentNode $source
|
* @param string|DocumentNode $source
|
||||||
* @param mixed $rootValue
|
* @param mixed $rootValue
|
||||||
* @param mixed $context
|
* @param mixed $context
|
||||||
* @param array|null $variableValues
|
* @param mixed[]|null $variableValues
|
||||||
* @param string|null $operationName
|
* @param ValidationRule[] $validationRules
|
||||||
* @param callable $fieldResolver
|
|
||||||
* @param array $validationRules
|
|
||||||
*
|
|
||||||
* @return ExecutionResult
|
|
||||||
*/
|
*/
|
||||||
public static function executeQuery(
|
public static function executeQuery(
|
||||||
\GraphQL\Type\Schema $schema,
|
SchemaType $schema,
|
||||||
$source,
|
$source,
|
||||||
$rootValue = null,
|
$rootValue = null,
|
||||||
$context = null,
|
$context = null,
|
||||||
$variableValues = null,
|
$variableValues = null,
|
||||||
$operationName = null,
|
?string $operationName = null,
|
||||||
callable $fieldResolver = null,
|
?callable $fieldResolver = null,
|
||||||
array $validationRules = null
|
?array $validationRules = null
|
||||||
)
|
) : ExecutionResult {
|
||||||
{
|
|
||||||
$promiseAdapter = new SyncPromiseAdapter();
|
$promiseAdapter = new SyncPromiseAdapter();
|
||||||
|
|
||||||
$promise = self::promiseToExecute($promiseAdapter, $schema, $source, $rootValue, $context,
|
$promise = self::promiseToExecute(
|
||||||
$variableValues, $operationName, $fieldResolver, $validationRules);
|
$promiseAdapter,
|
||||||
|
$schema,
|
||||||
|
$source,
|
||||||
|
$rootValue,
|
||||||
|
$context,
|
||||||
|
$variableValues,
|
||||||
|
$operationName,
|
||||||
|
$fieldResolver,
|
||||||
|
$validationRules
|
||||||
|
);
|
||||||
|
|
||||||
return $promiseAdapter->wait($promise);
|
return $promiseAdapter->wait($promise);
|
||||||
}
|
}
|
||||||
@ -93,30 +103,23 @@ class GraphQL
|
|||||||
* Useful for Async PHP platforms.
|
* Useful for Async PHP platforms.
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
* @param PromiseAdapter $promiseAdapter
|
* @param string|DocumentNode $source
|
||||||
* @param \GraphQL\Type\Schema $schema
|
* @param mixed $rootValue
|
||||||
* @param string|DocumentNode $source
|
* @param mixed $context
|
||||||
* @param mixed $rootValue
|
* @param mixed[]|null $variableValues
|
||||||
* @param mixed $context
|
* @param ValidationRule[]|null $validationRules
|
||||||
* @param array|null $variableValues
|
|
||||||
* @param string|null $operationName
|
|
||||||
* @param callable $fieldResolver
|
|
||||||
* @param array $validationRules
|
|
||||||
*
|
|
||||||
* @return Promise
|
|
||||||
*/
|
*/
|
||||||
public static function promiseToExecute(
|
public static function promiseToExecute(
|
||||||
PromiseAdapter $promiseAdapter,
|
PromiseAdapter $promiseAdapter,
|
||||||
\GraphQL\Type\Schema $schema,
|
SchemaType $schema,
|
||||||
$source,
|
$source,
|
||||||
$rootValue = null,
|
$rootValue = null,
|
||||||
$context = null,
|
$context = null,
|
||||||
$variableValues = null,
|
$variableValues = null,
|
||||||
$operationName = null,
|
?string $operationName = null,
|
||||||
callable $fieldResolver = null,
|
?callable $fieldResolver = null,
|
||||||
array $validationRules = null
|
?array $validationRules = null
|
||||||
)
|
) : Promise {
|
||||||
{
|
|
||||||
try {
|
try {
|
||||||
if ($source instanceof DocumentNode) {
|
if ($source instanceof DocumentNode) {
|
||||||
$documentNode = $source;
|
$documentNode = $source;
|
||||||
@ -125,36 +128,38 @@ class GraphQL
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
if (!empty($validationRules)) {
|
if (empty($validationRules)) {
|
||||||
foreach ($validationRules as $rule) {
|
|
||||||
if ($rule instanceof QueryComplexity) {
|
|
||||||
$rule->setRawVariableValues($variableValues);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/** @var QueryComplexity $queryComplexity */
|
/** @var QueryComplexity $queryComplexity */
|
||||||
$queryComplexity = DocumentValidator::getRule(QueryComplexity::class);
|
$queryComplexity = DocumentValidator::getRule(QueryComplexity::class);
|
||||||
$queryComplexity->setRawVariableValues($variableValues);
|
$queryComplexity->setRawVariableValues($variableValues);
|
||||||
|
} else {
|
||||||
|
foreach ($validationRules as $rule) {
|
||||||
|
if (! ($rule instanceof QueryComplexity)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$rule->setRawVariableValues($variableValues);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$validationErrors = DocumentValidator::validate($schema, $documentNode, $validationRules);
|
$validationErrors = DocumentValidator::validate($schema, $documentNode, $validationRules);
|
||||||
|
|
||||||
if (!empty($validationErrors)) {
|
if (! empty($validationErrors)) {
|
||||||
return $promiseAdapter->createFulfilled(
|
return $promiseAdapter->createFulfilled(
|
||||||
new ExecutionResult(null, $validationErrors)
|
new ExecutionResult(null, $validationErrors)
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return Executor::promiseToExecute(
|
|
||||||
$promiseAdapter,
|
|
||||||
$schema,
|
|
||||||
$documentNode,
|
|
||||||
$rootValue,
|
|
||||||
$context,
|
|
||||||
$variableValues,
|
|
||||||
$operationName,
|
|
||||||
$fieldResolver
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Executor::promiseToExecute(
|
||||||
|
$promiseAdapter,
|
||||||
|
$schema,
|
||||||
|
$documentNode,
|
||||||
|
$rootValue,
|
||||||
|
$context,
|
||||||
|
$variableValues,
|
||||||
|
$operationName,
|
||||||
|
$fieldResolver
|
||||||
|
);
|
||||||
} catch (Error $e) {
|
} catch (Error $e) {
|
||||||
return $promiseAdapter->createFulfilled(
|
return $promiseAdapter->createFulfilled(
|
||||||
new ExecutionResult(null, [$e])
|
new ExecutionResult(null, [$e])
|
||||||
@ -165,29 +170,28 @@ class GraphQL
|
|||||||
/**
|
/**
|
||||||
* @deprecated Use executeQuery()->toArray() instead
|
* @deprecated Use executeQuery()->toArray() instead
|
||||||
*
|
*
|
||||||
* @param \GraphQL\Type\Schema $schema
|
|
||||||
* @param string|DocumentNode $source
|
* @param string|DocumentNode $source
|
||||||
* @param mixed $rootValue
|
* @param mixed $rootValue
|
||||||
* @param mixed $contextValue
|
* @param mixed $contextValue
|
||||||
* @param array|null $variableValues
|
* @param mixed[]|null $variableValues
|
||||||
* @param string|null $operationName
|
* @return Promise|mixed[]
|
||||||
* @return Promise|array
|
|
||||||
*/
|
*/
|
||||||
public static function execute(
|
public static function execute(
|
||||||
\GraphQL\Type\Schema $schema,
|
SchemaType $schema,
|
||||||
$source,
|
$source,
|
||||||
$rootValue = null,
|
$rootValue = null,
|
||||||
$contextValue = null,
|
$contextValue = null,
|
||||||
$variableValues = null,
|
$variableValues = null,
|
||||||
$operationName = null
|
?string $operationName = null
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
trigger_error(
|
trigger_error(
|
||||||
__METHOD__ . ' is deprecated, use GraphQL::executeQuery()->toArray() as a quick replacement',
|
__METHOD__ . ' is deprecated, use GraphQL::executeQuery()->toArray() as a quick replacement',
|
||||||
E_USER_DEPRECATED
|
E_USER_DEPRECATED
|
||||||
);
|
);
|
||||||
$result = self::promiseToExecute(
|
|
||||||
$promiseAdapter = Executor::getPromiseAdapter(),
|
$promiseAdapter = Executor::getPromiseAdapter();
|
||||||
|
$result = self::promiseToExecute(
|
||||||
|
$promiseAdapter,
|
||||||
$schema,
|
$schema,
|
||||||
$source,
|
$source,
|
||||||
$rootValue,
|
$rootValue,
|
||||||
@ -199,40 +203,40 @@ class GraphQL
|
|||||||
if ($promiseAdapter instanceof SyncPromiseAdapter) {
|
if ($promiseAdapter instanceof SyncPromiseAdapter) {
|
||||||
$result = $promiseAdapter->wait($result)->toArray();
|
$result = $promiseAdapter->wait($result)->toArray();
|
||||||
} else {
|
} else {
|
||||||
$result = $result->then(function(ExecutionResult $r) {
|
$result = $result->then(function (ExecutionResult $r) {
|
||||||
return $r->toArray();
|
return $r->toArray();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated renamed to executeQuery()
|
* @deprecated renamed to executeQuery()
|
||||||
*
|
*
|
||||||
* @param \GraphQL\Type\Schema $schema
|
|
||||||
* @param string|DocumentNode $source
|
* @param string|DocumentNode $source
|
||||||
* @param mixed $rootValue
|
* @param mixed $rootValue
|
||||||
* @param mixed $contextValue
|
* @param mixed $contextValue
|
||||||
* @param array|null $variableValues
|
* @param mixed[]|null $variableValues
|
||||||
* @param string|null $operationName
|
|
||||||
*
|
*
|
||||||
* @return ExecutionResult|Promise
|
* @return ExecutionResult|Promise
|
||||||
*/
|
*/
|
||||||
public static function executeAndReturnResult(
|
public static function executeAndReturnResult(
|
||||||
\GraphQL\Type\Schema $schema,
|
SchemaType $schema,
|
||||||
$source,
|
$source,
|
||||||
$rootValue = null,
|
$rootValue = null,
|
||||||
$contextValue = null,
|
$contextValue = null,
|
||||||
$variableValues = null,
|
$variableValues = null,
|
||||||
$operationName = null
|
?string $operationName = null
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
trigger_error(
|
trigger_error(
|
||||||
__METHOD__ . ' is deprecated, use GraphQL::executeQuery() as a quick replacement',
|
__METHOD__ . ' is deprecated, use GraphQL::executeQuery() as a quick replacement',
|
||||||
E_USER_DEPRECATED
|
E_USER_DEPRECATED
|
||||||
);
|
);
|
||||||
$result = self::promiseToExecute(
|
|
||||||
$promiseAdapter = Executor::getPromiseAdapter(),
|
$promiseAdapter = Executor::getPromiseAdapter();
|
||||||
|
$result = self::promiseToExecute(
|
||||||
|
$promiseAdapter,
|
||||||
$schema,
|
$schema,
|
||||||
$source,
|
$source,
|
||||||
$rootValue,
|
$rootValue,
|
||||||
@ -240,9 +244,11 @@ class GraphQL
|
|||||||
$variableValues,
|
$variableValues,
|
||||||
$operationName
|
$operationName
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($promiseAdapter instanceof SyncPromiseAdapter) {
|
if ($promiseAdapter instanceof SyncPromiseAdapter) {
|
||||||
$result = $promiseAdapter->wait($result);
|
$result = $promiseAdapter->wait($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,7 +258,7 @@ class GraphQL
|
|||||||
* @api
|
* @api
|
||||||
* @return Directive[]
|
* @return Directive[]
|
||||||
*/
|
*/
|
||||||
public static function getStandardDirectives()
|
public static function getStandardDirectives() : array
|
||||||
{
|
{
|
||||||
return array_values(Directive::getInternalDirectives());
|
return array_values(Directive::getInternalDirectives());
|
||||||
}
|
}
|
||||||
@ -263,7 +269,7 @@ class GraphQL
|
|||||||
* @api
|
* @api
|
||||||
* @return Type[]
|
* @return Type[]
|
||||||
*/
|
*/
|
||||||
public static function getStandardTypes()
|
public static function getStandardTypes() : array
|
||||||
{
|
{
|
||||||
return array_values(Type::getInternalTypes());
|
return array_values(Type::getInternalTypes());
|
||||||
}
|
}
|
||||||
@ -274,23 +280,17 @@ class GraphQL
|
|||||||
* @api
|
* @api
|
||||||
* @return ValidationRule[]
|
* @return ValidationRule[]
|
||||||
*/
|
*/
|
||||||
public static function getStandardValidationRules()
|
public static function getStandardValidationRules() : array
|
||||||
{
|
{
|
||||||
return array_values(DocumentValidator::defaultRules());
|
return array_values(DocumentValidator::defaultRules());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public static function setDefaultFieldResolver(callable $fn) : void
|
||||||
* @param callable $fn
|
|
||||||
*/
|
|
||||||
public static function setDefaultFieldResolver(callable $fn)
|
|
||||||
{
|
{
|
||||||
Executor::setDefaultFieldResolver($fn);
|
Executor::setDefaultFieldResolver($fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public static function setPromiseAdapter(?PromiseAdapter $promiseAdapter = null) : void
|
||||||
* @param PromiseAdapter|null $promiseAdapter
|
|
||||||
*/
|
|
||||||
public static function setPromiseAdapter(PromiseAdapter $promiseAdapter = null)
|
|
||||||
{
|
{
|
||||||
Executor::setPromiseAdapter($promiseAdapter);
|
Executor::setPromiseAdapter($promiseAdapter);
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ class GraphQL
|
|||||||
* @deprecated Renamed to getStandardDirectives
|
* @deprecated Renamed to getStandardDirectives
|
||||||
* @return Directive[]
|
* @return Directive[]
|
||||||
*/
|
*/
|
||||||
public static function getInternalDirectives()
|
public static function getInternalDirectives() : array
|
||||||
{
|
{
|
||||||
return self::getStandardDirectives();
|
return self::getStandardDirectives();
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace GraphQL;
|
namespace GraphQL;
|
||||||
|
|
||||||
|
use function trigger_error;
|
||||||
|
use const E_USER_DEPRECATED;
|
||||||
|
|
||||||
trigger_error(
|
trigger_error(
|
||||||
'GraphQL\Schema is moved to GraphQL\Type\Schema',
|
'GraphQL\Schema is moved to GraphQL\Type\Schema',
|
||||||
E_USER_DEPRECATED
|
E_USER_DEPRECATED
|
||||||
|
@ -4,11 +4,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace GraphQL\Server;
|
namespace GraphQL\Server;
|
||||||
|
|
||||||
use const CASE_LOWER;
|
|
||||||
use function array_change_key_case;
|
use function array_change_key_case;
|
||||||
use function is_string;
|
use function is_string;
|
||||||
use function json_decode;
|
use function json_decode;
|
||||||
use function json_last_error;
|
use function json_last_error;
|
||||||
|
use const CASE_LOWER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structure representing parsed HTTP parameters for GraphQL operation
|
* Structure representing parsed HTTP parameters for GraphQL operation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user