Skip to main content

articles Query

Description

Retrieves a list of articles with optional filtering and sorting.

query articles(
$tags: [String]
$type: String
$sortBy: String
$sortOrder: Int
$limit: Int
) {
articles(
tags: $tags
type: $type
sortBy: $sortBy
sortOrder: $sortOrder
limit: $limit
) {
_id
id
created
modified
published {
status
date
}
url
seo {
index
description
slug
title
}
private
content {
text
html
editor
}
homepage
thumbnail {
_id
id
title
ext
url
size
width
height
caption
mime
alt
created
}
title
type
tags
handle
}
}

Variables

{
"tags": [
"tags"
],
"type": "type",
"sortBy": "sortBy",
"sortOrder": 42,
"limit": 20
}

Response

{
"articles": [
{
"_id": "c0cc7a9113d93c83073b309b",
"id": 6934526685337,
"created": 1719124486813,
"modified": 1735919481045,
"published": {
"status": true,
"date": 1758724917559
},
"url": "https://example.com",
"seo": {
"index": true,
"description": "example",
"slug": "example",
"title": "example"
},
"private": true,
"content": {
"text": "example",
"html": "example",
"editor": {}
},
"homepage": true,
"thumbnail": {
"_id": "dae9f4bea70ba469cde0e44c",
"id": 7229002988128,
"title": "example",
"ext": "example",
"url": "https://example.com",
"size": 42,
"width": 42,
"height": 42,
"caption": "example",
"mime": "example",
"alt": "example",
"created": 1754001801722
},
"title": "example",
"type": "post",
"tags": [
"example"
],
"handle": "example"
}
]
}

Arguments

NameTypeDescription
tags[String]Filter by article tags.
typeStringFilter by article type.
sortByStringField name to sort by.
sortOrderIntSort order (1 for ascending, -1 for descending).
limitIntMaximum number of articles to return.

Returns

[Article!]!