Summary On a very small number of carts, our Cart Transform function’s input query returns a cart line whose id is an empty global ID gid://shopify/CartLine/ with nothing after the trailing slash. When we pass that id back as the cartLineId of a lineExpand operation, the function output is rejected (InvalidOutputError) with:
[{"path":["operations",0,"lineExpand","cartLineId"],"explanation":"Invalid global id 'gid://shopify/CartLine/'","message":"Invalid global id 'gid://shopify/CartLine/'"}]
This has affected only 4 carts out of millions of Cart Transform runs that succeed every day, which makes it look like an edge-case on the input side rather than our function logic, we pass line.id straight through and don’t build the GID ourselves.
Environment
- Function: Cart Transform
- Functions API version: 2026-01
- Operation used:
lineExpand(bundle expansion)
Input query
graphql
query Input {
cart {
lines {
id
}
}
}
Expected Every cart.lines[].id is a valid CartLine GID (e.g.gid://shopify/CartLine/<uuid>). We reference that id as cartLineId in our lineExpand operation.
Actual For the affected carts, a line comes back with an empty id:
JSON
"cart": {
"lines": [
{
"id": "gid:\/\/shopify\/CartLine\/"
}
]
}
Because the id is empty, the cartLineId we emit is gid://shopify/CartLine/, and the output fails validation:
[{"path":["operations",0,"lineExpand","cartLineId"],"explanation":"Invalid global id 'gid://shopify/CartLine/'","message":"Invalid global id 'gid://shopify/CartLine/'"}]
Scope / frequency
- 2 distinct merchants affected, 3 occurrences on the same merchant store, one on a second
- It doesn’t look like these products went through regular storefront cart UI, line item properties our app attaches when a bundle is configured are missing from the input
What we’ve checked
- Our function reads
line.idfrom the input and passes it through unchanged, we don’t construct the CartLine GID, so the empty token originates in the function input.
Questions for Shopify
- Under what conditions can
cart.lines[].idbe returned as an emptygid://shopify/CartLine/in a Cart Transform input? - Is this a known issue on a particular API version, and is there a fix or recommended workaround?
- As a defensive measure, is it safe for us to skip/no-op any line whose
iddoesn’t matchgid://shopify/CartLine/<non-empty>so the run doesn’t fail? Could that cause the line to be mis-handled at checkout?
I’m happy to share any further store id/function run id details in a DM.
Thanks