diff --git a/public/API/graphql.php b/public/API/graphql.php
index cec07bc38dea6dcc516d20c86c8fb583fffa00b3..0e8190a8ebf72d3986a18f1103540b8c46c461f4 100644
--- a/public/API/graphql.php
+++ b/public/API/graphql.php
@@ -11,25 +11,16 @@ $schema = new Schema([
     'query' => $queryType
 ]);
 
-$rawInput = file_get_contents('php://input');
-$input = json_decode($rawInput, true);
-$query = $input['query'];
-$variableValues = isset($input['variables']) ? $input['variables'] : null;
-
 try {
-    $rootValue = [
-        "db"=> $conn
-    ];
-    $result = GraphQL::executeQuery($schema, $query, $rootValue, null, $variableValues);
-    $output = $result->toArray();
-} catch (\Exception $e) {
-    $output = [
-        'errors' => [
-            [
-                'message' => $e->getMessage()
-            ]
+    $serverConfig = [
+        'schema' => $schema,
+        'rootValue' => [
+            'db' =>$conn,
         ]
     ];
+    $server = new StandardServer($serverConfig);
+
+    $server->handleRequest();
+} catch (Throwable $error) {
+    StandardServer::send500Error($error);
 }
-header('Content-Type: application/json');
-echo json_encode($output);
\ No newline at end of file