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 {
|
2022-04-05 10:26:18 +02:00
|
|
|
$serverConfig = [
|
|
|
|
'schema' => $schema,
|
|
|
|
'rootValue' => [
|
|
|
|
'db' =>$conn,
|
2022-03-08 09:54:38 +01:00
|
|
|
]
|
|
|
|
];
|
2022-04-05 10:26:18 +02:00
|
|
|
$server = new StandardServer($serverConfig);
|
|
|
|
|
|
|
|
$server->handleRequest();
|
|
|
|
} catch (Throwable $error) {
|
|
|
|
StandardServer::send500Error($error);
|
2022-03-08 09:54:38 +01:00
|
|
|
}
|