Shopify Function query Channel information

Topic summary

Goal: determine the buyer’s channel (sales channel/storefront origin) to vary discounts per storefront within a Shopify Function.

Current approach: searched the Shopify Functions GraphQL (cart/checkout validation schema) for a resource exposing channel context but couldn’t find one. Attempted to include channel and other shop data in the function’s schema types, which resulted in a console error (error screenshot attached).

Open questions: whether channel information is accessible to Shopify Functions at runtime, and if so, which GraphQL field or context should be queried.

Status: no solution provided yet; the request is for guidance on feasibility and the correct method to read channel context for discount logic.

Summarized with AI on December 19. AI used: gpt-5.

I am looking to query the channel that a buyer is coming from in order to change the discount based on which storefront the buyer is shopping from. Anyone know if this is possible? I haven’t seen what graphql resource works for this in the shopify functions api here Cart and Checkout Validation Function API

I have tried to add the channel and other shop data in my schema types, but getting an error in the console. see attached.

Any help would be appreciated. Thanks!