In addition to the single endpoint, Gato GraphQL also supports custom endpoints, to retrieve and post data for a custom schema (containing only a subset of the available types) and user validation rules, as to deal with the needs from different users and applications.
We can create as many custom endpoints as needed.
For instance, we can create a custom endpoint for:
Some specific client or user, under /graphql/my-client/
A group of users with more access to features (such as PRO users), under /graphql/pro-users/
Provide data to our mobile app, under /graphql/mobile-app/
Give access to some 3rd-party API, under /graphql/external-api/
Executing the custom endpoint in an application permalink
Click on button "Add New GraphQL endpoint" to open the WordPress editor:
Give it a title, make sure the permalink is the desired one, select the schema configuration, and adjust the options. When ready, click on the Publish button, and the custom endpoint is created, using the configured permalink as endpoint URL.
Links to the endpoint (and source and clients) are shown on the "Custom Endpoint Overview" sidebar panel:
By setting the status of the Custom Endpoint 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 Custom Endpoints that help manage the application, such as retrieving data to create reports with our metrics.
From the dropdown, select the schema configuration that applies to the custom endpoint, or one of these options:
"Default": the schema configuration is the one selected on the plugin's Settings
"None": the custom endpoint will be unconstrained
"Inherit from parent": Use the same schema configuration as the parent custom endpoint. This option is available when module "API Hierarchy" is enabled, and the custom endpoint has a parent query (selected on the Document settings)
Customize the behavior of the custom endpoint:
Enabled?: If the custom endpoint is enabled. It's useful to disable a custom endpoint it's a parent query in an API hierarchy
Expose GraphiQL client?: Enable/disable attaching a GraphiQL client to the endpoint, accessible under ?view=graphiql
Expose the Interactive Schema client?: Enable/disable attaching an Interactive schema client to the endpoint, accessible under ?view=schema
Inherit query from ancestor(s)?: Use the same query as the parent custom endpoint. This option is available when module "API Hierarchy" is enabled, and the custom endpoint has a parent query (selected on the Document settings)
These are the inputs in the Document settings:
The endpoint under which the custom endpoint will be available
Can categorize the custom endpoint. Eg: mobile, app, etc
Provide a description for the custom endpoint. This input is available when module "Excerpt as Description" is enabled
Select a parent custom endpoint. This input is available when module "API Hierarchy" is enabled