Query preventing deploy

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?