Creating a schema configuration
A schema configuration is used to customize the schema for Custom Endpoints and Persisted Queries.
Accessing all schema configurations permalink
Clicking on "Schema Configurations" on the plugin's menu, it displays the list of all of them:
Creating a new schema configuration permalink
Click on button "Add New Schema Configuration" to open the WordPress editor:
A schema can be configured with the following elements:
Access Control Lists permalink
Select one or more entries to define who can access the schema and how. Read guide Defining access control to learn how to create them.
Cache Control Lists permalink
Select one or more entries to set-up HTTP caching. Read guide Adding HTTP caching to learn how to create them.
Further Options permalink
Configure the following elements:
- Setting the schema as public or private
- Namespacing the schema or not
- Enabling nested mutations for the schema or not
- Exposing “sensitive” data elements in the schema or not
- Adding self fields to the schema or not
Describing the schema configuration permalink
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 permalink
Select the required elements for the schema configuration, and adjust the options. When ready, click on "Publish":
Using the schema configuration permalink
Once published, the schema configuration becomes available to the editors for Custom Endpoints and Persisted Queries:
Viewing the schema configuration permalink
Opening the schema configuration's permalink in the browser will show its contents (as long as the user has access to it):
Editor Inputs permalink
These are the inputs in the body of the editor:
Input | Description |
---|---|
Access Control Lists | (If module Access Control is enabled) Manage who can access the schema, by selecting the Access Control Lists that must be applied to the custom endpoint or persisted query |
Cache Control Lists | (If module Cache Control is enabled) Manage the behavior of HTTP caching, by selecting the Cache Control Lists that must be applied to the custom endpoint or persisted query |
Further Options | Customize the behavior of the schema configuration: Public/Private Schema: (If module Public/Private Schema is enabled)When access to some a field or directive is denied, there are 2 ways for the API to behave:
"Default" is selected, the value selected in the Settings is used.Namespace Types and Interfaces?: (If module Schema Namespacing is enabled)Define if to have all types and interfaces in the schema automatically namespaced. If "Default" is selected, the value selected in the Settings is used.Mutation Scheme: (If module Nested Mutations is enabled)Define if to enable mutations, and if the redundant fields from the root must be removed. If "Default" is selected, the value selected in the Settings is used.Enable admin fields: (If module Schema Expose Admin Data is enabled)Define if to add the “sensitive” data elements to the schema. If "Default" is selected, the value selected in the Settings is used.Enable self fields: (If module Schema Self Fields is enabled)Define if to add the self fields to the schema. If "Default" is selected, the value selected in the Settings is used. |
These are the inputs in the Document settings:
Input | Description |
---|---|
Excerpt | Provide a description for the schema configuration. This input is available when module Excerpt as Description is enabled |