Click on button "Add New GraphQL persisted query" to open the WordPress editor:
Give it a title and make sure the permalink is the expected one, input the GraphQL query, select the schema configuration, and adjust the options. When ready, click on the Publish button, and the permalink becomes the persisted query's endpoint.
The link to the endpoint (and to the source) is shown on the "Persisted Query Endpoint Overview" sidebar panel:
By default, the persisted query's endpoint has path /graphql-query/, and this value is configurable through the Settings:
By setting the status of the Persisted Query as private, the endpoint can only be accessed by the admin user. This prevents our data from being unintentionally shared with users who should not have access to the data.
For instance, we can create private Persisted Queries that help manage the application, such as retrieving data to create reports with our metrics.
Declare variables inside the query, and declare their values on the variables input at the bottom
Click on the "Run" button to execute the query
Obtain the results on the input on the right side
Click on "Docs" to inspect the schema information
The Explorer (shown only if module GraphiQL Explorer is enabled) allows to click on the fields, and these are automatically added to the query
From the dropdown, select the schema configuration that applies to the persisted query, or one of these options:
"Default": the schema configuration is the one selected on the plugin's Settings
"None": the persisted query will be unconstrained
"Inherit from parent": Use the same schema configuration as the parent persisted query. This option is available when module API Hierarchy is enabled, and the persisted query has a parent query (selected on the Document settings)
Customize the behavior of the persisted query:
Enabled?: If the persisted query is enabled. It's useful to disable a persisted query it's a parent query in an API hierarchy
Accept variables as URL params?: Allow URL params to override the values for variables defined in the GraphiQL client
Inherit query from ancestor(s)?: Use the same query as the parent persisted query. This option is available when module API Hierarchy is enabled, and the persisted query has a parent query (selected on the Document settings)
These are the inputs in the Document settings:
The endpoint under which the persisted query will be available
Can categorize the persisted query. Eg: mobile, app, etc
Provide a description for the persisted query. This input is available when module Excerpt as Description is enabled
Select a parent persisted query. This input is available when module API Hierarchy is enabled