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 9371834
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
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 || ^15.12.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());
}
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 9371834

Please sign in to comment.