Przejdź do głównej zawartości

Interface: UseStorefrontQueryOptions<TVariables>

Type Parameters

TVariables

TVariables = Record<string, unknown>

Properties

cache?

optional cache?: CacheOptions

Cache strategy forwarded to client.query. Relevant only on the public catalog surface (it influences the edge-cacheable GET vs POST routing); ignored by the customer-account surface, which is always sent fresh.


client?

optional client?: StorefrontClient

Client to read from. Defaults to the nearest public client from context (StorefrontClientProvider). Pass your own to read from a different surface — or to use the hook without a provider in the tree.


enabled?

optional enabled?: boolean

When false, no request is sent and the hook stays pending/idle. Defaults to true.


resetKey?

optional resetKey?: string | number

Extra key axis. When it changes, the surfaced data resets and the query refetches — use it to isolate per-identity reads (e.g. the signed-in customer id) so a previous account's data is never shown after a switch.


variables?

optional variables?: TVariables

Operation variables. A value change re-keys the hook (reset + refetch).