Extending the schema

Adding a custom model
Add a new class-backed type beyond DataObject
Adding middleware
Add middleware to to extend query execution
Adding a custom operation
Add a new operation for model types
The global schema
How to push modifications to every schema in the project
You are viewing docs for a pre-release version of silverstripe/graphql (4.x). Help us improve it by joining #graphql on the Community Slack, and report any issues at github.com/silverstripe/silverstripe-graphql. Docs for the current stable version (3.x) can be found here

The global schema

Developers of thirdparty modules that influence graphql schemas may want to take advantage of the global schema. This is a pseudo-schema that will merge itself with all other schemas that have been defined. A good use case is in the silverstripe/versioned module, where it is critical that all schemas can leverage its schema modifications.

The global schema is named *.

app/_config/graphql.yml

SilverStripe\GraphQL\Schema\Schema:
  schemas:
    '*':
      enums:
        VersionedStage:
          DRAFT: DRAFT
          LIVE: LIVE

Further reading

Adding a custom model
Add a new class-backed type beyond DataObject
Adding middleware
Add middleware to to extend query execution
Adding a custom operation
Add a new operation for model types
The global schema
How to push modifications to every schema in the project