Przejdź do głównej zawartości

inContext

Sets contextual hints on an operation — country, language, currency, buyer, preferredLocationId. Resolution priority: directive > request header > cookie > auto-detect > shop default.

directive @inContext(
buyer: BuyerInput
country: String
currency: String
language: String
preferredLocationId: ID
) on
| MUTATION
| QUERY
| SUBSCRIPTION

Arguments

inContext.buyer ● BuyerInput input

B2B / impersonation buyer context. Use for explicit auth (admin acting as customer) or company-location catalog scoping. Browser storefronts should prefer cookie / Bearer header.

inContext.country ● String scalar

ISO 3166-1 alpha-2 country code (e.g. "PL", "DE"). Drives the current country in localization. A value that is not a country code is ignored and the next priority layer is used.

inContext.currency ● String scalar

ISO 4217 currency code (e.g. "EUR", "USD"). Constrained to shop.supportedCurrencies — unsupported codes silently fall through. Typically inferred from country via Markets.

inContext.language ● String scalar

ISO 639-1 language code (e.g. "pl", "en"). Constrained to shop.supportedLanguages — unsupported codes silently fall through. Avoids Accept-Language ambiguity for SSR / Edge.

inContext.preferredLocationId ● ID scalar

Biases field resolvers (e.g. storeAvailability) toward this location. Must reference an active InventoryLocation in the current shop — invalid / inactive IDs are silently ignored by resolvers.