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:

Schema Configurations in the admin
Schema Configurations in the admin

Creating a new schema configuration permalink

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

Creating a new Schema Configuration
Creating a new Schema Configuration

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.

Field Deprecation Lists permalink

Note: This section is initially not shown, because the "Field Deprecation" module is disabled by default.

Select one or more entries to deprecate fields in the schema. Read guide Deprecating fields to learn how to create them.

Options permalink

Note: The "namespacing" and "nested mutations" options are initially not shown, because modules "Schema Namespacing" and "Nested Mutations" are disabled by default.

Configure the following elements:

  • Setting the schema as public or private
  • Namespacing the schema or not
  • Enabling nested mutations for 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":

Creating a new schema configuration

Using the schema configuration permalink

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

Selecting the Schema Configuration in the Custom Endpoint
Selecting the Schema Configuration in the Custom Endpoint

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):

Schema configuration's source
Schema configuration's source


Editor Inputs permalink

These are the inputs in the body of the editor:

InputDescription
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
Field Deprecation Lists(If module Field Deprecation is enabled) Manage deprecation of fields in the schema, by selecting the Field Deprecation Lists that must be applied to the custom endpoint or persisted query
OptionsCustomize 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:
  • "Public": Provide an error message to the user, indicating why access is denied. This behavior makes the metadata from the schema always available.
  • "Private": The error message indicates that the field or directive does not exist. This behavior exposes the metadata from the schema only to those users who can access it.
If "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.

These are the inputs in the Document settings:

InputDescription
ExcerptProvide a description for the schema configuration.
This input is available when module Excerpt as Description is enabled

Share on 🐦 Twitter | πŸ‘ŽπŸΎ Facebook