Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.43 KB

index.md

File metadata and controls

62 lines (44 loc) · 1.43 KB

Information

This bundle provide integration of Portiny/GraphQL into Symfony Framework.

Installation

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(),
        ];

        // ...
    }

    // ...
}

Configuration

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'

Usage

See official Portiny/GraphQL documentation.