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": "3e5ece57ea8cc6639dc2b815",
"id": 2924600896255,
"created": 1759704737026,
"modified": 1719642069431,
"published": {
"status": true,
"date": 1737267137158
},
"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": "65dccf87abd03ae309368843",
"id": 5755051269440,
"title": "example",
"ext": "example",
"url": "https://example.com",
"size": 42,
"width": 42,
"height": 42,
"caption": "example",
"mime": "example",
"alt": "example",
"created": 1769876176079
},
"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!]!