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": "8218166b790d17a2dfab1a78",
"id": 1624106000386,
"created": 1754027137367,
"modified": 1713032003112,
"published": {
"status": true,
"date": 1739922575197
},
"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": "f71c88f0019c1983bc0a97fb",
"id": 1862501427183,
"title": "example",
"ext": "example",
"url": "https://example.com",
"size": 42,
"width": 42,
"height": 42,
"caption": "example",
"mime": "example",
"alt": "example",
"created": 1751361695698
},
"title": "example",
"type": "post",
"tags": [
"example"
],
"handle": "example"
}
]
}
Arguments
| Name | Type | Description |
|---|---|---|
tags | [String] | Filter by article tags. |
type | String | Filter by article type. |
sortBy | String | Field name to sort by. |
sortOrder | Int | Sort order (1 for ascending, -1 for descending). |
limit | Int | Maximum number of articles to return. |
Returns
[Article!]!