From 678cf5d0bf1736d29d77e69bae05b17bafec7f9a Mon Sep 17 00:00:00 2001 From: Vladimir Razuvaev Date: Wed, 5 Jul 2017 16:26:02 +0700 Subject: [PATCH] Renamed argument of GraphQL::execute() --- src/GraphQL.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/GraphQL.php b/src/GraphQL.php index f7f7526..db190a1 100644 --- a/src/GraphQL.php +++ b/src/GraphQL.php @@ -45,7 +45,7 @@ class GraphQL * value or method on the source value with the field's name). * * @param Schema $schema - * @param string|DocumentNode $requestString + * @param string|DocumentNode $source * @param mixed $rootValue * @param array|null $variableValues * @param string|null $operationName @@ -54,7 +54,7 @@ class GraphQL */ public static function execute( Schema $schema, - $requestString, + $source, $rootValue = null, $contextValue = null, $variableValues = null, @@ -64,7 +64,7 @@ class GraphQL { $result = self::executeAndReturnResult( $schema, - $requestString, + $source, $rootValue, $contextValue, $variableValues, @@ -88,7 +88,7 @@ class GraphQL * which can be used for custom error formatting or adding extensions to response * * @param Schema $schema - * @param string|DocumentNode $requestString + * @param string|DocumentNode $source * @param mixed $rootValue * @param array|null $variableValues * @param string|null $operationName @@ -97,7 +97,7 @@ class GraphQL */ public static function executeAndReturnResult( Schema $schema, - $requestString, + $source, $rootValue = null, $contextValue = null, $variableValues = null, @@ -106,11 +106,10 @@ class GraphQL ) { try { - if ($requestString instanceof DocumentNode) { - $documentNode = $requestString; + if ($source instanceof DocumentNode) { + $documentNode = $source; } else { - $source = new Source($requestString ?: '', 'GraphQL request'); - $documentNode = Parser::parse($source); + $documentNode = Parser::parse(new Source($source ?: '', 'GraphQL')); } /** @var QueryComplexity $queryComplexity */