Alerts API Queries

Alerts API follows the same basic principles as other GraphQL APIs. There are two top-level nodes available: alerts and alert. It's possible to specify custom filters and sort order to retrieve a required subset of Alerts. Larger workflows could benefit from using pagination when the amount of Alerts returned doesn't fit into a single API response.

You may find all entity types defined in Alerts API Reference.

Examples

Find Alerts by Company ID:

query findAlerts($id: ID!) {
alerts(
where: {
company: {
id: { eq: $id }
}
}
) {
id
title
text
company {
id
displayName
}
}
}

Find Alerts by dataset and class

query findAlerts($dataset: String!, $class: String!) {
alerts(
where: {
dataset: { eq: $dataset },
class: { code: { eq: $class } }
}
) {
id
title
text
dataset
class {
code
label
}
}
}

Find Alerts for a particular date range

query findAlerts($from: String!, $to: String!) {
alerts(
where: {
publishedAt: {
gte: $from
lte: $to
}
}
) {
id
title
text
company {
displayName
}
publishedAt
}
}

Find a single Alert by its id

query findAlert($id: ID) {
alert(id: $id) {
id
title
text
}
}

‚Äč