silverstripe/graphql-devtools

There is no license information available for the latest version (dev-master) of this package.

Tools to help developers building new applications on SilverStripe’s GraphQL API

Installs: 29 719

Dependents: 1

Suggesters: 1

Security: 0

Stars: 7

Watchers: 11

Forks: 10

Open Issues: 2

Type:silverstripe-vendormodule

dev-master / 1.x-dev 2020-04-02 12:14 UTC

This package is auto-updated.

Last update: 2020-04-02 12:14:14 UTC


README

Tools to help developers building new applications on SilverStripe’s GraphQL API

Installation

$ composer require --dev silverstripe/graphql-devtools

Requirements

What it does

This module adds an implementation of graphiql, an in-browser IDE for GraphQL servers. It provides browseable documentation of your schema, as well as autocomplete and syntax-checking of your queries.

It can be accessed at /dev/graphiql/.

By default, the tool has the same restrictions as other development tools like dev/build:

  • In "dev" mode, it's available without authentication
  • In "test" and "live" mode, it requires ADMIN permissions
  • It's installed with composer require --dev by default. In most deployment contexts that'll mean it's not available on environments in "test" or "live" modes

graphiql.png

Setting the endpoint

In most installations of SilverStripe, there are at least two GraphQL servers running -- one for the admin (admin/graphql) and one for the user space (/graphql). The IDE can only browse one schema at a time, so it must be configured with a route to use.

By default, it will use the /graphql route. This can be changed in the SilverStripe\GraphQLDevTools\GraphiQLController.default_route setting. Otherwise, you can specify an endpoint per request using the GET variable endpoint, e.g. /dev/graphiql?endpoint=admin/graphql.