Przejdź do głównej zawartości

UserError

A validation or business error returned alongside a mutation result. Surfaced as userErrors[]; the cart/order itself is null when the mutation could not be applied. Always branch on code for UI behaviour — message is translated and locale-dependent.

type UserError {
code: String
field: [String!]
message: String!
}

Fields

UserError.code ● String scalar

Stable machine-readable code (e.g. CART_NOT_FOUND, NOT_ENOUGH_IN_STOCK, INVALID_DISCOUNT_CODE). The list of possible codes is defined per mutation by CartErrorCode, CustomerErrorCode, PaymentErrorCode, etc.

UserError.field ● [String!] list scalar

Path of the input field that caused the error (e.g. ["input", "lines", 0, "quantity"]). Use to highlight the offending control in a form.

UserError.message ● String! non-null scalar

Human-readable error message localised to the request locale (e.g. Accept-Language). For display only.

Member Of

AvailableShippingMethodsPayload object ● CartAddLinesPayload object ● CartApplyGiftCardPayload object ● CartClearPaymentSelectionPayload object ● CartCompletePayload object ● CartCreatePayload object ● CartDiscountCodesUpdatePayload object ● CartDowngradeOnLogoutPayload object ● CartMergePayload object ● CartRecoveryRedeemPayload object ● CartRemoveGiftCardPayload object ● CartRemoveLinesPayload object ● CartSelectPaymentMethodPayload object ● CartSelectShippingMethodPayload object ● CartSetBillingAddressPayload object ● CartSetShippingAddressPayload object ● CartUpdateAttributesPayload object ● CartUpdateBuyerIdentityPayload object ● CartUpdateGiftCardRecipientPayload object ● CartUpdateLinesPayload object ● CartUpdateNotePayload object ● CustomerActivatePayload object ● CustomerAddAddressPayload object ● CustomerLoginPayload object ● CustomerLogoutPayload object ● CustomerRefreshTokenPayload object ● CustomerRemoveAddressPayload object ● CustomerRequestPasswordResetPayload object ● CustomerResendVerificationEmailPayload object ● CustomerResetPasswordPayload object ● CustomerSetDefaultAddressPayload object ● CustomerSignupPayload object ● CustomerUpdateAddressPayload object ● CustomerUpdatePayload object ● CustomerVerifyEmailPayload object ● DigitalDownloadLinkPayload object ● FormSubmitPayload object ● GenerateReferralCodePayload object ● GiftCardValidatePayload object ● PaymentCreatePayload object ● RedeemRewardPayload object ● ReturnCancelPayload object ● ReturnCreatePayload object ● ReturnPayload object ● ReviewPayload object ● ShipmentPayload object ● SubscribeToMarketingPayload object ● UnsubscribeFromMarketingPayload object ● WishlistPayload object