API リファレンス
タグ
機能の対応状況は app.capabilities、認可は app.access とホストの権限で確認してください。例は合成値を使用しています。呼び出す前にパス、ID、入力、フィルターを置き換えてください。
型定義
graphql
type Mutation {
addToTags(type: DataType!, tagIds: [ID!]!, query: String!): Boolean!
createTag(type: DataType!, name: String!): Tag!
deleteTag(id: ID!): Boolean!
removeFromTags(type: DataType!, tagIds: [ID!]!, query: String!): Boolean!
updateTag(id: ID!, name: String!): Tag!
updateTagRelations(type: DataType!, keys: [String!]!, addTagIds: [ID!]!, removeTagIds: [ID!]!): Boolean!
}
type Query {
tagKeys(id: ID!): [String!]!
tagRelations(type: DataType!, keys: [String!]!): [TagRelation!]!
tags(type: DataType!): [Tag!]!
}
enum DataType {
DEFAULT
AUDIO
VIDEO
IMAGE
SMS
CONTACT
NOTE
FEED_ENTRY
CALL
PACKAGE
FILE
APP_FILE
DOC
}
type Tag {
id: ID!
name: String!
type: DataType!
count: Int!
}
type TagRelation {
tagId: ID!
key: String!
}操作
mutation
createTag
データ型をスコープとする新しいタグを作成します。
graphql
mutation createTag($type: DataType!, $name: String!) {
createTag(type: $type, name: $name) { id name type count }
}mutation
deleteTag
タグを削除し、すべてのタグ付き項目から取り除きます。
graphql
mutation deleteTag($id: ID!) {
deleteTag(id: $id)
}mutation
updateTag
既存のタグの名前を変更します。
graphql
mutation updateTag($id: ID!, $name: String!) {
updateTag(id: $id, name: $name) { id name type count }
}mutation
updateTagRelations
1 回の呼び出しで、単一項目のタグを追加または削除、あるいはその両方を行います。
graphql
mutation updateTagRelations($type: DataType!, $keys: [String!]!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
updateTagRelations(type: $type, keys: $keys, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}query
tagKeys
指定したタグに関連付けられた項目キーを一覧表示します。
graphql
query tagKeys($id: ID!) {
tagKeys(id: $id)
}query
tagRelations
1 つのデータ型内の項目キー群(例:メディア ID、メモ ID)について、タグの割り当てを調べます。
graphql
query tagRelations($type: DataType!, $keys: [String!]!) {
tagRelations(type: $type, keys: $keys) { tagId key }
}