Skip to content

Commit

Permalink
Attempt to fix the tests and adding both version for webonyx/graphql-…
Browse files Browse the repository at this point in the history
…php.
  • Loading branch information
apathak18 committed Jul 18, 2024
1 parent 627ce0f commit a4642a4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Install GraphQL dependencies
run: |
composer --no-interaction --no-progress require \
webonyx/graphql-php:^15.12 \
webonyx/graphql-php:^14.8 \
drupal/typed_data:^2.0 \
drupal/redirect:dev-1.x
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"require": {
"drupal/typed_data": "^1.0 || ^2.0",
"php": ">=8.0",
"webonyx/graphql-php": "^15.12.0"
"webonyx/graphql-php": "^14.8.0"
},
"minimum-stability": "dev"
}
7 changes: 6 additions & 1 deletion src/Entity/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ public function configuration() {
$server->setDebugFlag($this->get('debug_flag'));
$server->setQueryBatching(!!$this->get('batching'));
$server->setValidationRules($this->getValidationRules());
$server->setPersistentQueryLoader($this->getPersistedQueryLoader());
if (method_exists(ServerConfig::class, 'setPersistedQueryLoader')) {
$server->setPersistedQueryLoader($this->getPersistedQueryLoader());

Check failure on line 251 in src/Entity/Server.php

View workflow job for this annotation

GitHub Actions / Drupal 10.3.x (PHP 8.3)

Call to an undefined method GraphQL\Server\ServerConfig::setPersistedQueryLoader().
}
else {
$server->setPersistentQueryLoader($this->getPersistedQueryLoader());
}
$server->setContext($this->getContext($plugin, $params));
$server->setFieldResolver($this->getFieldResolver($registry));
$server->setSchema($plugin->getSchema($registry));
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/DataProducer/DefaultValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testLegacyDefaultValueSetting(bool $populate_setting, string $te
/**
* Data provider for the testLegacyDefaultValueSetting test.
*/
public function settingsProvider(): array {
public static function settingsProvider(): array {
return [
[FALSE, TestLegacyEntityLoad::class],
[TRUE, TestNewEntityLoad::class],
Expand Down

0 comments on commit a4642a4

Please sign in to comment.