mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Expose swoole request instead of stealing it
This commit is contained in:
parent
af128ede7c
commit
d95a1b277f
2 changed files with 8 additions and 5 deletions
|
|
@ -385,7 +385,7 @@ class Builder
|
|||
$wg->wait();
|
||||
|
||||
$time_elapsed_secs = (microtime(true) - $start) * 1000;
|
||||
Console::info("[INFO] Time Taken To Build REST API Schema : ${time_elapsed_secs}ms");
|
||||
Console::info("Built GraphQL Project Collection Schema in ${time_elapsed_secs}ms");
|
||||
|
||||
return [
|
||||
'query' => $queryFields,
|
||||
|
|
@ -511,13 +511,11 @@ class Builder
|
|||
];
|
||||
}
|
||||
|
||||
/* Define a resolve function that defines how to fetch data for this type */
|
||||
$resolve = fn($type, $args, $context, $info) => new CoroutinePromise(
|
||||
function (callable $resolve, callable $reject) use ($utopia, $request, $response, &$register, $route, $args) {
|
||||
// Mutate the original request object to include the query variables at the top level
|
||||
$swooleRq = (fn() => $this->swoole)->bindTo($request, $request)();
|
||||
$swooleRq = $request->getSwoole();
|
||||
$swooleRq->post = $args;
|
||||
|
||||
// Drop json content type so post args are used directly
|
||||
if ($swooleRq->header['content-type'] === 'application/json') {
|
||||
unset($swooleRq->header['content-type']);
|
||||
|
|
@ -557,7 +555,7 @@ class Builder
|
|||
}
|
||||
|
||||
$time_elapsed_secs = (microtime(true) - $start) * 1000;
|
||||
Console::info("[INFO] Time Taken To Build REST API Schema : ${time_elapsed_secs}ms");
|
||||
Console::info("[INFO] Built GraphQL REST API Schema in ${time_elapsed_secs}ms");
|
||||
|
||||
return [
|
||||
'query' => $queryFields,
|
||||
|
|
|
|||
|
|
@ -28,6 +28,11 @@ class Request extends UtopiaRequest
|
|||
parent::__construct($request);
|
||||
}
|
||||
|
||||
public function getSwoole(): SwooleRequest
|
||||
{
|
||||
return $this->swoole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Params
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue