Archive API docs
    Jump to

    Narrow by kind with a prefix — q: queries, m: mutations, t: types, g: guides, f: fields and arguments.

    Jump to examples ↓
    Mutation

    addItemToCollections

    Add an item to one or more Collections.

    Arguments

    autoCreate Boolean default false
    Automatically create collections by name if they do not exist. A name to create follows the createCollection name rules and is stored in that trimmed, NFC-normalized form; a blank or invisible-only name, one over 255 characters, or one holding control or bidirectional text characters fails the whole call with a userError on collectionNames and creates nothing.
    collectionIds [ID!] default []
    IDs of existing collections, as returned by the collections query for this workspace. Several id forms are accepted depending on how the workspace stores Collections. An id from another workspace, or one this workspace cannot write through this API, rejects the WHOLE call with a userErrors entry naming the offending id under collectionIds.
    collectionNames [String!] default []
    Names of collections to add the item to. A name matches the Collection stored under exactly that name, else the one stored under the name trimmed of surrounding whitespace and invisible characters and NFC-normalized; matching is case-sensitive. Without autoCreate, a name that matches nothing is skipped when another collectionNames or collectionIds entry resolves (no userError), and only when nothing resolves does the call fail with "No valid collections found".
    itemId ID! required
    ID of the item to add to collections.

    Returns

    Object, input and enum types open in place — use + to reveal their fields. A type that is already open above the row stops at a ↻ circular marker, and anything nested past the depth limit links out to its own page instead.

    item Item
    The updated item.
    userErrors [UserError!]!
    List of errors that occurred.