I’m trying to build a flow where I track a user’s activity using webhooks, process it on my backend asynchronously and then try to update the live user’s cart attributes using the shopify graphql api.
My plan was to use the cart token I get from webhooks in a gid - gid://shopify/Cart/, and then use CartAttributesUpdate to add an attribute.
I’m running into some weird behaviour. I fetched the cart using the attribute, worked fine, showed the product from my live session.
I updated it, and it showed me cart a user error that said “The specified cart does not exist.”, but it also showed me that the cart had been updated with my attribute, and a gid with the &key parameter.
I fetched it again, with the &key parameter this time, and it showed me the cart with my attribute in it.
But when my checkout function tried to access the cart’s attributes, they turned up as null.
What am i missing? Am i messing up my queries, or trying to do something that isn’t supported. Been getting conflicting ambiguous from the docs ai agent.