From 427b25dfb7f632f7fb138853d1f1a082ce475021 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 22 Jul 2022 11:38:28 +1200 Subject: [PATCH] Unpack query if request is coming from an SDK --- app/controllers/api/graphql.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index e9bb90374c..7f6811b175 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -97,6 +97,12 @@ function executeRequest( Type\Schema $schema ): void { $query = $request->getParams(); + + // SDK support + if ($request->getHeader('x-appwrite-graphql-packed') == 'true') { + $query = $query['query']; + } + $contentType = $request->getHeader('content-type'); $maxBatchSize = App::getEnv('_APP_GRAPHQL_MAX_BATCH_SIZE', 10);