A schema configuration is used by the Single Endpoint, Custom Endpoints and Persisted Queries to customize their behavior.
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
- Define who can access the schema via Access Control Lists
- Set-up HTTP caching via Cache Control Lists
- Many others
Clicking on the Schema Configurations link in the menu, it displays the list of all of them:
A schema configuration is a custom post type (CPT). To create a new schema configuration, click on button "Add New Schema Configuration", which will open the WordPress editor:
We can optionally 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):
To configure the different elements in the schema configuration, click on corresponding input, and it becomes editable. Then select the entries that apply to the configuration. When you are done, click on "Publish":
Once published, the schema configuration becomes available when editing a Custom Endpoint or Persisted Query:
If the Custom Endpoint or Persisted Query has value "Default"
, then the schema configuration selected in the Settings will be used:
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):
These inputs in the body of the editor are shipped with the plugin (more inputs can be added by extensions):
Input | Description |
---|---|
Expose Sensitive Data in the Schema | Expose “sensitive” data elements in the GraphQL schema (such as field Root.roles , field arg Root.posts(status:) , and others), which provide access to potentially private user data. If "Default" is selected, the value selected in the Settings is used. |
Mutation Scheme | 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. |
Namespace Types? | Define if to have all types in the schema automatically namespaced. If "Default" is selected, the value selected in the Settings is used. |
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 |
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. |
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 |
Many others | (Check the corresponding enabled modules...) |
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 |