This Symfony 2 / 3 bundle provide integration GraphQL using webonyx/graphql-php and GraphQL Relay. It also supports batching using libs like ReactRelayNetworkLayer.
PHP >= 5.4
a) Download the bundle
In the project directory:
composer require overblog/graphql-bundle
b) Enable the bundle
// in app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
// ...
new Overblog\GraphQLBundle\OverblogGraphQLBundle(),
];
// ...
}
}
c) Enable GraphQL endpoint
# in app/config/routing.yml
overblog_graphql_endpoint:
resource: "@OverblogGraphQLBundle/Resources/config/routing/graphql.yml"
d) Enable GraphiQL in dev mode (required twig)
# in app/config/routing_dev.yml
overblog_graphql_graphiql:
resource: "@OverblogGraphQLBundle/Resources/config/routing/graphiql.yml"
Now you can define your graphQL schema.