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": "ab72dc98dfc97ec5eb1f2eb4",
"id": 2449623063174,
"created": 1728528948125,
"modified": 1745235116416,
"published": {
"status": true,
"date": 1733790940294
},
"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": "4ab4ae75b877c6f998972c8e",
"id": 4073514983432,
"title": "example",
"ext": "example",
"url": "https://example.com",
"size": 42,
"width": 42,
"height": 42,
"caption": "example",
"mime": "example",
"alt": "example",
"created": 1764915007546
},
"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!]!