-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevmode.php
More file actions
29 lines (19 loc) · 732 Bytes
/
Copy pathdevmode.php
File metadata and controls
29 lines (19 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
use Controller\RootController;
use GraphQL\Error\DebugFlag;
use League\Container\Container;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;
use TheCodingMachine\GraphQLite\SchemaFactory;
require_once __DIR__ . '/vendor/autoload.php';
//psr16
$cache = new Psr16Cache(new FilesystemAdapter());
//container
$container = new Container();
$container->add(RootController::class);
$factory = new SchemaFactory($cache, $container);
$factory->addNamespace('Controller');
$factory->devMode();
$schema = $factory->createSchema();
$result = GraphQL\GraphQL::executeQuery($schema, '{ test }');
print_r($result->toArray(DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE));