Sanity Library Reference Docs
    Preparing search index...

    Function append

    • Creates an insert operation that appends the provided items.

      Type Parameters

      • const Items extends AnyArray<unknown>

      Parameters

      • items: Items | ArrayElement<Items>

        The items to append.

      Returns InsertOp<NormalizeReadOnlyArray<Items>, "after", -1>

      An insert operation for adding a value to the end of an array. https://www.sanity.io/docs/http-patches#Cw4vhD88

      const appendFoo = append('foo')
      const appendObject = append({name: 'foo'})
      const appendObjects = append([{name: 'foo'}, [{name: 'bar'}]])