Tags
Thẻ được phạm vi hóa theo DataType (images, audio, video, files, contacts, SMS, calls, notes). Quản lý thẻ và phân công mục tại đây.
Định nghĩa kiểu
type Tag {
id: ID!
name: String!
count: Int! # total items carrying this tag
}
type TagRelation {
tagId: ID!
key: String! # id of the tagged item
}
# DataType scopes which content type a tag belongs to
enum DataType {
AUDIO VIDEO IMAGE SMS CONTACT NOTE FEED_ENTRY CALL DOC PACKAGE FILE
}
# Identifies a single item by its ID key, used in updateTagRelations
input TagRelationStub {
key: String!
}Thao tác
tags
Liệt kê tất cả thẻ cho kiểu dữ liệu đã cho.
query GetTags($type: DataType!) {
tags(type: $type) { id name count }
}tagRelations
Tra cứu phân công thẻ cho một tập hợp khóa mục (ví dụ media IDs, note IDs) trong một kiểu dữ liệu.
query GetTagRelations($type: DataType!, $keys: [String!]!) {
tagRelations(type: $type, keys: $keys) {
tagId
key
}
}createTag
Tạo một thẻ mới được phạm vi hóa theo một kiểu dữ liệu.
mutation CreateTag($type: DataType!, $name: String!) {
createTag(type: $type, name: $name) { id name count }
}updateTag
Đổi tên một thẻ hiện có.
mutation UpdateTag($id: ID!, $name: String!) {
updateTag(id: $id, name: $name) { id name }
}deleteTag
Xóa một thẻ và loại bỏ nó khỏi tất cả các mục được gắn thẻ.
mutation DeleteTag($id: ID!) {
deleteTag(id: $id)
}addToTags
Thêm tất cả các mục khớp với một query vào một hoặc nhiều thẻ.
mutation AddToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
addToTags(type: $type, tagIds: $tagIds, query: $query)
}updateTagRelations
Thêm và/hoặc xóa thẻ trên một mục duy nhất trong một lần gọi.
mutation UpdateTagRelations($type: DataType!, $item: TagRelationStub!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
updateTagRelations(type: $type, item: $item, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}removeFromTags
Xóa tất cả các mục khớp với một query khỏi một hoặc nhiều thẻ.
mutation RemoveFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}