Skip to main content
Back to changelog

Storefront API @inContext supports channelId

As of Storefront API version 2026-10, the @inContext directive accepts an optional channelId argument. Use channelId to apply a specific sales channel’s context to an entire query, including channel-specific product availability and pricing.

Example:

query Product($handle: String!, $channelId: ID!)
@inContext(channelId: $channelId) {
product(handle: $handle) {
id
title
availableForSale
priceRange {
minVariantPrice {
amount
currencyCode
}
}
}
}

Why it's changing

The existing @inContext directive lets you set buyer context such as country and language. With channelId, you can now:

  • Target a specific channel (for example, a marketplace or custom sales channel) when fetching products, prices, and availability.
  • Build channel-aware storefronts that show the correct catalog, pricing, and merchandising rules for each channel.
  • Reduce custom logic in your app by relying on the API to apply channel-specific behavior.

Requirements

Access requirement: You can only pass the ID of a channel created by the API client making the request.

Fallback behavior: If you omit channelId, the Storefront API uses the first channel owned by that API client. Pass channelId explicitly when your app owns multiple channels or needs to select a specific channel.

Learn more about contextual queries.

Was this page helpful?