This bundle provide integration of Portiny/GraphQL into Symfony Framework.
The simplest way to install Portiny/GraphQL-Symfony is using Composer:
$ composer require portiny/graphql-symfony
Enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php
file of your project.
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
// ...
new Portiny\GraphQLSymfony\PortinyGraphQLSymfonyBundle(),
];
// ...
}
// ...
}
Enable auto-tagging for queries and mutations classes:
services:
_instanceof:
Portiny\GraphQL\Contract\Mutation\MutationFieldInterface:
tags: ['portiny.graphql.mutation_field']
Portiny\GraphQL\Contract\Field\QueryFieldInterface:
tags: ['portiny.graphql.query_field']
Available configuration might look like this:
parameters:
portiny.graphql.settings.debug: '%kernel.debug%'
portiny.graphql.schema_cache.enabled: true # highly recommended for the production environment
portiny.graphql.schema_cache.cache_dir: '%kernel.cache_dir%/graphql'
See official Portiny/GraphQL documentation.