Set up a listener that will be notified when mutations occur on documents matching the provided query/filter.
GROQ-filter to listen to changes for
Optional
params: ListenParamsOptional query parameters
Set up a listener that will be notified when mutations occur on documents matching the provided query/filter.
GROQ-filter to listen to changes for
Optional
params: ListenParamsOptional query parameters
Optional
options: ListenOptionsOptional listener options
Perform action operations against the configured dataset
Action operation(s) to execute
Optional
options: BaseActionOptionsAction options
Clone the client - returns a new instance
Returns the current client configuration
Reconfigure the client. Note that this mutates the current client.
Optional
newConfig: Partial<ClientConfig>Create a document. Requires a _type
property. If no _id
is provided, it will be generated by the database.
Returns an observable that resolves to the created document.
Document to create
Mutation options
Create a document. Requires a _type
property. If no _id
is provided, it will be generated by the database.
Returns an observable that resolves to an array containing the created document.
Document to create
Mutation options
Create a document. Requires a _type
property. If no _id
is provided, it will be generated by the database.
Returns an observable that resolves to a mutation result object containing the ID of the created document.
Document to create
Mutation options
Create a document. Requires a _type
property. If no _id
is provided, it will be generated by the database.
Returns an observable that resolves to a mutation result object containing the ID of the created document.
Document to create
Mutation options
Create a document. Requires a _type
property. If no _id
is provided, it will be generated by the database.
Returns an observable that resolves to the created document.
Document to create
Optional
options: BaseMutationOptionsMutation options
Create a document if no document with the same ID already exists. Returns an observable that resolves to the created document.
Document to create
Mutation options
Create a document if no document with the same ID already exists. Returns an observable that resolves to an array containing the created document.
Document to create
Mutation options
Create a document if no document with the same ID already exists. Returns an observable that resolves to a mutation result object containing the ID of the created document.
Document to create
Mutation options
Create a document if no document with the same ID already exists. Returns an observable that resolves to a mutation result object containing the ID of the created document.
Document to create
Mutation options
Create a document if no document with the same ID already exists. Returns an observable that resolves to the created document.
Document to create
Optional
options: BaseMutationOptionsMutation options
Create a document if it does not exist, or replace a document with the same document ID Returns an observable that resolves to the created document.
Document to either create or replace
Mutation options
Create a document if it does not exist, or replace a document with the same document ID Returns an observable that resolves to an array containing the created document.
Document to either create or replace
Mutation options
Create a document if it does not exist, or replace a document with the same document ID Returns an observable that resolves to a mutation result object containing the ID of the created document.
Document to either create or replace
Mutation options
Create a document if it does not exist, or replace a document with the same document ID Returns an observable that resolves to a mutation result object containing the created document ID.
Document to either create or replace
Mutation options
Create a document if it does not exist, or replace a document with the same document ID Returns an observable that resolves to the created document.
Document to either create or replace
Optional
options: BaseMutationOptionsMutation options
Deletes a document with the given document ID. Returns an observable that resolves to the deleted document.
Document ID to delete
Options for the mutation
Deletes a document with the given document ID. Returns an observable that resolves to an array containing the deleted document.
Document ID to delete
Options for the mutation
Deletes a document with the given document ID. Returns an observable that resolves to a mutation result object containing the deleted document ID.
Document ID to delete
Options for the mutation
Deletes a document with the given document ID. Returns an observable that resolves to a mutation result object containing the deleted document ID.
Document ID to delete
Options for the mutation
Deletes a document with the given document ID. Returns an observable that resolves to the deleted document.
Document ID to delete
Optional
options: BaseMutationOptionsOptions for the mutation
Deletes one or more documents matching the given query or document ID. Returns an observable that resolves to first deleted document.
An object with either an id
or query
key defining what to delete
Options for the mutation
Deletes one or more documents matching the given query or document ID. Returns an observable that resolves to an array containing the deleted documents.
An object with either an id
or query
key defining what to delete
Options for the mutation
Deletes one or more documents matching the given query or document ID. Returns an observable that resolves to a mutation result object containing the ID of the first deleted document.
An object with either an id
or query
key defining what to delete
Options for the mutation
Deletes one or more documents matching the given query or document ID. Returns an observable that resolves to a mutation result object containing the document IDs that were deleted.
An object with either an id
or query
key defining what to delete
Options for the mutation
Deletes one or more documents matching the given query or document ID. Returns an observable that resolves to first deleted document.
An object with either an id
or query
key defining what to delete
Optional
options: BaseMutationOptionsOptions for the mutation
Perform a GROQ-query against the configured dataset.
GROQ-query to perform
Optional
params: QueryWithoutParams | QPerform a GROQ-query against the configured dataset.
GROQ-query to perform
Optional query parameters
Optional
options: FilteredResponseQueryOptionsOptional request options
Perform a GROQ-query against the configured dataset.
GROQ-query to perform
Optional query parameters
Request options
Perform a GROQ-query against the configured dataset.
GROQ-query to perform
Optional query parameters
Request options
Get a Sanity API URL for the data operation and path provided
Data operation (eg query
, mutate
, listen
or similar)
Optional
path: stringPath to append after the operation
Fetch a single document with the given ID.
Document ID to fetch
Optional
options: { tag?: string }Request options
Fetch multiple documents in one request.
Should be used sparingly - performing a query is usually a better option.
The order/position of documents is preserved based on the original array of IDs.
If any of the documents are missing, they will be replaced by a null
entry in the returned array
Document IDs to fetch
Optional
options: { tag?: string }Request options
Get a Sanity API URL for the URI provided
URI/path to build URL for
Optional
canUseCdn: booleanWhether or not to allow using the API CDN for this route
Perform mutation operations against the configured dataset Returns an observable that resolves to the first mutated document.
Mutation operations to execute
Mutation options
Perform mutation operations against the configured dataset. Returns an observable that resolves to an array of the mutated documents.
Mutation operations to execute
Mutation options
Perform mutation operations against the configured dataset Returns an observable that resolves to a mutation result object containing the document ID of the first mutated document.
Mutation operations to execute
Mutation options
Perform mutation operations against the configured dataset Returns an observable that resolves to a mutation result object containing the mutated document IDs.
Mutation operations to execute
Mutation options
Perform mutation operations against the configured dataset Returns an observable that resolves to the first mutated document.
Mutation operations to execute
Optional
options: BaseMutationOptionsMutation options
Create a new buildable patch of operations to perform
Document ID to patch
Optional
operations: PatchOperationsOptional object of patch operations to initialize the patch instance with
Patch instance - call .commit()
to perform the operations defined
Create a new buildable patch of operations to perform
Array of document IDs to patch
Optional
operations: PatchOperationsOptional object of patch operations to initialize the patch instance with
Patch instance - call .commit()
to perform the operations defined
Create a new buildable patch of operations to perform
An object with query
and optional params
, defining which document(s) to patch
Optional
operations: PatchOperationsOptional object of patch operations to initialize the patch instance with
Patch instance - call .commit()
to perform the operations defined
Perform an HTTP request against the Sanity API
Request options
Clone the client with a new (partial) configuration.
Optional
newConfig: Partial<ClientConfig>New client configuration properties, shallowly merged with existing configuration
Instance properties