Skip to content

Commit 050b3f7

Browse files
committed
refactor(executor): Replace deprecated AST::getOperation() with AST::getOperationAST() (drupal-graphql#1210)
1 parent 716ff34 commit 050b3f7

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
8484
- name: Install GraphQL dependencies
8585
run: composer --no-interaction --no-progress require \
86-
webonyx/graphql-php:^14.3 \
86+
webonyx/graphql-php:^14.8 \
8787
drupal/typed_data:^1.0 \
8888
drupal/redirect:^1.6 \
8989
phpstan/phpstan:^0.12.70 \

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "GPL-2.0+",
77
"require": {
88
"php": ">=7.2",
9-
"webonyx/graphql-php": "^14.5.0"
9+
"webonyx/graphql-php": "^14.8.0"
1010
},
1111
"minimum-stability": "dev"
1212
}

src/GraphQL/Execution/Executor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ public static function create(
213213
*/
214214
public function doExecute(): Promise {
215215
$server = $this->context->getServer();
216-
$type = AST::getOperation($this->document, $this->operation);
217-
if ($type === 'query' && !!$server->get('caching')) {
216+
$operation_def = AST::getOperationAST($this->document, $this->operation);
217+
if ($operation_def && $operation_def->operation === 'query' && !!$server->get('caching')) {
218218
return $this->doExecuteCached($this->cachePrefix());
219219
}
220220

0 commit comments

Comments
 (0)