On this page
Why this happens
Product webhook payloads include full variant details for only the first 100 variants. Additional variant IDs can appear in variant_gids, so processing only the variants array can silently omit records.
Implementation
Queue the product ID after validating the webhook. Query the Admin GraphQL product variants connection using cursor pagination, and reconcile the complete result against the external catalog. Handle deleted products separately. Coalesce repeated updates and avoid treating a truncated payload as evidence of variant deletion.
Example
For a product with 150 variants, do not delete external records for variants 101 through 150 simply because their full details were absent from a webhook. Retrieve the current product snapshot and reconcile by variant ID only after all pages have been processed successfully.
- Create a development product with more than 100 variants
- update a late variant
- inspect the webhook
- reconcile using GraphQL
- simulate a failed page fetch and ensure no records are deleted
- test a genuine variant deletion.

