Tag
I tag sono limitati per DataType (images, audio, video, files, contacts, SMS, calls, notes). Gestisci qui i tag e le relative assegnazioni agli elementi.
Definizioni di 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!
}Operazioni
tags
Elenca tutti i tag per il tipo di dati indicato.
query GetTags($type: DataType!) {
tags(type: $type) { id name count }
}tagRelations
Verifica le assegnazioni tag per un insieme di chiavi elemento (es. ID media, ID nota) in un tipo di dati.
query GetTagRelations($type: DataType!, $keys: [String!]!) {
tagRelations(type: $type, keys: $keys) {
tagId
key
}
}createTag
Crea un nuovo tag limitato a un tipo di dati.
mutation CreateTag($type: DataType!, $name: String!) {
createTag(type: $type, name: $name) { id name count }
}updateTag
Rinomina un tag esistente.
mutation UpdateTag($id: ID!, $name: String!) {
updateTag(id: $id, name: $name) { id name }
}deleteTag
Elimina un tag e lo rimuove da tutti gli elementi taggati.
mutation DeleteTag($id: ID!) {
deleteTag(id: $id)
}addToTags
Aggiunge tutti gli elementi corrispondenti a una query a uno o più tag.
mutation AddToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
addToTags(type: $type, tagIds: $tagIds, query: $query)
}updateTagRelations
Aggiunge e/o rimuove tag su un singolo elemento in una sola chiamata.
mutation UpdateTagRelations($type: DataType!, $item: TagRelationStub!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
updateTagRelations(type: $type, item: $item, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}removeFromTags
Rimuove tutti gli elementi corrispondenti a una query da uno o più tag.
mutation RemoveFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}