Notifications
Check app.capabilities for feature support and app.access plus host permissions for authorization. Examples use synthetic values; replace paths, IDs, inputs and filters before calling.
Type Definitions
type Subscription {
notificationCreated: Notification!
notificationUpdated: Notification!
notificationDeleted: Notification!
notificationRefreshed: Boolean!
}
type Mutation {
deleteNotifications(ids: [ID!]!): ActionResult!
replyNotification(id: ID!, actionIndex: Int!, text: String!): Boolean!
}
type Query {
notificationCount(query: String!): Int!
notifications(query: String!, offset: Int!, limit: Int!): [Notification!]!
}
type ActionResult {
affectedCount: Int!
}
scalar Instant
type Notification {
id: ID!
onlyOnce: Boolean!
isClearable: Boolean!
appId: ID!
appName: String!
postedAt: Instant!
silent: Boolean!
title: String!
body: String!
actions: [String!]!
replyActions: [String!]!
}Operations
notificationCreated
Receive a newly observed device notification.
subscription notificationCreated {
notificationCreated { id onlyOnce isClearable appId appName postedAt silent title }
}notificationUpdated
Receive an updated device notification.
subscription notificationUpdated {
notificationUpdated { id onlyOnce isClearable appId appName postedAt silent title }
}notificationDeleted
Receive a removed device notification.
subscription notificationDeleted {
notificationDeleted { id onlyOnce isClearable appId appName postedAt silent title }
}notificationRefreshed
Receive a signal to refresh the current device-notification list.
subscription notificationRefreshed {
notificationRefreshed
}deleteNotifications
Delete the specified notification records and report the affected count.
mutation deleteNotifications($ids: [ID!]!) {
deleteNotifications(ids: $ids) { affectedCount }
}replyNotification
Send a reply to a notification via an inline-reply action. actionIndex is 0-based among reply-capable actions.
# `actionIndex` indexes [`Notification::reply_actions`], the
# reply-capable subset — not the plain action list.
mutation replyNotification($id: ID!, $actionIndex: Int!, $text: String!) {
replyNotification(id: $id, actionIndex: $actionIndex, text: $text)
}notificationCount
Count stored notifications matching the query.
query notificationCount($query: String!) {
notificationCount(query: $query)
}notifications
Read a page of stored device notifications matching the query.
query notifications($query: String!, $offset: Int!, $limit: Int!) {
notifications(query: $query, offset: $offset, limit: $limit) { id onlyOnce isClearable appId appName postedAt silent title }
}