Symfony bundle for GraphQL Mapper
This is installable via Composer as arthem/graphql-mapper-bundle:
composer require arthem/graphql-mapper-bundle
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
Just call POST /app_dev.php/graphql/query
with a "query" in the body
Released under the MIT License.