Query preventing deploy

Topic summary

Main issue: Deployment fails because the GraphQL schema expects buyerIdentity.purchasingCompany to be an array, while the user’s code/query treats it as a simple optional field to check existence.

Context: A small app aims to adjust shipping options at checkout based on whether the customer belongs to a company (B2B).

Technical details:

  • Rust logic checks input.cart.buyerIdentity and purchasingCompany with is_some() and unwrap().
  • input.graphql selects cart { buyerIdentity { purchasingCompany } … } along with delivery options.
  • Validator error indicates purchasingCompany must be an array type, causing the deploy to fail.

Artifacts: Code snippets (Rust and GraphQL) are central to understanding the issue.

Status: No resolution provided; the user asks if they’re missing something simple. Discussion is open/ongoing.

Summarized with AI on January 30. AI used: gpt-5.

I’m building a small app to check if a customer is in a company when purchasing. This will change what shipping options are available at checkout.

I’ve set up the following query in rust:

let is_b2b = if input.cart.buyerIdentity.is_some () {
input.cart.buyerIdentity.unwrap().purchasingCompany.is_some()
} else {
false
};

Which should work right? My input.graphql looks like this

query Input {
cart {
buyerIdentity {
purchasingCompany
}
deliveryGroups {
deliveryOptions {
title
handle
}
}
}
}

this fails deployment as it expects ‘purchasingCompany’ to be an array. But I just want to check if it exists. Am i just missing something really simple here?