1
0
Fork 0
mirror of synced 2024-07-01 04:30:59 +12:00

Fix chained promises

This commit is contained in:
Jake Barnby 2022-07-18 18:47:08 +12:00
parent 410d9b0f0c
commit 31081b01cb

View file

@ -3,6 +3,7 @@
namespace Appwrite\GraphQL\Promises;
use GraphQL\Error\InvariantViolation;
use GraphQL\Executor\Promise\Promise;
use GraphQL\Utils\Utils;
use Swoole\Coroutine\Channel;
@ -111,7 +112,7 @@ class CoroutinePromise
usleep(25000);
}
$callable = $this->isFulfilled() ? $onFulfilled : $onRejected;
if (!is_callable($callable)) {
if (!\is_callable($callable)) {
$resolve($this->result);
return;
}
@ -178,7 +179,7 @@ class CoroutinePromise
*/
private function setResult(mixed $value): void
{
if (!$value instanceof CoroutinePromise) {
if (!$value instanceof Promise) {
$this->result = $value;
return;
}