website/public/API/graphql.php

27 lines
505 B
PHP
Raw Normal View History

2022-03-08 09:54:38 +01:00
<?php
use GraphQL\GraphQL;
use GraphQL\Type\Schema;
require 'vendor/autoload.php';
require "./lib/config.php";
require "./lib/mysql.php";
require "./queries/queries.php";
$schema = new Schema([
'query' => $queryType
]);
try {
$serverConfig = [
'schema' => $schema,
'rootValue' => [
'db' =>$conn,
2022-03-08 09:54:38 +01:00
]
];
$server = new StandardServer($serverConfig);
$server->handleRequest();
} catch (Throwable $error) {
StandardServer::send500Error($error);
2022-03-08 09:54:38 +01:00
}