API-Referenz

Benachrichtigungen

Funktionsunterstützung über app.capabilities prüfen, Autorisierung über app.access und Host-Berechtigungen. Die Beispiele verwenden synthetische Werte; vor dem Aufruf Pfade, IDs, Eingaben und Filter ersetzen.

Typdefinitionen

graphql
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!]!
}

Operationen

subscription

notificationCreated

Empfängt eine neu beobachtete Gerätebenachrichtigung.

graphql
subscription notificationCreated {
  notificationCreated { id onlyOnce isClearable appId appName postedAt silent title }
}
subscription

notificationUpdated

Empfängt eine aktualisierte Gerätebenachrichtigung.

graphql
subscription notificationUpdated {
  notificationUpdated { id onlyOnce isClearable appId appName postedAt silent title }
}
subscription

notificationDeleted

Empfängt eine entfernte Gerätebenachrichtigung.

graphql
subscription notificationDeleted {
  notificationDeleted { id onlyOnce isClearable appId appName postedAt silent title }
}
subscription

notificationRefreshed

Empfängt ein Signal zum Aktualisieren der aktuellen Gerätebenachrichtigungsliste.

graphql
subscription notificationRefreshed {
  notificationRefreshed
}
mutation

deleteNotifications

Löscht die angegebenen Benachrichtigungsdatensätze und meldet deren Anzahl.

graphql
mutation deleteNotifications($ids: [ID!]!) {
  deleteNotifications(ids: $ids) { affectedCount }
}
mutation

replyNotification

Antwortet auf eine Benachrichtigung über eine Inline-Antwortaktion. actionIndex ist der bei 0 beginnende Index unter den antwortfähigen Aktionen.

graphql
# `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)
}
query

notificationCount

Zählt gespeicherte Benachrichtigungen, die der Abfrage entsprechen.

graphql
query notificationCount($query: String!) {
  notificationCount(query: $query)
}
query

notifications

Liest eine Seite gespeicherter Gerätebenachrichtigungen, die der Abfrage entsprechen.

graphql
query notifications($query: String!, $offset: Int!, $limit: Int!) {
  notifications(query: $query, offset: $offset, limit: $limit) { id onlyOnce isClearable appId appName postedAt silent title }
}