Skip to content
Allow PhpStorm to introspect SilverStripe GraphQL
Branch: master
Clone or download
Latest commit 6cd850b Apr 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_config First commit Apr 26, 2018
src First commit Apr 26, 2018
.editorconfig First commit Apr 26, 2018
.gitattributes First commit Apr 26, 2018
.gitignore First commit Apr 26, 2018
_config.php First commit Apr 26, 2018
changelog.md First commit Apr 26, 2018
code-of-conduct.md First commit Apr 26, 2018
composer.json First commit Apr 26, 2018
composer.lock First commit Apr 26, 2018
contributing.md First commit Apr 26, 2018
license.md First commit Apr 26, 2018
readme.md First commit Apr 26, 2018

readme.md

SilverStripe-PhpStorm-GraphQL helper

This module allows you to use JS GraphQL within your SilverStripe project.

It does this by providing another authenticator that lets JS GraphQL query the schema without logging in. There might be a better way of going about this - I'm all ears!

To provide some sort of security, by default we restrict to queries from localhost, with the user-agent "JS GraphQL", and only in dev mode.

Requirements

  • silverstripe-graphql
  • PhpStorm
  • JS GraphQL

Installation

Install the JS GraphQL plugin Install this helper

composer require twohill/silverstripe-phpstorm-graphql

Create a graphql.config.json with the following details (update the URL as required)

{
  "schema": {
    "request": {
      "url": "http://localhost/graphql",
      "method": "POST",
      "postIntrospectionQuery": true,
      "options": {
        "headers": {
          "user-agent": "JS GraphQL",
          "Origin": "localhost"
        }
      }
    }
  },
  "endpoints": [
    {
      "name": "Default (http://localhost/graphql)",
      "url": "http://localhost/graphql",
      "options": {
        "headers": {
          "user-agent": "JS GraphQL",
          "Origin": "localhost"
        }
      }
    }
  ]
}

Edit some GraphQL and see some lovely schema completion :)

License

See License

Example configuration (optional)

If you want to override any of the security settings you can do so via yaml.

Twohill\PhpStormGraphQL\PhpStormDevAuthenticator:
  allowed_ips:
    - '127.0.0.1'
  allowed_useragent: 'JS GraphQL'
  allowed_environment: 'dev'

Maintainers

Bugtracker

Bugs are tracked in the issues section of this repository. Before submitting an issue please read over existing issues to ensure yours is unique.

If the issue does look like a new bug:

  • Create a new issue
  • Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots and screencasts can help here.
  • Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, Operating System, any installed SilverStripe modules.

Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker.

Development and contribution

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

You can’t perform that action at this time.