Add tags and metadata to any node to record your own state, such as "needs reply" or a due date. They stay on the node across requests and can be used in filters. You can only annotate nodes that have been observed. Mutations return null for unknown IDs.
Tags
A tag is a name such as urgent or billing/overdue. Use / to group tags.
mutation {
tag(ids: ["google-mail/users/{userId}/threads/{threadId}"], tags: ["needs-reply"]) {
id
tags
}
}| Mutation | Description |
|---|---|
tag(ids, tags) | Adds tags. Idempotent. |
untag(ids, tags) | Removes tags. Idempotent. |
setTags(id, tags) | Replaces all tags on one node. An empty list removes every tag. |
List tag names in use with the tags query, optionally by prefix:
{ tags(prefix: "billing/") }Find tagged nodes:
{
search(filter: { tags: { some: { eq: "needs-reply" } } }) {
nodes { __typename id }
}
}Metadata
Metadata is a set of key-value pairs. Values are strings, numbers, booleans, or arrays of those.
mutation {
setMetadata(
ids: ["google-mail/users/{userId}/threads/{threadId}"]
metadata: [
{ key: "dueDate", value: "2026-12-01T18:00:00Z" }
{ key: "priority", value: 2 }
]
) {
id
metadata
}
}| Mutation | Description |
|---|---|
setMetadata(ids, metadata) | Merges keys. Keys not given are kept. A null value removes the key. |
unsetMetadata(ids, keys) | Removes keys. |
Filter by type: string, number, boolean, date (ISO 8601 string values), or null for missing keys.
{
search(filter: { metadata: { some: { key: "dueDate", date: { lt: "P1D" } } } }) {
nodes { id metadata }
}
}Limits
| Limit | Value |
|---|---|
| IDs per mutation | 100 |
| Tags per node | 50 |
| Tag name | 128 characters, segments of [A-Za-z0-9._-] separated by / |
| Metadata keys per node | 50 |
| Metadata key | 64 characters, same character rules as tags |
| Metadata value | 4 KB as JSON, 2 KB for a string |