Pokko
Search…
Querying content
How to extract published content out of Pokko

API Keys

To query content you will need to set up an API key. This can be done from the project settings screen.
Click the cog here to access the project settings
Click the "New token" button under the "API Tokens" section.
Click the "GraphQL Playground" button to open a website where you can start querying content.
In this UI you will need to specify the token that was generated.
Click "HTTP Headers" down the bottom and enter the following
1
{
2
"X-Token": "<< API TOKEN >>"
3
}
Copied!
With this in place, you can start querying your content.

Queries

There are two ways of querying your content.
  1. 1.
    Querying individual pieces of content - entry()
  2. 2.
    Querying a list of content of a specific type - entries { }
The GraphQL root query has two queries to access your content - entry and entries
More information about what queries are available can be found in the GraphQL Playground.

Individual entries

With entry you can query individual entries by ID or by Path.
1
query GetBlogPost {
2
entry(id: "...") {
3
... on IBlogPost {
4
id
5
# additional fields here
6
}
7
}
8
}
Copied!

Multiple entries

With entries you can query multiple entries of a type.
1
query ListBlogPosts {
2
entries {
3
allBlogPost(skip: 0, take: 10, filter: { ... }) {
4
nodes {
5
id
6
# additional fields here
7
}
8
totalCount
9
}
10
}
11
}
Copied!

Caching

A layer of caching is in place for the content querying endpoints. Content will be cached indefinitely until a change to your content is made. When a Publish occurs on an entry the cache will be cleared.
The more complex a GraphQL query is, the longer the initial request will take. Subsequent cached queries will be drastically faster.
post
https://<region>.pokko.io
/:project/:environment/graphql
GraphQL endpoint
Last modified 4mo ago