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:
- Setting the schema as public or private
- Enabling “sensitive” data elements
- Namespacing the schema
- Using nested mutations
- Defining response headers
- Define who can access the schema via Access Control Lists
- Set-up HTTP caching via Cache Control Lists
- Many others
Accessing all schema configurations
Clicking on "Schema Configurations" on the plugin's menu, it displays the list of all of them:
Creating a new schema configuration
Click on button "Add New Schema Configuration" to open the WordPress editor:
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):
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":
Using the schema configuration
Once published, the schema configuration becomes available to the editors for Custom Endpoints and Persisted Queries:
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):