सूचनाएँ
सुविधा समर्थन के लिए app.capabilities और प्राधिकरण के लिए app.access तथा होस्ट अनुमतियाँ जाँचें। उदाहरण कृत्रिम मान उपयोग करते हैं; कॉल करने से पहले पथ, ID, इनपुट और फ़िल्टर बदलें।
प्रकार परिभाषाएँ
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!]!
}ऑपरेशन
notificationCreated
नई देखी गई डिवाइस सूचना लें।
subscription notificationCreated {
notificationCreated { id onlyOnce isClearable appId appName postedAt silent title }
}notificationUpdated
अपडेट की गई डिवाइस सूचना लें।
subscription notificationUpdated {
notificationUpdated { id onlyOnce isClearable appId appName postedAt silent title }
}notificationDeleted
हटाई गई डिवाइस सूचना लें।
subscription notificationDeleted {
notificationDeleted { id onlyOnce isClearable appId appName postedAt silent title }
}notificationRefreshed
वर्तमान डिवाइस-सूचना सूची ताज़ा करने का संकेत लें।
subscription notificationRefreshed {
notificationRefreshed
}deleteNotifications
निर्दिष्ट सूचना रिकॉर्ड मिटाएँ और प्रभावित संख्या बताएँ।
mutation deleteNotifications($ids: [ID!]!) {
deleteNotifications(ids: $ids) { affectedCount }
}replyNotification
इनलाइन-उत्तर कार्रवाई से सूचना का उत्तर भेजें। actionIndex उत्तर दे सकने वाली कार्रवाइयों में 0 से शुरू होता है।
# `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
क्वेरी से मेल खाती सहेजी सूचनाएँ गिनें।
query notificationCount($query: String!) {
notificationCount(query: $query)
}notifications
क्वेरी से मेल खाती सहेजी डिवाइस सूचनाओं का एक पृष्ठ पढ़ें।
query notifications($query: String!, $offset: Int!, $limit: Int!) {
notifications(query: $query, offset: $offset, limit: $limit) { id onlyOnce isClearable appId appName postedAt silent title }
}