articles
Search and paginate through blog articles
Authentication
Public Access: Accessible with the public API key
Query Structure
{
articles(
first: Int
after: String
last: Int
before: String
query: String
author: Int
language: String
tags: [String]
sortKey: ArticleSortKey
reverse: Boolean
) {
# ArticleConnection fields
}
}Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
| first | Int | No | Returns the first n elements. |
| after | String | No | Returns elements after cursor. |
| last | Int | No | Returns the last n elements. |
| before | String | No | Returns elements before cursor. |
| query | String | No | Search query string to filter articles by content. |
| author | Int | No | Filter articles by author ID. |
| language | String | No | Filter articles by language code (e.g., “en”, “fi”). Must be an available store language. |
| tags | [String] | No | Filter articles by tags. |
| sortKey | ArticleSortKey | No | The key to sort articles by. |
| reverse | Boolean | No | Reverse the order of the underlying list. |
Return Type
Returns ArticleConnection, which contains a paginated collection of articles with cursor-based navigation and edges.
Example
query {
articles(first: 10, language: "en", sortKey: PUBLISHED_AT, reverse: true) {
edges {
node {
id
title
content
publishedAt
author {
name
}
}
cursor
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}