chore: update webonyx/graphql-php from v14.11 to v15.31

Addresses breaking changes in the v14 to v15 migration:
- Remove `getCategory()` from Exception (removed from ClientAware interface)
- Use constructor config for ScalarType name/description (trait now uses typed properties)
- Update PromiseAdapter signatures: `createRejected(\Throwable)`, `all(iterable)`
- Add `mixed` return types to ScalarType method overrides
- Fix `NodeList` usage with `iterator_to_array()` for `array_map` compatibility
- Fix Assoc::parseLiteral to properly type-check StringValueNode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jake Barnby
2026-04-14 18:10:02 +12:00
co-authored by Claude Opus 4.6
parent 0a21f3b139
commit 16c35f206d
8 changed files with 78 additions and 50 deletions
+1 -1
View File
@@ -92,7 +92,7 @@
"chillerlan/php-qrcode": "4.3.*",
"adhocore/jwt": "1.1.*",
"spomky-labs/otphp": "11.*",
"webonyx/graphql-php": "14.11.*",
"webonyx/graphql-php": "15.31.*",
"league/csv": "9.14.*",
"enshrined/svg-sanitize": "0.22.*"
},
Generated
+33 -19
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "4fb974e9843f6104e40396e7cad4a833",
"content-hash": "f6a87c1012b316e614258f8f57a28e48",
"packages": [
{
"name": "adhocore/jwt",
@@ -5381,38 +5381,48 @@
},
{
"name": "webonyx/graphql-php",
"version": "v14.11.10",
"version": "v15.31.5",
"source": {
"type": "git",
"url": "https://github.com/webonyx/graphql-php.git",
"reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19"
"reference": "089c4ef7e112df85788cfe06596278a8f99f4aa9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webonyx/graphql-php/zipball/d9c2fdebc6aa01d831bc2969da00e8588cffef19",
"reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19",
"url": "https://api.github.com/repos/webonyx/graphql-php/zipball/089c4ef7e112df85788cfe06596278a8f99f4aa9",
"reference": "089c4ef7e112df85788cfe06596278a8f99f4aa9",
"shasum": ""
},
"require": {
"ext-json": "*",
"ext-mbstring": "*",
"php": "^7.1 || ^8"
"php": "^7.4 || ^8"
},
"require-dev": {
"amphp/amp": "^2.3",
"doctrine/coding-standard": "^6.0",
"nyholm/psr7": "^1.2",
"amphp/amp": "^2.6",
"amphp/http-server": "^2.1",
"dms/phpunit-arraysubset-asserts": "dev-master",
"ergebnis/composer-normalize": "^2.28",
"friendsofphp/php-cs-fixer": "3.94.2",
"mll-lab/php-cs-fixer-config": "5.13.0",
"nyholm/psr7": "^1.5",
"phpbench/phpbench": "^1.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "0.12.82",
"phpstan/phpstan-phpunit": "0.12.18",
"phpstan/phpstan-strict-rules": "0.12.9",
"phpunit/phpunit": "^7.2 || ^8.5",
"psr/http-message": "^1.0",
"react/promise": "2.*",
"simpod/php-coveralls-mirror": "^3.0"
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "2.1.46",
"phpstan/phpstan-phpunit": "2.0.16",
"phpstan/phpstan-strict-rules": "2.0.10",
"phpunit/phpunit": "^9.5 || ^10.5.21 || ^11",
"psr/http-message": "^1 || ^2",
"react/http": "^1.6",
"react/promise": "^2.0 || ^3.0",
"rector/rector": "^2.0",
"symfony/polyfill-php81": "^1.23",
"symfony/var-exporter": "^5 || ^6 || ^7 || ^8",
"thecodingmachine/safe": "^1.3 || ^2 || ^3",
"ticketswap/phpstan-error-formatter": "1.3.0"
},
"suggest": {
"amphp/http-server": "To leverage async resolving with webserver on AMPHP platform",
"psr/http-message": "To use standard GraphQL server",
"react/promise": "To leverage async resolving on React PHP platform"
},
@@ -5434,15 +5444,19 @@
],
"support": {
"issues": "https://github.com/webonyx/graphql-php/issues",
"source": "https://github.com/webonyx/graphql-php/tree/v14.11.10"
"source": "https://github.com/webonyx/graphql-php/tree/v15.31.5"
},
"funding": [
{
"url": "https://github.com/spawnia",
"type": "github"
},
{
"url": "https://opencollective.com/webonyx-graphql-php",
"type": "open_collective"
}
],
"time": "2023-07-05T14:23:37+00:00"
"time": "2026-04-11T18:06:15+00:00"
}
],
"packages-dev": [
-5
View File
@@ -11,9 +11,4 @@ class Exception extends AppwriteException implements ClientAware
{
return true;
}
public function getCategory(): string
{
return 'appwrite';
}
}
+4 -4
View File
@@ -73,16 +73,16 @@ abstract class Adapter implements PromiseAdapter
/**
* Create a new promise that is rejected with the given reason.
*
* @param mixed $reason
* @param \Throwable $reason
* @return GQLPromise
*/
abstract public function createRejected(mixed $reason): GQLPromise;
abstract public function createRejected(\Throwable $reason): GQLPromise;
/**
* Create a new promise that resolves when all passed in promises resolve.
*
* @param array $promisesOrValues
* @param iterable $promisesOrValues
* @return GQLPromise
*/
abstract public function all(array $promisesOrValues): GQLPromise;
abstract public function all(iterable $promisesOrValues): GQLPromise;
}
@@ -26,7 +26,7 @@ class Swoole extends Adapter
return new GQLPromise($promise, $this);
}
public function createRejected($reason): GQLPromise
public function createRejected(\Throwable $reason): GQLPromise
{
$promise = new SwoolePromise(function ($resolve, $reject) use ($reason) {
$reject($reason);
@@ -35,7 +35,7 @@ class Swoole extends Adapter
return new GQLPromise($promise, $this);
}
public function all(array $promisesOrValues): GQLPromise
public function all(iterable $promisesOrValues): GQLPromise
{
return new GQLPromise(SwoolePromise::all($promisesOrValues), $this);
}
+17 -6
View File
@@ -3,14 +3,21 @@
namespace Appwrite\GraphQL\Types;
use GraphQL\Language\AST\Node;
use GraphQL\Language\AST\StringValueNode;
use GraphQL\Type\Definition\ScalarType;
// https://github.com/webonyx/graphql-php/issues/129#issuecomment-309366803
class Assoc extends Json
{
public $name = 'Assoc';
public $description = 'The `Assoc` scalar type represents associative array values.';
public function __construct()
{
ScalarType::__construct([
'name' => 'Assoc',
'description' => 'The `Assoc` scalar type represents associative array values.',
]);
}
public function serialize($value)
public function serialize($value): mixed
{
if (\is_string($value)) {
return $value;
@@ -19,7 +26,7 @@ class Assoc extends Json
return \json_encode($value);
}
public function parseValue($value)
public function parseValue($value): mixed
{
if (\is_array($value)) {
return $value;
@@ -28,8 +35,12 @@ class Assoc extends Json
return \json_decode($value, true);
}
public function parseLiteral(Node $valueNode, ?array $variables = null)
public function parseLiteral(Node $valueNode, ?array $variables = null): mixed
{
return \json_decode($valueNode->value, true);
if ($valueNode instanceof StringValueNode) {
return \json_decode($valueNode->value, true);
}
return parent::parseLiteral($valueNode, $variables);
}
}
+10 -6
View File
@@ -8,21 +8,25 @@ use GraphQL\Type\Definition\ScalarType;
class InputFile extends ScalarType
{
public $name = 'InputFile';
public $description = 'The `InputFile` special type represents a file to be uploaded in the same HTTP request as specified by
[graphql-multipart-request-spec](https://github.com/jaydenseric/graphql-multipart-request-spec).';
public function __construct()
{
parent::__construct([
'name' => 'InputFile',
'description' => 'The `InputFile` special type represents a file to be uploaded in the same HTTP request as specified by [graphql-multipart-request-spec](https://github.com/jaydenseric/graphql-multipart-request-spec).',
]);
}
public function serialize($value)
public function serialize($value): mixed
{
return '';
}
public function parseValue($value)
public function parseValue($value): mixed
{
return $value;
}
public function parseLiteral(Node $valueNode, ?array $variables = null)
public function parseLiteral(Node $valueNode, ?array $variables = null): mixed
{
throw new Error('`InputFile` cannot be hardcoded in query, be sure to conform to GraphQL multipart request specification. Instead got: ' . $valueNode->kind, $valueNode);
}
+11 -7
View File
@@ -14,21 +14,25 @@ use GraphQL\Type\Definition\ScalarType;
// https://github.com/webonyx/graphql-php/issues/129#issuecomment-309366803
class Json extends ScalarType
{
public $name = 'Json';
public $description = 'The `JSON` scalar type represents JSON values as specified by
[ECMA-404](https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).';
public function __construct()
{
parent::__construct([
'name' => 'Json',
'description' => 'The `JSON` scalar type represents JSON values as specified by [ECMA-404](https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).',
]);
}
public function serialize($value)
public function serialize($value): mixed
{
return $value;
}
public function parseValue($value)
public function parseValue($value): mixed
{
return $value;
}
public function parseLiteral(Node $valueNode, ?array $variables = null)
public function parseLiteral(Node $valueNode, ?array $variables = null): mixed
{
switch ($valueNode) {
case $valueNode instanceof StringValueNode:
@@ -45,7 +49,7 @@ class Json extends ScalarType
}
return $value;
case ($valueNode instanceof ListValueNode):
return array_map([$this, 'parseLiteral'], $valueNode->values);
return array_map([$this, 'parseLiteral'], iterator_to_array($valueNode->values));
default:
return null;
}