Tags
Tags têm escopo por DataType (imagens, áudio, vídeo, arquivos, contatos, SMS, chamadas, notas). Gerencie tags e atribuições de itens aqui.
Definições de Tipo
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!
}Operações
tags
Liste todas as tags para o tipo de dados fornecido.
query GetTags($type: DataType!) {
tags(type: $type) { id name count }
}tagRelations
Consulte atribuições de tag para um conjunto de chaves de item (ex. IDs de mídia, IDs de nota) em um tipo de dados.
query GetTagRelations($type: DataType!, $keys: [String!]!) {
tagRelations(type: $type, keys: $keys) {
tagId
key
}
}createTag
Crie uma nova tag com escopo para um tipo de dados.
mutation CreateTag($type: DataType!, $name: String!) {
createTag(type: $type, name: $name) { id name count }
}updateTag
Renomeie uma tag existente.
mutation UpdateTag($id: ID!, $name: String!) {
updateTag(id: $id, name: $name) { id name }
}deleteTag
Exclua uma tag e a remova de todos os itens marcados.
mutation DeleteTag($id: ID!) {
deleteTag(id: $id)
}addToTags
Adicione todos os itens correspondentes a uma consulta a uma ou mais tags.
mutation AddToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
addToTags(type: $type, tagIds: $tagIds, query: $query)
}updateTagRelations
Adicione e/ou remova tags de um único item em uma única chamada.
mutation UpdateTagRelations($type: DataType!, $item: TagRelationStub!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
updateTagRelations(type: $type, item: $item, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}removeFromTags
Remova todos os itens correspondentes a uma consulta de uma ou mais tags.
mutation RemoveFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}