compareAt price is null when using inContext argument

Topic summary

A developer is experiencing an issue with the Shopfront API where the compareAtPrice field returns null when using the inContext argument with buyer identity.

Working scenario:

  • Standard product query without inContext successfully returns compareAtPrice.amount values

Failing scenario:

  • Same query with @inContext(buyer: $buyer) argument returns null for compareAtPrice.amount on identical products

The issue appears to be specific to the interaction between buyer context and compare-at pricing data. The developer has provided code snippets demonstrating both the working and non-working queries. No resolution or explanation has been provided yet.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

I’m unable to get the compareAt price for products when using the buyer identity as the inContext argument using the Storefront API.

This returns a value for compareAtPrice.amount:

query Products {
  products(first: 5) {
    nodes {
      variants(first: 5) {
        nodes {
          compareAtPrice {
            amount
            currencyCode
          }
        }
      }
    }
  }
}

This returns null for compareAtPrice.amount (for the same product):

query Products($buyer: BuyerInput) @inContext(buyer: $buyer) {
  products(first: 5) {
    nodes {
      variants(first: 5) {
        nodes {
          id
          compareAtPrice {
            amount
            currencyCode
          }
        }
      }
    }
  }
}
4 Likes