Skip to content

GraphQL

As discussed in the introduction, there are two GraphQL endpoints made available for interacting with the system.

Management

The management GraphQL endpoint provides you with low-level access to all entities within a project. The schema is self-documented and trying to repeat that documentation here would be a fruitless task that would provide immediately outdated information.

Delivery

The delivery GraphQL endpoint, on the other hand, has a smaller foot-print that does require a bit more explaining.

There are three core facets to the content delivery endpoint -

  1. Synchronisation
  2. Taxonomy
  3. Entries

All queries have restrictions on how much data can be queried per request. This pagination limit will be defined in the following topics.

Synchronisation

The sync query allows you to take a snapshot of your project's data and store it elsewhere for quick reference. This endpoint can be called progressively to keep data store up to date.

The gatsby-source-honegumi package utilises this endpoint to provide you with an efficient development experience when building Gatsby websites on the platform.

The pagination limit on the sync query is 500 records per request.

Taxonomy

The taxonomy query will return a full list of all nodes defined in your tree structure.

The pagination limit on the taxonomy query is 100 records per request.

Entries

You can query each entry stored in your project by type using the entries query. Each model defined in your project with the usage type "Module" will have two query types made available under the entries query. One to query individual entries based on their ID, another to query all entries of that type accepting basic filtering and ordering parameters.

You can order by any "comparable" field - at present that is any field of type text;

Example

If you have a model with the alias "BlogPost", you can query the latest entries with the following query.

query {
  entries {
    allBlogPosts(skip: 0, take: 10, orderBy: DATE_DESC) {
      totalCount
      nodes {
        id
        title
      }
    }
  }
}