API संदर्भ

सूचनाएँ

सुविधा समर्थन के लिए app.capabilities और प्राधिकरण के लिए app.access तथा होस्ट अनुमतियाँ जाँचें। उदाहरण कृत्रिम मान उपयोग करते हैं; कॉल करने से पहले पथ, ID, इनपुट और फ़िल्टर बदलें।

प्रकार परिभाषाएँ

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

ऑपरेशन

subscription

notificationCreated

नई देखी गई डिवाइस सूचना लें।

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

notificationUpdated

अपडेट की गई डिवाइस सूचना लें।

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

notificationDeleted

हटाई गई डिवाइस सूचना लें।

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

notificationRefreshed

वर्तमान डिवाइस-सूचना सूची ताज़ा करने का संकेत लें।

graphql
subscription notificationRefreshed {
  notificationRefreshed
}
mutation

deleteNotifications

निर्दिष्ट सूचना रिकॉर्ड मिटाएँ और प्रभावित संख्या बताएँ।

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

replyNotification

इनलाइन-उत्तर कार्रवाई से सूचना का उत्तर भेजें। actionIndex उत्तर दे सकने वाली कार्रवाइयों में 0 से शुरू होता है।

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

क्वेरी से मेल खाती सहेजी सूचनाएँ गिनें।

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

notifications

क्वेरी से मेल खाती सहेजी डिवाइस सूचनाओं का एक पृष्ठ पढ़ें।

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