Skip to content

4rthem/graphql-mapper-bundle

Repository files navigation

GraphQL Mapper Bundle

Symfony bundle for GraphQL Mapper

Installation

This is installable via Composer as arthem/graphql-mapper-bundle:

composer require arthem/graphql-mapper-bundle

Setup / Configuration

Enable the bundle:

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Arthem\Bundle\GraphQLBundle\ArthemGraphQLBundle(),
        );

        // ...
    }

    // ...
}

Create your schema:

# app/config/graphql_schema.yml

# Your schema here

See graphql-mapper documentation

Then declare your mapping file in the bundle configuration:

# app/config/config.yml

arthem_graphql:
    mapping:
        files:
            - %kernel.root_dir%/config/graphql_schema.yml

Setup routing:

# app/config/routing.yml
arthem_graphql:
    resource: "@ArthemGraphQLBundle/Resources/config/routing.yml"
    prefix:   /graphql

Usage

Just call POST /app_dev.php/graphql/query with a "query" in the body

License

Released under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages