Creates a replace operation with the provided items and reference item.
replace
The items to replace.
The reference item to replace.
A ReplaceOp operation.
This will be converted to an insert/replace patch when submitted to the API https://www.sanity.io/docs/http-patches#GnVSwcPa
insert
const replaceItem3WithFoo = replace('foo', 3)const replaceItem3WithFooAndBar = replace(['foo', 'bar'], 3)const replaceObject = replace({name: 'bar'}, {_key: 'xyz'}) Copy
const replaceItem3WithFoo = replace('foo', 3)const replaceItem3WithFooAndBar = replace(['foo', 'bar'], 3)const replaceObject = replace({name: 'bar'}, {_key: 'xyz'})
Creates a
replace
operation with the provided items and reference item.