Etiquetas
Las etiquetas se limitan por DataType (images, audio, video, files, contacts, SMS, calls, notes). Gestiona aquí las etiquetas y sus asignaciones a elementos.
Definiciones de tipos
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!
}Operaciones
tags
Lista todas las etiquetas del tipo de datos indicado.
query GetTags($type: DataType!) {
tags(type: $type) { id name count }
}tagRelations
Busca las asignaciones de etiquetas para un conjunto de claves de elementos (p. ej. IDs multimedia, IDs de notas) dentro de un tipo de datos.
query GetTagRelations($type: DataType!, $keys: [String!]!) {
tagRelations(type: $type, keys: $keys) {
tagId
key
}
}createTag
Crea una etiqueta nueva limitada a un tipo de datos.
mutation CreateTag($type: DataType!, $name: String!) {
createTag(type: $type, name: $name) { id name count }
}updateTag
Renombra una etiqueta existente.
mutation UpdateTag($id: ID!, $name: String!) {
updateTag(id: $id, name: $name) { id name }
}deleteTag
Elimina una etiqueta y la quita de todos los elementos etiquetados.
mutation DeleteTag($id: ID!) {
deleteTag(id: $id)
}addToTags
Añade todos los elementos que coinciden con una consulta a una o más etiquetas.
mutation AddToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
addToTags(type: $type, tagIds: $tagIds, query: $query)
}updateTagRelations
Añade y/o elimina etiquetas de un único elemento en una sola llamada.
mutation UpdateTagRelations($type: DataType!, $item: TagRelationStub!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
updateTagRelations(type: $type, item: $item, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}removeFromTags
Quita todos los elementos que coinciden con una consulta de una o más etiquetas.
mutation RemoveFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}