PHPackages                             graphpql/graphpinator-symfony - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. graphpql/graphpinator-symfony

ActiveLibrary[API Development](/categories/api)

graphpql/graphpinator-symfony
=============================

Graphpinator adapters and addons for Symfony framework.

v2.1(4mo ago)17.1k↓36.4%[5 PRs](https://github.com/graphpql/graphpinator-symfony/pulls)MITPHPCI passing

Since Mar 17Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/graphpql/graphpinator-symfony)[ Packagist](https://packagist.org/packages/graphpql/graphpinator-symfony)[ Docs](https://github.com/graphpql)[ RSS](/packages/graphpql-graphpinator-symfony/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (26)Versions (17)Used By (0)

Graphpinator Symfony
====================

[](#graphpinator-symfony)

⚡🌐⚡ Graphpinator adapters and addons for Symfony framework.

Introduction
------------

[](#introduction)

This package includes adapters and tools to easily integrate Graphpinator into a Symfony application.

Installation
------------

[](#installation)

Install package using composer

`composer require graphpql/graphpinator-symfony`

How to use
----------

[](#how-to-use)

### Register a bundle

[](#register-a-bundle)

Add a bundle entry to the `bundles.php`. Currently the bundle is only used for an access to the twig namespace, so this step can be ommited when the rendering actions will not be used.

```
Graphpinator\Symfony\GraphpinatorBundle::class => ['all' => true],
```

### Configure dependency injection

[](#configure-dependency-injection)

At first we need to configure Symfony to find all our types and tag them, so we can inject them into our type registry.

```
services:
    # Find and register all types into the DI container
    App\GraphQL\Default\Types\:
        resource: '../src/GraphQL/Default/Types'
        public: true # not needed when you do not have any accessors (see the cyclic dependencies section of this documentation)
        tags:
            - 'graphql.default.types'
    # Find and register all directives into the DI container
    App\GraphQL\Default\Directives\:
        resource: '../src/GraphQL/Default/Directives'
        tags:
            - 'graphql.default.directives'

    # Any additional types must be also registred and tagged to become available in the type container
    Graphpinator\ExtraTypes\EmailAddressType:
        tags:
            - 'graphql.default.types'
    Graphpinator\ExtraTypes\UrlType:
        tags:
            - 'graphql.default.types'
```

Create a specific `Container` service for each schema and instruct the DI to inject it with the types and directives using the tags we configured.

```
