Resolves the result of a query without registering a lasting subscriber.
This function fetches the result of a GROQ query and returns a promise that resolves with the query result.
Unlike getQueryState, which registers subscribers to keep the query live and performs automatic cleanup,
resolveQuery does not track subscribers. This makes it ideal for use with React Suspense, where the returned
promise is thrown to delay rendering until the query result becomes available.
Once the promise resolves, it is expected that a real subscriber will be added via getQueryState to manage ongoing updates.
Additionally, an optional AbortSignal can be provided to cancel the query and immediately clear the associated state
if there are no active subscribers.
Resolves the result of a query without registering a lasting subscriber.
This function fetches the result of a GROQ query and returns a promise that resolves with the query result. Unlike
getQueryState
, which registers subscribers to keep the query live and performs automatic cleanup,resolveQuery
does not track subscribers. This makes it ideal for use with React Suspense, where the returned promise is thrown to delay rendering until the query result becomes available. Once the promise resolves, it is expected that a real subscriber will be added viagetQueryState
to manage ongoing updates.Additionally, an optional AbortSignal can be provided to cancel the query and immediately clear the associated state if there are no active subscribers.