CheckoutLineItemInput graphql discrepancy

Topic summary

Discrepancy between Shopify Storefront API docs and the GraphQL schema for CheckoutLineItemInput in checkoutCreate.

  • Documentation indicates lineItems should accept variantId: ID! along with quantity and customAttributes.
  • The GraphQL schema (as seen in Shopify’s GraphQL app and via codegen) exposes only a nested variant object on line items, not a variantId field.
  • Attempts to execute the mutation using variantId fail with errors both in the Shopify GraphQL app and in local codegen.

Technical context:

  • CheckoutLineItemInput is the input used to add items to a checkout.
  • variantId refers to the product variant’s unique ID; a nested variant object typically appears in output types, not inputs.

Outcome and status:

  • No workaround or solution is provided; the issue remains unresolved.
  • The key unanswered question is which input shape is correct for checkoutCreate: should lineItems use variantId or a variant object?
  • User requests guidance or a working approach.
Summarized with AI on January 14. AI used: gpt-5.

I’m currently developing a custom checkout and came to a problem with the CheckoutLineItemInput type.

Storefront documentation for checkoutCreate has a inconsistency with given input type and the gql schema.

The “lineItems” property should accept a “variantId: ID!”, while the graphql schema offers only “variant” and its subfields. I got the same error while trying out the mutation via gql app on shopify and on my end via codegen.

it should look like this, and the mutation does not work:

lineItems {
        edges {
          node {
	    customAttributes {
              key
              value
            }
            quantity
            variantId
          }
        }
      }
    }

but it suggest this:

      lineItems {
        edges {
          node {
	     customAttributes {
              key
              value
            }
            quantity
            variant {
                ...
          }
        }
      }
    }

If anyone has any knowledge of this problem or a workaround pls help :slightly_smiling_face: