From 1cef07a2d495ae9daeae93e9208fa34afd8459c1 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Tue, 5 May 2026 15:46:15 +0100 Subject: [PATCH] Fix GraphQL coroutine context propagation Promises\Swoole was already propagating the request container into child coroutines, but using its own pre-existing key (__utopia_http_request_container) rather than the new utopia-php/http key (__utopia__). With the keys mismatched, the propagation was dead code and resolvers spawned from webonyx coroutines saw an empty context, failing every GraphQL query with 'Dependency utopia:graphql not found'. Align the key so child coroutines actually inherit the request's container (wrapped as a child Container, so request-scoped overrides in the resolver can't bleed back into the outer request). Co-Authored-By: Claude Opus 4.7 (1M context) --- src/Appwrite/Promises/Swoole.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Promises/Swoole.php b/src/Appwrite/Promises/Swoole.php index 9c06fbda2f..03c901ead6 100644 --- a/src/Appwrite/Promises/Swoole.php +++ b/src/Appwrite/Promises/Swoole.php @@ -8,7 +8,7 @@ use Utopia\DI\Container; class Swoole extends Promise { - private const REQUEST_CONTAINER_CONTEXT_KEY = '__utopia_http_request_container'; + private const REQUEST_CONTAINER_CONTEXT_KEY = '__utopia__'; public function __construct(?callable $executor = null) {