...
It's possible to only allow specific users access to the GraphQL. This will require a valid User with an application key. You can enable authentication in the Setup by enabling the require_authentication option. You can authenticate yourself with GraphQL by adding the appkey
query parameter, including your application key, to your request.
Caching
In R44 caching was added the GraphQL API to improve the responsiveness of the API, especially for environments with a lot of content. GraphQL caches the results for the time set in the cache_expiration_time
option in the Setup. The cache does not automatically invalidate when the source has been changed. This means that changes will can take some time to propegate to the GraphQL API.
...
The inline documentation of the API can be requested via an Introspection query. This query always requires user authentication, so you have to provide a valid appkey
query parameter with the request. Clients like Postman or Insomnia can turn the result of this query into a readable schema. Using Insomnia, you can click the schema button and the select "Show documentation". This opens a popup containing the API's documentation. In Postman you can change the request type from HTTP to GraphQL and the schema should automatically load into the Query tab.
...
Below is a sample query where we are filtering and sorting on the Source property, which has a combined search index, and the Author property of the Blog modular template which has a unique search index.
...
theme | Eclipse |
---|
...
This sample query also shows how to return Modular Content fields. There are three places where Modular Content fields can be used, namely in Modular Content Items, in Page Metadata, and in Modular Elements.
Code Block | ||
---|---|---|
| ||
query FilteredItems { filteredItems( filter: { modularSource: { or: ["Autoweek"] } modularBlogAuthor: { not: "Steven" } } sort: [ {field: modularSource, order: desc}, {field: modularBlogAuthor, order: asc} ] first: 5 language: nl_NL ) { edges { node { id title ... on BlogModule { properties { author source } } ... on Page { pageMetaData { ... on ModularPageMetadata { blog { author source } } } content { elements { ... on ModularElement { blog { author source } } } } } } } } } |
...
XperienCentral GraphQL Documentation
...