bdunogier / ezplatform-graphql-bundle
GraphQL server for the eZ Platform Open Source CMS Repository.
Installs: 367
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 2
Forks: 6
Open Issues: 34
Type:ezplatform-bundle
Requires
- ezsystems/ezpublish-kernel: ^6.0|^7.0
- overblog/graphql-bundle: ^0.11
Requires (Dev)
- overblog/graphiql-bundle: ^0.1
- phpspec/phpspec: ^5.1
Replaces
- dev-master / 0.3.x-dev
- dev-dev / 0.4.x-dev
- v0.3.2
- v0.3.1
- v0.3.0
- v0.3.0-beta3
- v0.3.0-beta2
- v0.3.0-beta1
- v0.2.0
- v0.1.0
- dev-refactor_field_value_builder
- dev-testing
- dev-netgen_tags
- dev-content_mutations
- dev-types_collections_filtering
- dev-apikey
- dev-permissions
- dev-richtext_embeds
- dev-update_types_after_schema_generation
- dev-relay
- dev-search
This package is auto-updated.
Last update: 2019-12-06 09:38:05 UTC
README
This Symfony bundle adds a GraphQL server to eZ Platform, the Open Source CMS. It exposes two endpoints.
The domain schema: /graphql
https://<host>/graphql
A graph of the repository's domain. It exposes the domain modelled using the repository, based on content types groups, content types and fields definitions. Use it to implement apps or sites dedicated to a given repository structure.
Example: an eZ Platform site.
Warning: this feature requires extra configuration steps. See the Domain Schema documentation.
The repository schema: /graphql/repository
https://<host>/graphql/repository
A graph of the repository's Public API. It exposes value objects from the repository: content, location, field, url alias... It is recommended for admin like applications, not limited to a particular repository.
Example: an eZ Platform Admin UI extension.
Repository schema documentation
Installation
Install the package and its dependencies using composer:
composer require ezsystems/ezplatform-graphql
Add the bundles to app/AppKernel.php
(pay attention to the order, it is important):
$bundles = array( // ... new BD\EzPlatformGraphQLBundle\BDEzPlatformGraphQLBundle(), new Overblog\GraphQLBundle\OverblogGraphQLBundle(), new AppBundle\AppBundle(), );
Add the GraphQL routing configuration to app/config/routing.yml
:
overblog_graphql: resource: "@OverblogGraphQLBundle/Resources/config/routing/graphql.yml" overblog_graphql_endpoint: path: /graphql defaults: _controller: Overblog\GraphQLBundle\Controller\GraphController::endpointAction _format: "json"
Generate your schema
Run the command that generates the GraphQL schema:
php bin/console ezplatform:graphql:generate-schema
php bin/console cache:clear
It will generate a lot of yaml files in app/config/graphql/ezplatform
, based on your content types.
GraphiQL
The graphical graphQL client, GraphiQL, must be installed separately if you want to use it. As a developer, you probably want to.
composer require --dev overblog/graphiql-bundle
Add OverblogGraphiQLBundle
to the dev
bundles:
case 'dev': // ... $bundles[] = new Overblog\GraphiQLBundle\OverblogGraphiQLBundle();
Add the GraphiQL route to app/config/routing_dev.yml
:
overblog_graphql_graphiql: resource: "@OverblogGraphiQLBundle/Resources/config/routing.xml"
Open http://<yourhost>/graphiql
.