Riferimento API

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

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!
}

Operazioni

query

tags

Elenca tutti i tag per il tipo di dati indicato.

bash
query GetTags($type: DataType!) {
  tags(type: $type) { id name count }
}
query

tagRelations

Verifica le assegnazioni tag per un insieme di chiavi elemento (es. ID media, ID nota) in un tipo di dati.

bash
query GetTagRelations($type: DataType!, $keys: [String!]!) {
  tagRelations(type: $type, keys: $keys) {
    tagId
    key
  }
}
mutation

createTag

Crea un nuovo tag limitato a un tipo di dati.

bash
mutation CreateTag($type: DataType!, $name: String!) {
  createTag(type: $type, name: $name) { id name count }
}
mutation

updateTag

Rinomina un tag esistente.

bash
mutation UpdateTag($id: ID!, $name: String!) {
  updateTag(id: $id, name: $name) { id name }
}
mutation

deleteTag

Elimina un tag e lo rimuove da tutti gli elementi taggati.

bash
mutation DeleteTag($id: ID!) {
  deleteTag(id: $id)
}
mutation

addToTags

Aggiunge tutti gli elementi corrispondenti a una query a uno o più tag.

bash
mutation AddToTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
  addToTags(type: $type, tagIds: $tagIds, query: $query)
}
mutation

updateTagRelations

Aggiunge e/o rimuove tag su un singolo elemento in una sola chiamata.

bash
mutation UpdateTagRelations($type: DataType!, $item: TagRelationStub!, $addTagIds: [ID!]!, $removeTagIds: [ID!]!) {
  updateTagRelations(type: $type, item: $item, addTagIds: $addTagIds, removeTagIds: $removeTagIds)
}
mutation

removeFromTags

Rimuove tutti gli elementi corrispondenti a una query da uno o più tag.

bash
mutation RemoveFromTags($type: DataType!, $tagIds: [ID!]!, $query: String!) {
  removeFromTags(type: $type, tagIds: $tagIds, query: $query)
}