-
Notifications
You must be signed in to change notification settings - Fork 41
/
GraphQLiteBundle.php
32 lines (25 loc) · 1.13 KB
/
GraphQLiteBundle.php
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
30
31
32
<?php
namespace TheCodingMachine\GraphQLite\Bundle;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use TheCodingMachine\GraphQLite\Bundle\DependencyInjection\GraphQLiteExtension;
use TheCodingMachine\GraphQLite\Bundle\DependencyInjection\OverblogGraphiQLEndpointWiringPass;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use TheCodingMachine\GraphQLite\Bundle\DependencyInjection\GraphQLiteCompilerPass;
class GraphQLiteBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new GraphQLiteCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
$container->addCompilerPass(new OverblogGraphiQLEndpointWiringPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1);
}
public function getContainerExtension(): ?ExtensionInterface
{
if (null === $this->extension) {
$this->extension = new GraphQLiteExtension();
}
return $this->extension;
}
}