API 참조
Tags
태그는 DataType(images, audio, video, files, contacts, SMS, calls, notes)별로 범위가 지정됩니다. 여기서 태그와 항목 할당을 관리합니다.
타입 정의
bash
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!
}작업
query
tags
주어진 데이터 유형의 모든 태그를 나열합니다.
bash
query GetTags($type: DataType!) {
tags(type: $type) { id name count }
}query
tagRelations
하나의 데이터 유형 내의 항목 키 집합 (예: 미디어 ID, 메모 ID)에 대한 태그 할당을 조회합니다.
bash
query GetTagRelations($type: DataType!, $keys: [String!]!) {
tagRelations(type: $type, keys: $keys) {
tagId
key
}
}mutation
createTag
데이터 유형으로 범위가 지정된 새 태그를 만듭니다.
bash
mutation CreateTag($type: DataType!, $name: String!) {
createTag(type: $type, name: $name) { id name count }
}mutation
updateTag
기존 태그의 이름을 바꿉니다.
bash
mutation UpdateTag($id: ID!, $name: String!) {
updateTag(id: $id, name: $name) { id name }
}mutation
deleteTag
태그를 삭제하고 태그가 지정된 모든 항목에서 제거합니다.
bash
mutation DeleteTag($id: ID!) {
deleteTag(id: $id)
}mutation
addToTags
쿼리와 일치하는 모든 항목을 하나 이상의 태그에 추가합니다.
bash
mutation AddToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
addToTags(type: $type, tagIds: $tagIds, query: $query)
}mutation
updateTagRelations
단일 항목에 대한 태그 추가 및/또는 제거를 한 번의 호출로 수행합니다.
bash
mutation UpdateTagRelations($type: DataType!, $item: TagRelationStub!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
updateTagRelations(type: $type, item: $item, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}mutation
removeFromTags
쿼리와 일치하는 모든 항목을 하나 이상의 태그에서 제거합니다.
bash
mutation RemoveFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}