On this page
Why this happens
GraphQL can return a successful HTTP status while reporting execution or validation problems in the response body. Shopify mutations also expose business-level errors through their payload.
Implementation
Request userErrors explicitly for the mutation you use. Log the error field and message, retain the affected record identifier and distinguish retryable transport failures from invalid inputs. For ambiguous timeouts, reread the resource before repeating a write.
Example
const result = await response.json();
if (!response.ok || result.errors?.length) {
throw new Error('GraphQL request failed');
}
const payload = result.data?.productUpdate;
if (!payload || payload.userErrors?.length || !payload.product?.id) {
throw new Error('Product update not confirmed');
}
This example assumes a productUpdate selection containing product { id } and userErrors { field message }. Adapt the success criteria to the mutation rather than treating all payloads alike.
- Submit a valid update
- submit an invalid field value
- test missing permissions
- simulate a timeout after a write
- confirm the integration does not mark failures successful or blindly duplicate operations.

