Creating an API
Creating an APICreating a schema configuration

Creating a schema configuration

A schema configuration is used to customize the schema for Custom Endpoints and Persisted Queries.

The GraphQL schema can be configured with those elements provided by the different installed and enabled modules. (Go to the Modules page to see the list of all of them.)

Each module can define its configuration through its own block in the Schema Configuration editor. This includes blocks for:

Schema Configuration

Accessing all schema configurations

Clicking on "Schema Configurations" on the plugin's menu, it displays the list of all of them:

Schema Configurations in the admin
Schema Configurations in the admin

Creating a new schema configuration

Click on button "Add New Schema Configuration" to open the WordPress editor:

Creating a new Schema Configuration
Creating a new Schema Configuration

Removing blocks using "Default" value configurations (optional)

We can remove those configuration blocks which use the corresponding "Default" value from the Settings.

The removed block can be added once again via the inserter menu, by clicking on the + button at the bottom (please notice that only one instance of each block can be inserted):

Removing and adding blocks in the Schema Configuration

And then provide the configuration for the required blocks.

Describing the schema configuration

Use the "Excerpt" field, from the Document settings panel, to give a description to the schema configuration.

Find more information in guide Adding a description to the API.

Publishing the schema configuration

Select the required elements for the schema configuration, and adjust the options. When ready, click on "Publish":

Creating a new schema configuration

Using the schema configuration

Once published, the schema configuration becomes available to the editors for Custom Endpoints and Persisted Queries:

Selecting the Schema Configuration in the Custom Endpoint

Viewing the schema configuration

Opening the schema configuration's permalink in the browser will show its contents (as long as the user is logged-in and the user role has access to it):

Schema configuration's source