Renamed argument of GraphQL::execute()

This commit is contained in:
Vladimir Razuvaev 2017-07-05 16:26:02 +07:00
parent 78d9ba0d5e
commit 678cf5d0bf

View File

@ -45,7 +45,7 @@ class GraphQL
* value or method on the source value with the field's name). * value or method on the source value with the field's name).
* *
* @param Schema $schema * @param Schema $schema
* @param string|DocumentNode $requestString * @param string|DocumentNode $source
* @param mixed $rootValue * @param mixed $rootValue
* @param array|null $variableValues * @param array|null $variableValues
* @param string|null $operationName * @param string|null $operationName
@ -54,7 +54,7 @@ class GraphQL
*/ */
public static function execute( public static function execute(
Schema $schema, Schema $schema,
$requestString, $source,
$rootValue = null, $rootValue = null,
$contextValue = null, $contextValue = null,
$variableValues = null, $variableValues = null,
@ -64,7 +64,7 @@ class GraphQL
{ {
$result = self::executeAndReturnResult( $result = self::executeAndReturnResult(
$schema, $schema,
$requestString, $source,
$rootValue, $rootValue,
$contextValue, $contextValue,
$variableValues, $variableValues,
@ -88,7 +88,7 @@ class GraphQL
* which can be used for custom error formatting or adding extensions to response * which can be used for custom error formatting or adding extensions to response
* *
* @param Schema $schema * @param Schema $schema
* @param string|DocumentNode $requestString * @param string|DocumentNode $source
* @param mixed $rootValue * @param mixed $rootValue
* @param array|null $variableValues * @param array|null $variableValues
* @param string|null $operationName * @param string|null $operationName
@ -97,7 +97,7 @@ class GraphQL
*/ */
public static function executeAndReturnResult( public static function executeAndReturnResult(
Schema $schema, Schema $schema,
$requestString, $source,
$rootValue = null, $rootValue = null,
$contextValue = null, $contextValue = null,
$variableValues = null, $variableValues = null,
@ -106,11 +106,10 @@ class GraphQL
) )
{ {
try { try {
if ($requestString instanceof DocumentNode) { if ($source instanceof DocumentNode) {
$documentNode = $requestString; $documentNode = $source;
} else { } else {
$source = new Source($requestString ?: '', 'GraphQL request'); $documentNode = Parser::parse(new Source($source ?: '', 'GraphQL'));
$documentNode = Parser::parse($source);
} }
/** @var QueryComplexity $queryComplexity */ /** @var QueryComplexity $queryComplexity */