C_announcements
With this query you can get announcements
Supported arguments
The following arguments are supported by C_announcements query:
Field | Type | Description |
---|---|---|
after | String | |
first | Int | |
unread | Boolean | Whether to return only unread announcements. Defaults to false |
Return type
The query returns theC_API_AnnouncementConnection
type.
This query is rate limited. Maximum 2 requests per 1 minute
Any announcements returned from this query are automatically marked as read
Example usage
Query
Get 3 latest unread announcements
{
announcements(first: 3, unread: true) {
edges {
node {
title
content
date
read
}
}
}
}
Result
{
"data": {
"C_announcements": {
"edges": [
{
"node": {
"title": "Very important message",
"content": "<p>This is a <b>VERY</b> important message</p>",
"date": "2023-08-03T00:00:00+00:00",
"read": false
}
}
]
}
}
}
Query
Get 3 latest announcements, no matter their unread status
{
announcements(first: 3) {
edges {
node {
title
content
date
read
}
}
}
}
Result
{
"data": {
"C_announcements": {
"edges": [
{
"node": {
"title": "Very important message",
"content": "<p>This is a <b>VERY</b> important message</p>",
"date": "2023-08-03T00:00:00+00:00",
"read": false
}
},
{
"node": {
"title": "Another notice",
"content": "<p>We wish to give you this notice once more</p>",
"date": "2023-08-02T00:00:00+00:00",
"read": true
}
},
{
"node": {
"title": "A notice",
"content": "<p>We wish to give you this notice</p>",
"date": "2023-06-09T00:00:00+00:00",
"read": true
}
}
]
}
}
}