Download the PHP package radic/graphql_streams_api-module without Composer
On this page you can find all versions of the php package radic/graphql_streams_api-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download radic/graphql_streams_api-module
More information about radic/graphql_streams_api-module
Files in radic/graphql_streams_api-module
Package graphql_streams_api-module
Short Description Effortlessly bind your PyroCMS Streams to the GraphQL API service. A great alternative to the non-free pro api-module addon.
License MIT
Homepage https://github.com/robinradic/graphql-streams-api
Informations about the package graphql_streams_api-module
PyroCMS GraphQL Streams Api Module
- Introduction
- Preview
- Documentation
- Installation
- Customization
- Generate
- License
Introduction
This module aims to provide an easy yet flexiable way to bind your PyroCMS Streams to a GraphQL API.
This module integrates nuwave/lighthouse
with PyroCMS Streams.
Please make sure you have a basic understanding of:
Preview
A small usage preview of this module.
1. Configure the bindings
config.php
2. Generate the schema.graphql
When you have defined all stream bindings and resolutions to your liking then you need to run the generator. This will generate a GraphQL schema definition file that will be used by Lighthouse:
3. And voila!
Documentation
Installation
Add to composer
Install addon
Publish the addon
To customize and define your GraphQL service use the api:publish
command.
This will publish the configuration and schema files to resources/{application}/addons/radic/graphql_streams_api
.
Customization
You can customize/define the GraphQL service in resources/{application}/addons/radic/graphql_streams_api
:
config/config.php
schema/queryable.graphqls
schema/core.graphqls
config.schema
output
: The path where the schema will be generated.imports
: Paths to other schema definition files that will be included in the generated schema output.
config.stream_bindings
This defines the streams that you want to be generated as GraphQL types.
The resolutions
are used to define the streams fields that should be in the GraphQL type.
You can either:
- Define only stream field name (like 'slugs'). The generator will use the
default_field_bindings
to resolve the GraphQL type automatically. - Define the stream field name and a custom GraphQL field type. This is usually done with relationship fields or if you want to add some directive(s) to the field.
Generate
After modifying the config.php
or any of the defined schema.imports
files you need to generate the output schema by running
This will generate the schema in the configured schema.output
file path.
License
Copyright 2018 - Robin Radic - MIT License
All versions of graphql_streams_api-module with dependencies
deinternetjongens/lighthouse-utils Version ~0.2