Further adventures with the doc bot
I don’t mean to pile on, but I just feel like this should be documented (ha) somewhere.
This morning’s question for the Shopify doc bot seemed to me right in the bullseye for this kind of tool:
what is the non-deprecated replacement for emailMarketingConsent on the customer object?
The reply:
In case that image is too small to read on, e.g., a mobile screen: the doc bot says I should now use the marketingConsent field: “a unified object that contains both email and SMS marketing consent information.”
The problem (you have foreseen it): there is no marketingConsent field.
After poking around for a while —
query {
customerByIdentifier(identifier: {
emailAddress: "foo@bar.com"
}) {
id
defaultEmailAddress {
marketingState
}
}
}
This requires switching to API version 2025-07, which is what tripped me up; I’d been on 2025-01.
I’ve tried my original doc bot query a few more times, incognito, and received different replies; none were as misleading as the first, but/and none of them betrayed any awareness of the new structure, either. So, okay, an unlucky roll of the dice! I’m not sure how to think about “probabilistic docs”.
Keeping complex documentation aligned with a fast-changing API isn’t easy, so it’s not like I expect zero errors or omissions in these resources —