Browse Source

refactor(core): Rename error `code` to `errorCode`

Less ambiguous, no conflicts with other types (e.g. Order) which already have a `code` field.
Michael Bromley 5 years ago
parent
commit
ed0a516848
36 changed files with 417 additions and 409 deletions
  1. 24 23
      packages/asset-server-plugin/e2e/graphql/generated-e2e-asset-server-plugin-types.ts
  2. 23 23
      packages/common/src/generated-shop-types.ts
  3. 24 23
      packages/common/src/generated-types.ts
  4. 1 1
      packages/core/e2e/auth.e2e-spec.ts
  5. 2 2
      packages/core/e2e/authentication-strategy.e2e-spec.ts
  6. 2 2
      packages/core/e2e/customer.e2e-spec.ts
  7. 2 1
      packages/core/e2e/default-search-plugin.e2e-spec.ts
  8. 1 1
      packages/core/e2e/global-settings.e2e-spec.ts
  9. 57 59
      packages/core/e2e/graphql/generated-e2e-admin-types.ts
  10. 67 74
      packages/core/e2e/graphql/generated-e2e-shop-types.ts
  11. 8 8
      packages/core/e2e/graphql/shared-definitions.ts
  12. 17 17
      packages/core/e2e/graphql/shop-definitions.ts
  13. 17 17
      packages/core/e2e/order.e2e-spec.ts
  14. 2 2
      packages/core/e2e/product.e2e-spec.ts
  15. 3 3
      packages/core/e2e/promotion.e2e-spec.ts
  16. 2 1
      packages/core/e2e/role.e2e-spec.ts
  17. 16 14
      packages/core/e2e/shop-auth.e2e-spec.ts
  18. 1 1
      packages/core/e2e/shop-customer.e2e-spec.ts
  19. 1 1
      packages/core/src/api/resolvers/shop/shop-auth.resolver.ts
  20. 1 1
      packages/core/src/api/schema/admin-api/asset.api.graphql
  21. 1 1
      packages/core/src/api/schema/admin-api/channel.api.graphql
  22. 1 1
      packages/core/src/api/schema/admin-api/global-settings.api.graphql
  23. 13 13
      packages/core/src/api/schema/admin-api/order.api.graphql
  24. 1 1
      packages/core/src/api/schema/admin-api/product.api.graphql
  25. 1 1
      packages/core/src/api/schema/admin-api/promotion.api.graphql
  26. 5 5
      packages/core/src/api/schema/common/common-types.graphql
  27. 19 19
      packages/core/src/api/schema/shop-api/shop.api.graphql
  28. 9 2
      packages/core/src/common/error/error-result.ts
  29. 23 23
      packages/core/src/common/error/generated-graphql-admin-errors.ts
  30. 23 23
      packages/core/src/common/error/generated-graphql-shop-errors.ts
  31. 24 23
      packages/elasticsearch-plugin/e2e/graphql/generated-e2e-elasticsearch-plugin-types.ts
  32. 1 1
      packages/testing/src/simple-graphql-client.ts
  33. 0 0
      schema-admin.json
  34. 0 0
      schema-shop.json
  35. 21 18
      scripts/codegen/generate-graphql-types.ts
  36. 4 4
      scripts/codegen/plugins/graphql-errors-plugin.ts

+ 24 - 23
packages/asset-server-plugin/e2e/graphql/generated-e2e-asset-server-plugin-types.ts

@@ -109,7 +109,7 @@ export type AdministratorSortParameter = {
 
 
 /** Returned if an attempting to refund an OrderItem which has already been refunded */
 /** Returned if an attempting to refund an OrderItem which has already been refunded */
 export type AlreadyRefundedError = ErrorResult & {
 export type AlreadyRefundedError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     refundId: Scalars['ID'];
     refundId: Scalars['ID'];
 };
 };
@@ -208,7 +208,7 @@ export type BooleanOperators = {
 
 
 /** Returned if an attempting to cancel lines from an Order which is still active */
 /** Returned if an attempting to cancel lines from an Order which is still active */
 export type CancelActiveOrderError = ErrorResult & {
 export type CancelActiveOrderError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     orderState: Scalars['String'];
     orderState: Scalars['String'];
 };
 };
@@ -258,7 +258,7 @@ export type Channel = Node & {
  * of the GlobalSettings
  * of the GlobalSettings
  */
  */
 export type ChannelDefaultLanguageError = ErrorResult & {
 export type ChannelDefaultLanguageError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     language: Scalars['String'];
     language: Scalars['String'];
     channelCode: Scalars['String'];
     channelCode: Scalars['String'];
@@ -1141,13 +1141,13 @@ export enum DeletionResult {
 
 
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 export type EmailAddressConflictError = ErrorResult & {
 export type EmailAddressConflictError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned if no OrderLines have been specified for the operation */
 /** Returned if no OrderLines have been specified for the operation */
 export type EmptyOrderLineSelectionError = ErrorResult & {
 export type EmptyOrderLineSelectionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1178,7 +1178,7 @@ export enum ErrorCode {
 }
 }
 
 
 export type ErrorResult = {
 export type ErrorResult = {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1301,7 +1301,7 @@ export type Fulfillment = Node & {
 
 
 /** Returned when there is an error in transitioning the Fulfillment state */
 /** Returned when there is an error in transitioning the Fulfillment state */
 export type FulfillmentStateTransitionError = ErrorResult & {
 export type FulfillmentStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -1406,13 +1406,13 @@ export type IntCustomFieldConfig = CustomField & {
 
 
 /** Returned if the user authentication credentials are not valid */
 /** Returned if the user authentication credentials are not valid */
 export type InvalidCredentialsError = ErrorResult & {
 export type InvalidCredentialsError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned if the specified items are already part of a Fulfillment */
 /** Returned if the specified items are already part of a Fulfillment */
 export type ItemsAlreadyFulfilledError = ErrorResult & {
 export type ItemsAlreadyFulfilledError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1809,8 +1809,9 @@ export enum LanguageCode {
     zu = 'zu',
     zu = 'zu',
 }
 }
 
 
+/** Returned if attempting to set a Channel's defaultLanguageCode to a language which is not enabled in GlobalSettings */
 export type LanguageNotAvailableError = ErrorResult & {
 export type LanguageNotAvailableError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     languageCode: Scalars['String'];
     languageCode: Scalars['String'];
 };
 };
@@ -1838,7 +1839,7 @@ export enum LogicalOperator {
 }
 }
 
 
 export type MimeTypeError = ErrorResult & {
 export type MimeTypeError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     fileName: Scalars['String'];
     fileName: Scalars['String'];
     mimeType: Scalars['String'];
     mimeType: Scalars['String'];
@@ -1846,7 +1847,7 @@ export type MimeTypeError = ErrorResult & {
 
 
 /** Returned if a PromotionCondition has neither a couponCode nor any conditions set */
 /** Returned if a PromotionCondition has neither a couponCode nor any conditions set */
 export type MissingConditionsError = ErrorResult & {
 export type MissingConditionsError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1858,7 +1859,7 @@ export type MoveCollectionInput = {
 
 
 /** Returned if an operation has specified OrderLines from multiple Orders */
 /** Returned if an operation has specified OrderLines from multiple Orders */
 export type MultipleOrderError = ErrorResult & {
 export type MultipleOrderError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2413,7 +2414,7 @@ export type NativeAuthInput = {
 
 
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 export type NativeAuthStrategyError = ErrorResult & {
 export type NativeAuthStrategyError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2423,7 +2424,7 @@ export type Node = {
 
 
 /** Returned if an attempting to refund an Order but neither items nor shipping refund was specified */
 /** Returned if an attempting to refund an Order but neither items nor shipping refund was specified */
 export type NothingToRefundError = ErrorResult & {
 export type NothingToRefundError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2575,7 +2576,7 @@ export type OrderSortParameter = {
 
 
 /** Returned if there is an error in transitioning the Order state */
 /** Returned if there is an error in transitioning the Order state */
 export type OrderStateTransitionError = ErrorResult & {
 export type OrderStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -2638,13 +2639,13 @@ export type PaymentMethodSortParameter = {
 
 
 /** Returned if an attempting to refund a Payment against OrderLines from a different Order */
 /** Returned if an attempting to refund a Payment against OrderLines from a different Order */
 export type PaymentOrderMismatchError = ErrorResult & {
 export type PaymentOrderMismatchError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned when there is an error in transitioning the Payment state */
 /** Returned when there is an error in transitioning the Payment state */
 export type PaymentStateTransitionError = ErrorResult & {
 export type PaymentStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -2783,7 +2784,7 @@ export type ProductOptionGroupTranslationInput = {
 };
 };
 
 
 export type ProductOptionInUseError = ErrorResult & {
 export type ProductOptionInUseError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     optionGroupCode: Scalars['String'];
     optionGroupCode: Scalars['String'];
     productVariantCount: Scalars['Int'];
     productVariantCount: Scalars['Int'];
@@ -2967,7 +2968,7 @@ export type PromotionSortParameter = {
 
 
 /** Returned if the specified quantity of an OrderLine is greater than the number of items in that line */
 /** Returned if the specified quantity of an OrderLine is greater than the number of items in that line */
 export type QuantityTooGreatError = ErrorResult & {
 export type QuantityTooGreatError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -3231,14 +3232,14 @@ export type RefundOrderResult =
 
 
 /** Returned if an attempting to refund an Order which is not in the expected state */
 /** Returned if an attempting to refund an Order which is not in the expected state */
 export type RefundOrderStateError = ErrorResult & {
 export type RefundOrderStateError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     orderState: Scalars['String'];
     orderState: Scalars['String'];
 };
 };
 
 
 /** Returned when there is an error in transitioning the Refund state */
 /** Returned when there is an error in transitioning the Refund state */
 export type RefundStateTransitionError = ErrorResult & {
 export type RefundStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -3383,7 +3384,7 @@ export type ServerConfig = {
 
 
 /** Returned if the Payment settlement fails */
 /** Returned if the Payment settlement fails */
 export type SettlePaymentError = ErrorResult & {
 export type SettlePaymentError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
 };
 };

+ 23 - 23
packages/common/src/generated-shop-types.ts

@@ -80,7 +80,7 @@ export type AdministratorList = PaginatedList & {
 /** Retured when attemting to set the Customer for an Order when already logged in. */
 /** Retured when attemting to set the Customer for an Order when already logged in. */
 export type AlreadyLoggedInError = ErrorResult & {
 export type AlreadyLoggedInError = ErrorResult & {
     __typename?: 'AlreadyLoggedInError';
     __typename?: 'AlreadyLoggedInError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -324,7 +324,7 @@ export type CountryTranslation = {
 /** Returned if the provided coupon code is invalid */
 /** Returned if the provided coupon code is invalid */
 export type CouponCodeExpiredError = ErrorResult & {
 export type CouponCodeExpiredError = ErrorResult & {
     __typename?: 'CouponCodeExpiredError';
     __typename?: 'CouponCodeExpiredError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     couponCode: Scalars['String'];
     couponCode: Scalars['String'];
 };
 };
@@ -332,7 +332,7 @@ export type CouponCodeExpiredError = ErrorResult & {
 /** Returned if the provided coupon code is invalid */
 /** Returned if the provided coupon code is invalid */
 export type CouponCodeInvalidError = ErrorResult & {
 export type CouponCodeInvalidError = ErrorResult & {
     __typename?: 'CouponCodeInvalidError';
     __typename?: 'CouponCodeInvalidError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     couponCode: Scalars['String'];
     couponCode: Scalars['String'];
 };
 };
@@ -340,7 +340,7 @@ export type CouponCodeInvalidError = ErrorResult & {
 /** Returned if the provided coupon code is invalid */
 /** Returned if the provided coupon code is invalid */
 export type CouponCodeLimitError = ErrorResult & {
 export type CouponCodeLimitError = ErrorResult & {
     __typename?: 'CouponCodeLimitError';
     __typename?: 'CouponCodeLimitError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     couponCode: Scalars['String'];
     couponCode: Scalars['String'];
     limit: Scalars['Int'];
     limit: Scalars['Int'];
@@ -857,7 +857,7 @@ export enum DeletionResult {
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 export type EmailAddressConflictError = ErrorResult & {
 export type EmailAddressConflictError = ErrorResult & {
     __typename?: 'EmailAddressConflictError';
     __typename?: 'EmailAddressConflictError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -888,7 +888,7 @@ export enum ErrorCode {
 }
 }
 
 
 export type ErrorResult = {
 export type ErrorResult = {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1057,7 +1057,7 @@ export enum HistoryEntryType {
  */
  */
 export type IdentifierChangeTokenExpiredError = ErrorResult & {
 export type IdentifierChangeTokenExpiredError = ErrorResult & {
     __typename?: 'IdentifierChangeTokenExpiredError';
     __typename?: 'IdentifierChangeTokenExpiredError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1067,7 +1067,7 @@ export type IdentifierChangeTokenExpiredError = ErrorResult & {
  */
  */
 export type IdentifierChangeTokenInvalidError = ErrorResult & {
 export type IdentifierChangeTokenInvalidError = ErrorResult & {
     __typename?: 'IdentifierChangeTokenInvalidError';
     __typename?: 'IdentifierChangeTokenInvalidError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1095,7 +1095,7 @@ export type IntCustomFieldConfig = CustomField & {
 /** Returned if the user authentication credentials are not valid */
 /** Returned if the user authentication credentials are not valid */
 export type InvalidCredentialsError = ErrorResult & {
 export type InvalidCredentialsError = ErrorResult & {
     __typename?: 'InvalidCredentialsError';
     __typename?: 'InvalidCredentialsError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1452,7 +1452,7 @@ export enum LogicalOperator {
 /** Retured when attemting to register or verify a customer account without a password, when one is required. */
 /** Retured when attemting to register or verify a customer account without a password, when one is required. */
 export type MissingPasswordError = ErrorResult & {
 export type MissingPasswordError = ErrorResult & {
     __typename?: 'MissingPasswordError';
     __typename?: 'MissingPasswordError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1685,14 +1685,14 @@ export type NativeAuthInput = {
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 export type NativeAuthStrategyError = ErrorResult & {
 export type NativeAuthStrategyError = ErrorResult & {
     __typename?: 'NativeAuthStrategyError';
     __typename?: 'NativeAuthStrategyError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Retured when attemting to set a negative OrderLine quantity. */
 /** Retured when attemting to set a negative OrderLine quantity. */
 export type NegativeQuantityError = ErrorResult & {
 export type NegativeQuantityError = ErrorResult & {
     __typename?: 'NegativeQuantityError';
     __typename?: 'NegativeQuantityError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1799,7 +1799,7 @@ export type OrderItem = Node & {
 /** Retured when the maximum order size limit has been reached. */
 /** Retured when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
 export type OrderLimitError = ErrorResult & {
     __typename?: 'OrderLimitError';
     __typename?: 'OrderLimitError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     maxItems: Scalars['Int'];
     maxItems: Scalars['Int'];
 };
 };
@@ -1837,14 +1837,14 @@ export type OrderListOptions = {
 /** Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. */
 /** Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. */
 export type OrderModificationError = ErrorResult & {
 export type OrderModificationError = ErrorResult & {
     __typename?: 'OrderModificationError';
     __typename?: 'OrderModificationError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. */
 /** Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. */
 export type OrderPaymentStateError = ErrorResult & {
 export type OrderPaymentStateError = ErrorResult & {
     __typename?: 'OrderPaymentStateError';
     __typename?: 'OrderPaymentStateError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1871,7 +1871,7 @@ export type OrderSortParameter = {
 /** Returned if there is an error in transitioning the Order state */
 /** Returned if there is an error in transitioning the Order state */
 export type OrderStateTransitionError = ErrorResult & {
 export type OrderStateTransitionError = ErrorResult & {
     __typename?: 'OrderStateTransitionError';
     __typename?: 'OrderStateTransitionError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -1886,7 +1886,7 @@ export type PaginatedList = {
 /** Retured when attemting to verify a customer account with a password, when a password has already been set. */
 /** Retured when attemting to verify a customer account with a password, when a password has already been set. */
 export type PasswordAlreadySetError = ErrorResult & {
 export type PasswordAlreadySetError = ErrorResult & {
     __typename?: 'PasswordAlreadySetError';
     __typename?: 'PasswordAlreadySetError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1896,7 +1896,7 @@ export type PasswordAlreadySetError = ErrorResult & {
  */
  */
 export type PasswordResetTokenExpiredError = ErrorResult & {
 export type PasswordResetTokenExpiredError = ErrorResult & {
     __typename?: 'PasswordResetTokenExpiredError';
     __typename?: 'PasswordResetTokenExpiredError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1906,7 +1906,7 @@ export type PasswordResetTokenExpiredError = ErrorResult & {
  */
  */
 export type PasswordResetTokenInvalidError = ErrorResult & {
 export type PasswordResetTokenInvalidError = ErrorResult & {
     __typename?: 'PasswordResetTokenInvalidError';
     __typename?: 'PasswordResetTokenInvalidError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1927,7 +1927,7 @@ export type Payment = Node & {
 /** Returned when a Payment is declined by the payment provider. */
 /** Returned when a Payment is declined by the payment provider. */
 export type PaymentDeclinedError = ErrorResult & {
 export type PaymentDeclinedError = ErrorResult & {
     __typename?: 'PaymentDeclinedError';
     __typename?: 'PaymentDeclinedError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
 };
 };
@@ -1935,7 +1935,7 @@ export type PaymentDeclinedError = ErrorResult & {
 /** Returned when a Payment fails due to an error. */
 /** Returned when a Payment fails due to an error. */
 export type PaymentFailedError = ErrorResult & {
 export type PaymentFailedError = ErrorResult & {
     __typename?: 'PaymentFailedError';
     __typename?: 'PaymentFailedError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
 };
 };
@@ -2637,7 +2637,7 @@ export type User = Node & {
  */
  */
 export type VerificationTokenExpiredError = ErrorResult & {
 export type VerificationTokenExpiredError = ErrorResult & {
     __typename?: 'VerificationTokenExpiredError';
     __typename?: 'VerificationTokenExpiredError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2647,7 +2647,7 @@ export type VerificationTokenExpiredError = ErrorResult & {
  */
  */
 export type VerificationTokenInvalidError = ErrorResult & {
 export type VerificationTokenInvalidError = ErrorResult & {
     __typename?: 'VerificationTokenInvalidError';
     __typename?: 'VerificationTokenInvalidError';
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 

+ 24 - 23
packages/common/src/generated-types.ts

@@ -111,7 +111,7 @@ export type AdministratorSortParameter = {
 /** Returned if an attempting to refund an OrderItem which has already been refunded */
 /** Returned if an attempting to refund an OrderItem which has already been refunded */
 export type AlreadyRefundedError = ErrorResult & {
 export type AlreadyRefundedError = ErrorResult & {
   __typename?: 'AlreadyRefundedError';
   __typename?: 'AlreadyRefundedError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   refundId: Scalars['ID'];
   refundId: Scalars['ID'];
 };
 };
@@ -215,7 +215,7 @@ export type BooleanOperators = {
 /** Returned if an attempting to cancel lines from an Order which is still active */
 /** Returned if an attempting to cancel lines from an Order which is still active */
 export type CancelActiveOrderError = ErrorResult & {
 export type CancelActiveOrderError = ErrorResult & {
   __typename?: 'CancelActiveOrderError';
   __typename?: 'CancelActiveOrderError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   orderState: Scalars['String'];
   orderState: Scalars['String'];
 };
 };
@@ -261,7 +261,7 @@ export type Channel = Node & {
  */
  */
 export type ChannelDefaultLanguageError = ErrorResult & {
 export type ChannelDefaultLanguageError = ErrorResult & {
   __typename?: 'ChannelDefaultLanguageError';
   __typename?: 'ChannelDefaultLanguageError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   language: Scalars['String'];
   language: Scalars['String'];
   channelCode: Scalars['String'];
   channelCode: Scalars['String'];
@@ -1165,14 +1165,14 @@ export enum DeletionResult {
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 export type EmailAddressConflictError = ErrorResult & {
 export type EmailAddressConflictError = ErrorResult & {
   __typename?: 'EmailAddressConflictError';
   __typename?: 'EmailAddressConflictError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
 /** Returned if no OrderLines have been specified for the operation */
 /** Returned if no OrderLines have been specified for the operation */
 export type EmptyOrderLineSelectionError = ErrorResult & {
 export type EmptyOrderLineSelectionError = ErrorResult & {
   __typename?: 'EmptyOrderLineSelectionError';
   __typename?: 'EmptyOrderLineSelectionError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
@@ -1203,7 +1203,7 @@ export enum ErrorCode {
 }
 }
 
 
 export type ErrorResult = {
 export type ErrorResult = {
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
@@ -1335,7 +1335,7 @@ export type Fulfillment = Node & {
 /** Returned when there is an error in transitioning the Fulfillment state */
 /** Returned when there is an error in transitioning the Fulfillment state */
 export type FulfillmentStateTransitionError = ErrorResult & {
 export type FulfillmentStateTransitionError = ErrorResult & {
   __typename?: 'FulfillmentStateTransitionError';
   __typename?: 'FulfillmentStateTransitionError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   transitionError: Scalars['String'];
   transitionError: Scalars['String'];
   fromState: Scalars['String'];
   fromState: Scalars['String'];
@@ -1446,14 +1446,14 @@ export type IntCustomFieldConfig = CustomField & {
 /** Returned if the user authentication credentials are not valid */
 /** Returned if the user authentication credentials are not valid */
 export type InvalidCredentialsError = ErrorResult & {
 export type InvalidCredentialsError = ErrorResult & {
   __typename?: 'InvalidCredentialsError';
   __typename?: 'InvalidCredentialsError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
 /** Returned if the specified items are already part of a Fulfillment */
 /** Returned if the specified items are already part of a Fulfillment */
 export type ItemsAlreadyFulfilledError = ErrorResult & {
 export type ItemsAlreadyFulfilledError = ErrorResult & {
   __typename?: 'ItemsAlreadyFulfilledError';
   __typename?: 'ItemsAlreadyFulfilledError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
@@ -1854,9 +1854,10 @@ export enum LanguageCode {
   zu = 'zu'
   zu = 'zu'
 }
 }
 
 
+/** Returned if attempting to set a Channel's defaultLanguageCode to a language which is not enabled in GlobalSettings */
 export type LanguageNotAvailableError = ErrorResult & {
 export type LanguageNotAvailableError = ErrorResult & {
   __typename?: 'LanguageNotAvailableError';
   __typename?: 'LanguageNotAvailableError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   languageCode: Scalars['String'];
   languageCode: Scalars['String'];
 };
 };
@@ -1887,7 +1888,7 @@ export enum LogicalOperator {
 
 
 export type MimeTypeError = ErrorResult & {
 export type MimeTypeError = ErrorResult & {
   __typename?: 'MimeTypeError';
   __typename?: 'MimeTypeError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   fileName: Scalars['String'];
   fileName: Scalars['String'];
   mimeType: Scalars['String'];
   mimeType: Scalars['String'];
@@ -1896,7 +1897,7 @@ export type MimeTypeError = ErrorResult & {
 /** Returned if a PromotionCondition has neither a couponCode nor any conditions set */
 /** Returned if a PromotionCondition has neither a couponCode nor any conditions set */
 export type MissingConditionsError = ErrorResult & {
 export type MissingConditionsError = ErrorResult & {
   __typename?: 'MissingConditionsError';
   __typename?: 'MissingConditionsError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
@@ -1909,7 +1910,7 @@ export type MoveCollectionInput = {
 /** Returned if an operation has specified OrderLines from multiple Orders */
 /** Returned if an operation has specified OrderLines from multiple Orders */
 export type MultipleOrderError = ErrorResult & {
 export type MultipleOrderError = ErrorResult & {
   __typename?: 'MultipleOrderError';
   __typename?: 'MultipleOrderError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
@@ -2555,7 +2556,7 @@ export type NativeAuthInput = {
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 export type NativeAuthStrategyError = ErrorResult & {
 export type NativeAuthStrategyError = ErrorResult & {
   __typename?: 'NativeAuthStrategyError';
   __typename?: 'NativeAuthStrategyError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
@@ -2566,7 +2567,7 @@ export type Node = {
 /** Returned if an attempting to refund an Order but neither items nor shipping refund was specified */
 /** Returned if an attempting to refund an Order but neither items nor shipping refund was specified */
 export type NothingToRefundError = ErrorResult & {
 export type NothingToRefundError = ErrorResult & {
   __typename?: 'NothingToRefundError';
   __typename?: 'NothingToRefundError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
@@ -2726,7 +2727,7 @@ export type OrderSortParameter = {
 /** Returned if there is an error in transitioning the Order state */
 /** Returned if there is an error in transitioning the Order state */
 export type OrderStateTransitionError = ErrorResult & {
 export type OrderStateTransitionError = ErrorResult & {
   __typename?: 'OrderStateTransitionError';
   __typename?: 'OrderStateTransitionError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   transitionError: Scalars['String'];
   transitionError: Scalars['String'];
   fromState: Scalars['String'];
   fromState: Scalars['String'];
@@ -2793,14 +2794,14 @@ export type PaymentMethodSortParameter = {
 /** Returned if an attempting to refund a Payment against OrderLines from a different Order */
 /** Returned if an attempting to refund a Payment against OrderLines from a different Order */
 export type PaymentOrderMismatchError = ErrorResult & {
 export type PaymentOrderMismatchError = ErrorResult & {
   __typename?: 'PaymentOrderMismatchError';
   __typename?: 'PaymentOrderMismatchError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
 /** Returned when there is an error in transitioning the Payment state */
 /** Returned when there is an error in transitioning the Payment state */
 export type PaymentStateTransitionError = ErrorResult & {
 export type PaymentStateTransitionError = ErrorResult & {
   __typename?: 'PaymentStateTransitionError';
   __typename?: 'PaymentStateTransitionError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   transitionError: Scalars['String'];
   transitionError: Scalars['String'];
   fromState: Scalars['String'];
   fromState: Scalars['String'];
@@ -2946,7 +2947,7 @@ export type ProductOptionGroupTranslationInput = {
 
 
 export type ProductOptionInUseError = ErrorResult & {
 export type ProductOptionInUseError = ErrorResult & {
   __typename?: 'ProductOptionInUseError';
   __typename?: 'ProductOptionInUseError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   optionGroupCode: Scalars['String'];
   optionGroupCode: Scalars['String'];
   productVariantCount: Scalars['Int'];
   productVariantCount: Scalars['Int'];
@@ -3139,7 +3140,7 @@ export type PromotionSortParameter = {
 /** Returned if the specified quantity of an OrderLine is greater than the number of items in that line */
 /** Returned if the specified quantity of an OrderLine is greater than the number of items in that line */
 export type QuantityTooGreatError = ErrorResult & {
 export type QuantityTooGreatError = ErrorResult & {
   __typename?: 'QuantityTooGreatError';
   __typename?: 'QuantityTooGreatError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
 };
 };
 
 
@@ -3437,7 +3438,7 @@ export type RefundOrderResult = Refund | QuantityTooGreatError | NothingToRefund
 /** Returned if an attempting to refund an Order which is not in the expected state */
 /** Returned if an attempting to refund an Order which is not in the expected state */
 export type RefundOrderStateError = ErrorResult & {
 export type RefundOrderStateError = ErrorResult & {
   __typename?: 'RefundOrderStateError';
   __typename?: 'RefundOrderStateError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   orderState: Scalars['String'];
   orderState: Scalars['String'];
 };
 };
@@ -3445,7 +3446,7 @@ export type RefundOrderStateError = ErrorResult & {
 /** Returned when there is an error in transitioning the Refund state */
 /** Returned when there is an error in transitioning the Refund state */
 export type RefundStateTransitionError = ErrorResult & {
 export type RefundStateTransitionError = ErrorResult & {
   __typename?: 'RefundStateTransitionError';
   __typename?: 'RefundStateTransitionError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   transitionError: Scalars['String'];
   transitionError: Scalars['String'];
   fromState: Scalars['String'];
   fromState: Scalars['String'];
@@ -3598,7 +3599,7 @@ export type ServerConfig = {
 /** Returned if the Payment settlement fails */
 /** Returned if the Payment settlement fails */
 export type SettlePaymentError = ErrorResult & {
 export type SettlePaymentError = ErrorResult & {
   __typename?: 'SettlePaymentError';
   __typename?: 'SettlePaymentError';
-  code: ErrorCode;
+  errorCode: ErrorCode;
   message: Scalars['String'];
   message: Scalars['String'];
   paymentErrorMessage: Scalars['String'];
   paymentErrorMessage: Scalars['String'];
 };
 };

+ 1 - 1
packages/core/e2e/auth.e2e-spec.ts

@@ -80,7 +80,7 @@ describe('Authorization & permissions', () => {
             it('cannot login', async () => {
             it('cannot login', async () => {
                 const result = await adminClient.asUserWithCredentials(customerEmailAddress, 'test');
                 const result = await adminClient.asUserWithCredentials(customerEmailAddress, 'test');
 
 
-                expect(result.code).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
+                expect(result.errorCode).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
             });
             });
         });
         });
 
 

+ 2 - 2
packages/core/e2e/authentication-strategy.e2e-spec.ts

@@ -74,7 +74,7 @@ describe('AuthenticationStrategy', () => {
             });
             });
 
 
             expect(authenticate.message).toBe('The provided credentials are invalid');
             expect(authenticate.message).toBe('The provided credentials are invalid');
-            expect(authenticate.code).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
+            expect(authenticate.errorCode).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
         });
         });
 
 
         it('creates a new Customer with valid token', async () => {
         it('creates a new Customer with valid token', async () => {
@@ -224,7 +224,7 @@ const AUTHENTICATE = gql`
         authenticate(input: $input) {
         authenticate(input: $input) {
             ...CurrentUser
             ...CurrentUser
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }

+ 2 - 2
packages/core/e2e/customer.e2e-spec.ts

@@ -448,7 +448,7 @@ describe('Customer resolver', () => {
             customerErrorGuard.assertErrorResult(createCustomer);
             customerErrorGuard.assertErrorResult(createCustomer);
 
 
             expect(createCustomer.message).toBe('The email address is not available.');
             expect(createCustomer.message).toBe('The email address is not available.');
-            expect(createCustomer.code).toBe(ErrorCode.EMAIL_ADDRESS_CONFLICT_ERROR);
+            expect(createCustomer.errorCode).toBe(ErrorCode.EMAIL_ADDRESS_CONFLICT_ERROR);
         });
         });
     });
     });
 
 
@@ -466,7 +466,7 @@ describe('Customer resolver', () => {
             customerErrorGuard.assertErrorResult(updateCustomer);
             customerErrorGuard.assertErrorResult(updateCustomer);
 
 
             expect(updateCustomer.message).toBe('The email address is not available.');
             expect(updateCustomer.message).toBe('The email address is not available.');
-            expect(updateCustomer.code).toBe(ErrorCode.EMAIL_ADDRESS_CONFLICT_ERROR);
+            expect(updateCustomer.errorCode).toBe(ErrorCode.EMAIL_ADDRESS_CONFLICT_ERROR);
         });
         });
 
 
         it('succeeds when emailAddress is available', async () => {
         it('succeeds when emailAddress is available', async () => {

+ 2 - 1
packages/core/e2e/default-search-plugin.e2e-spec.ts

@@ -16,6 +16,7 @@ import { TEST_SETUP_TIMEOUT_MS, testConfig } from '../../../e2e-common/test-conf
 
 
 import {
 import {
     AssignProductsToChannel,
     AssignProductsToChannel,
+    ChannelFragment,
     CreateChannel,
     CreateChannel,
     CreateCollection,
     CreateCollection,
     CreateFacet,
     CreateFacet,
@@ -869,7 +870,7 @@ describe('Default search plugin', () => {
 
 
         describe('channel handling', () => {
         describe('channel handling', () => {
             const SECOND_CHANNEL_TOKEN = 'second-channel-token';
             const SECOND_CHANNEL_TOKEN = 'second-channel-token';
-            let secondChannel: CreateChannel.CreateChannel;
+            let secondChannel: ChannelFragment;
 
 
             beforeAll(async () => {
             beforeAll(async () => {
                 const { createChannel } = await adminClient.query<
                 const { createChannel } = await adminClient.query<

+ 1 - 1
packages/core/e2e/global-settings.e2e-spec.ts

@@ -140,7 +140,7 @@ const UPDATE_GLOBAL_SETTINGS = gql`
         updateGlobalSettings(input: $input) {
         updateGlobalSettings(input: $input) {
             ...GlobalSettings
             ...GlobalSettings
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }

+ 57 - 59
packages/core/e2e/graphql/generated-e2e-admin-types.ts

@@ -109,7 +109,7 @@ export type AdministratorSortParameter = {
 
 
 /** Returned if an attempting to refund an OrderItem which has already been refunded */
 /** Returned if an attempting to refund an OrderItem which has already been refunded */
 export type AlreadyRefundedError = ErrorResult & {
 export type AlreadyRefundedError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     refundId: Scalars['ID'];
     refundId: Scalars['ID'];
 };
 };
@@ -208,7 +208,7 @@ export type BooleanOperators = {
 
 
 /** Returned if an attempting to cancel lines from an Order which is still active */
 /** Returned if an attempting to cancel lines from an Order which is still active */
 export type CancelActiveOrderError = ErrorResult & {
 export type CancelActiveOrderError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     orderState: Scalars['String'];
     orderState: Scalars['String'];
 };
 };
@@ -258,7 +258,7 @@ export type Channel = Node & {
  * of the GlobalSettings
  * of the GlobalSettings
  */
  */
 export type ChannelDefaultLanguageError = ErrorResult & {
 export type ChannelDefaultLanguageError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     language: Scalars['String'];
     language: Scalars['String'];
     channelCode: Scalars['String'];
     channelCode: Scalars['String'];
@@ -1141,13 +1141,13 @@ export enum DeletionResult {
 
 
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 export type EmailAddressConflictError = ErrorResult & {
 export type EmailAddressConflictError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned if no OrderLines have been specified for the operation */
 /** Returned if no OrderLines have been specified for the operation */
 export type EmptyOrderLineSelectionError = ErrorResult & {
 export type EmptyOrderLineSelectionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1178,7 +1178,7 @@ export enum ErrorCode {
 }
 }
 
 
 export type ErrorResult = {
 export type ErrorResult = {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1301,7 +1301,7 @@ export type Fulfillment = Node & {
 
 
 /** Returned when there is an error in transitioning the Fulfillment state */
 /** Returned when there is an error in transitioning the Fulfillment state */
 export type FulfillmentStateTransitionError = ErrorResult & {
 export type FulfillmentStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -1406,13 +1406,13 @@ export type IntCustomFieldConfig = CustomField & {
 
 
 /** Returned if the user authentication credentials are not valid */
 /** Returned if the user authentication credentials are not valid */
 export type InvalidCredentialsError = ErrorResult & {
 export type InvalidCredentialsError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned if the specified items are already part of a Fulfillment */
 /** Returned if the specified items are already part of a Fulfillment */
 export type ItemsAlreadyFulfilledError = ErrorResult & {
 export type ItemsAlreadyFulfilledError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1809,8 +1809,9 @@ export enum LanguageCode {
     zu = 'zu',
     zu = 'zu',
 }
 }
 
 
+/** Returned if attempting to set a Channel's defaultLanguageCode to a language which is not enabled in GlobalSettings */
 export type LanguageNotAvailableError = ErrorResult & {
 export type LanguageNotAvailableError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     languageCode: Scalars['String'];
     languageCode: Scalars['String'];
 };
 };
@@ -1838,7 +1839,7 @@ export enum LogicalOperator {
 }
 }
 
 
 export type MimeTypeError = ErrorResult & {
 export type MimeTypeError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     fileName: Scalars['String'];
     fileName: Scalars['String'];
     mimeType: Scalars['String'];
     mimeType: Scalars['String'];
@@ -1846,7 +1847,7 @@ export type MimeTypeError = ErrorResult & {
 
 
 /** Returned if a PromotionCondition has neither a couponCode nor any conditions set */
 /** Returned if a PromotionCondition has neither a couponCode nor any conditions set */
 export type MissingConditionsError = ErrorResult & {
 export type MissingConditionsError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1858,7 +1859,7 @@ export type MoveCollectionInput = {
 
 
 /** Returned if an operation has specified OrderLines from multiple Orders */
 /** Returned if an operation has specified OrderLines from multiple Orders */
 export type MultipleOrderError = ErrorResult & {
 export type MultipleOrderError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2413,7 +2414,7 @@ export type NativeAuthInput = {
 
 
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 export type NativeAuthStrategyError = ErrorResult & {
 export type NativeAuthStrategyError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2423,7 +2424,7 @@ export type Node = {
 
 
 /** Returned if an attempting to refund an Order but neither items nor shipping refund was specified */
 /** Returned if an attempting to refund an Order but neither items nor shipping refund was specified */
 export type NothingToRefundError = ErrorResult & {
 export type NothingToRefundError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2575,7 +2576,7 @@ export type OrderSortParameter = {
 
 
 /** Returned if there is an error in transitioning the Order state */
 /** Returned if there is an error in transitioning the Order state */
 export type OrderStateTransitionError = ErrorResult & {
 export type OrderStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -2638,13 +2639,13 @@ export type PaymentMethodSortParameter = {
 
 
 /** Returned if an attempting to refund a Payment against OrderLines from a different Order */
 /** Returned if an attempting to refund a Payment against OrderLines from a different Order */
 export type PaymentOrderMismatchError = ErrorResult & {
 export type PaymentOrderMismatchError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned when there is an error in transitioning the Payment state */
 /** Returned when there is an error in transitioning the Payment state */
 export type PaymentStateTransitionError = ErrorResult & {
 export type PaymentStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -2783,7 +2784,7 @@ export type ProductOptionGroupTranslationInput = {
 };
 };
 
 
 export type ProductOptionInUseError = ErrorResult & {
 export type ProductOptionInUseError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     optionGroupCode: Scalars['String'];
     optionGroupCode: Scalars['String'];
     productVariantCount: Scalars['Int'];
     productVariantCount: Scalars['Int'];
@@ -2967,7 +2968,7 @@ export type PromotionSortParameter = {
 
 
 /** Returned if the specified quantity of an OrderLine is greater than the number of items in that line */
 /** Returned if the specified quantity of an OrderLine is greater than the number of items in that line */
 export type QuantityTooGreatError = ErrorResult & {
 export type QuantityTooGreatError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -3231,14 +3232,14 @@ export type RefundOrderResult =
 
 
 /** Returned if an attempting to refund an Order which is not in the expected state */
 /** Returned if an attempting to refund an Order which is not in the expected state */
 export type RefundOrderStateError = ErrorResult & {
 export type RefundOrderStateError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     orderState: Scalars['String'];
     orderState: Scalars['String'];
 };
 };
 
 
 /** Returned when there is an error in transitioning the Refund state */
 /** Returned when there is an error in transitioning the Refund state */
 export type RefundStateTransitionError = ErrorResult & {
 export type RefundStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -3383,7 +3384,7 @@ export type ServerConfig = {
 
 
 /** Returned if the Payment settlement fails */
 /** Returned if the Payment settlement fails */
 export type SettlePaymentError = ErrorResult & {
 export type SettlePaymentError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
 };
 };
@@ -3924,7 +3925,7 @@ export type AuthenticateMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type AuthenticateMutation = {
 export type AuthenticateMutation = {
-    authenticate: CurrentUserFragment | Pick<InvalidCredentialsError, 'code' | 'message'>;
+    authenticate: CurrentUserFragment | Pick<InvalidCredentialsError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type GetCustomersQueryVariables = Exact<{ [key: string]: never }>;
 export type GetCustomersQueryVariables = Exact<{ [key: string]: never }>;
@@ -4329,7 +4330,7 @@ export type UpdateGlobalSettingsMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type UpdateGlobalSettingsMutation = {
 export type UpdateGlobalSettingsMutation = {
-    updateGlobalSettings: GlobalSettingsFragment | Pick<ChannelDefaultLanguageError, 'code' | 'message'>;
+    updateGlobalSettings: GlobalSettingsFragment | Pick<ChannelDefaultLanguageError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type AdministratorFragment = Pick<Administrator, 'id' | 'firstName' | 'lastName' | 'emailAddress'> & {
 export type AdministratorFragment = Pick<Administrator, 'id' | 'firstName' | 'lastName' | 'emailAddress'> & {
@@ -4720,7 +4721,7 @@ export type CreatePromotionMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type CreatePromotionMutation = {
 export type CreatePromotionMutation = {
-    createPromotion: PromotionFragment | Pick<MissingConditionsError, 'code' | 'message'>;
+    createPromotion: PromotionFragment | Pick<MissingConditionsError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type MeQueryVariables = Exact<{ [key: string]: never }>;
 export type MeQueryVariables = Exact<{ [key: string]: never }>;
@@ -4734,9 +4735,7 @@ export type CreateChannelMutationVariables = Exact<{
 export type CreateChannelMutation = {
 export type CreateChannelMutation = {
     createChannel:
     createChannel:
         | ChannelFragment
         | ChannelFragment
-        | (Pick<LanguageNotAvailableError, 'message' | 'languageCode'> & {
-              errorCode: LanguageNotAvailableError['code'];
-          });
+        | Pick<LanguageNotAvailableError, 'errorCode' | 'message' | 'languageCode'>;
 };
 };
 
 
 export type DeleteProductVariantMutationVariables = Exact<{
 export type DeleteProductVariantMutationVariables = Exact<{
@@ -4783,9 +4782,7 @@ export type UpdateChannelMutationVariables = Exact<{
 export type UpdateChannelMutation = {
 export type UpdateChannelMutation = {
     updateChannel:
     updateChannel:
         | ChannelFragment
         | ChannelFragment
-        | (Pick<LanguageNotAvailableError, 'message' | 'languageCode'> & {
-              errorCode: LanguageNotAvailableError['code'];
-          });
+        | Pick<LanguageNotAvailableError, 'errorCode' | 'message' | 'languageCode'>;
 };
 };
 
 
 export type GetCustomerHistoryQueryVariables = Exact<{
 export type GetCustomerHistoryQueryVariables = Exact<{
@@ -4837,8 +4834,8 @@ export type CreateFulfillmentMutationVariables = Exact<{
 export type CreateFulfillmentMutation = {
 export type CreateFulfillmentMutation = {
     addFulfillmentToOrder:
     addFulfillmentToOrder:
         | FulfillmentFragment
         | FulfillmentFragment
-        | Pick<EmptyOrderLineSelectionError, 'code' | 'message'>
-        | Pick<ItemsAlreadyFulfilledError, 'code' | 'message'>;
+        | Pick<EmptyOrderLineSelectionError, 'errorCode' | 'message'>
+        | Pick<ItemsAlreadyFulfilledError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type TransitFulfillmentMutationVariables = Exact<{
 export type TransitFulfillmentMutationVariables = Exact<{
@@ -4851,7 +4848,7 @@ export type TransitFulfillmentMutation = {
         | FulfillmentFragment
         | FulfillmentFragment
         | Pick<
         | Pick<
               FulfillmentStateTransitionError,
               FulfillmentStateTransitionError,
-              'code' | 'message' | 'transitionError' | 'fromState' | 'toState'
+              'errorCode' | 'message' | 'transitionError' | 'fromState' | 'toState'
           >;
           >;
 };
 };
 
 
@@ -4911,7 +4908,7 @@ export type CreateCustomerMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type CreateCustomerMutation = {
 export type CreateCustomerMutation = {
-    createCustomer: CustomerFragment | Pick<EmailAddressConflictError, 'code' | 'message'>;
+    createCustomer: CustomerFragment | Pick<EmailAddressConflictError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type UpdateCustomerMutationVariables = Exact<{
 export type UpdateCustomerMutationVariables = Exact<{
@@ -4919,7 +4916,7 @@ export type UpdateCustomerMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type UpdateCustomerMutation = {
 export type UpdateCustomerMutation = {
-    updateCustomer: CustomerFragment | Pick<EmailAddressConflictError, 'code' | 'message'>;
+    updateCustomer: CustomerFragment | Pick<EmailAddressConflictError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type DeleteCustomerMutationVariables = Exact<{
 export type DeleteCustomerMutationVariables = Exact<{
@@ -5002,9 +4999,10 @@ export type AdminTransitionMutationVariables = Exact<{
 export type AdminTransitionMutation = {
 export type AdminTransitionMutation = {
     transitionOrderToState?: Maybe<
     transitionOrderToState?: Maybe<
         | OrderFragment
         | OrderFragment
-        | (Pick<OrderStateTransitionError, 'message' | 'transitionError' | 'fromState' | 'toState'> & {
-              errorCode: OrderStateTransitionError['code'];
-          })
+        | Pick<
+              OrderStateTransitionError,
+              'errorCode' | 'message' | 'transitionError' | 'fromState' | 'toState'
+          >
     >;
     >;
 };
 };
 
 
@@ -5041,9 +5039,9 @@ export type SettlePaymentMutationVariables = Exact<{
 export type SettlePaymentMutation = {
 export type SettlePaymentMutation = {
     settlePayment:
     settlePayment:
         | PaymentFragment
         | PaymentFragment
-        | Pick<SettlePaymentError, 'code' | 'message' | 'paymentErrorMessage'>
-        | Pick<PaymentStateTransitionError, 'code' | 'message'>
-        | Pick<OrderStateTransitionError, 'code' | 'message'>;
+        | Pick<SettlePaymentError, 'errorCode' | 'message' | 'paymentErrorMessage'>
+        | Pick<PaymentStateTransitionError, 'errorCode' | 'message'>
+        | Pick<OrderStateTransitionError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type PaymentFragment = Pick<Payment, 'id' | 'state' | 'metadata'>;
 export type PaymentFragment = Pick<Payment, 'id' | 'state' | 'metadata'>;
@@ -5075,11 +5073,11 @@ export type CancelOrderMutationVariables = Exact<{
 export type CancelOrderMutation = {
 export type CancelOrderMutation = {
     cancelOrder:
     cancelOrder:
         | CanceledOrderFragment
         | CanceledOrderFragment
-        | Pick<EmptyOrderLineSelectionError, 'code' | 'message'>
-        | Pick<QuantityTooGreatError, 'code' | 'message'>
-        | Pick<MultipleOrderError, 'code' | 'message'>
-        | Pick<CancelActiveOrderError, 'code' | 'message'>
-        | Pick<OrderStateTransitionError, 'code' | 'message'>;
+        | Pick<EmptyOrderLineSelectionError, 'errorCode' | 'message'>
+        | Pick<QuantityTooGreatError, 'errorCode' | 'message'>
+        | Pick<MultipleOrderError, 'errorCode' | 'message'>
+        | Pick<CancelActiveOrderError, 'errorCode' | 'message'>
+        | Pick<OrderStateTransitionError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type CanceledOrderFragment = Pick<Order, 'id'> & {
 export type CanceledOrderFragment = Pick<Order, 'id'> & {
@@ -5098,14 +5096,14 @@ export type RefundOrderMutationVariables = Exact<{
 export type RefundOrderMutation = {
 export type RefundOrderMutation = {
     refundOrder:
     refundOrder:
         | RefundFragment
         | RefundFragment
-        | Pick<QuantityTooGreatError, 'code' | 'message'>
-        | Pick<NothingToRefundError, 'code' | 'message'>
-        | Pick<OrderStateTransitionError, 'code' | 'message'>
-        | Pick<MultipleOrderError, 'code' | 'message'>
-        | Pick<PaymentOrderMismatchError, 'code' | 'message'>
-        | Pick<RefundOrderStateError, 'code' | 'message'>
-        | Pick<AlreadyRefundedError, 'code' | 'message'>
-        | Pick<RefundStateTransitionError, 'code' | 'message'>;
+        | Pick<QuantityTooGreatError, 'errorCode' | 'message'>
+        | Pick<NothingToRefundError, 'errorCode' | 'message'>
+        | Pick<OrderStateTransitionError, 'errorCode' | 'message'>
+        | Pick<MultipleOrderError, 'errorCode' | 'message'>
+        | Pick<PaymentOrderMismatchError, 'errorCode' | 'message'>
+        | Pick<RefundOrderStateError, 'errorCode' | 'message'>
+        | Pick<AlreadyRefundedError, 'errorCode' | 'message'>
+        | Pick<RefundStateTransitionError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type SettleRefundMutationVariables = Exact<{
 export type SettleRefundMutationVariables = Exact<{
@@ -5113,7 +5111,7 @@ export type SettleRefundMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type SettleRefundMutation = {
 export type SettleRefundMutation = {
-    settleRefund: RefundFragment | Pick<RefundStateTransitionError, 'code' | 'message'>;
+    settleRefund: RefundFragment | Pick<RefundStateTransitionError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type GetOrderHistoryQueryVariables = Exact<{
 export type GetOrderHistoryQueryVariables = Exact<{
@@ -5209,7 +5207,7 @@ export type RemoveOptionGroupFromProductMutationVariables = Exact<{
 export type RemoveOptionGroupFromProductMutation = {
 export type RemoveOptionGroupFromProductMutation = {
     removeOptionGroupFromProduct:
     removeOptionGroupFromProduct:
         | ProductWithOptionsFragment
         | ProductWithOptionsFragment
-        | Pick<ProductOptionInUseError, 'code' | 'message' | 'optionGroupCode' | 'productVariantCount'>;
+        | Pick<ProductOptionInUseError, 'errorCode' | 'message' | 'optionGroupCode' | 'productVariantCount'>;
 };
 };
 
 
 export type GetOptionGroupQueryVariables = Exact<{
 export type GetOptionGroupQueryVariables = Exact<{
@@ -5253,7 +5251,7 @@ export type UpdatePromotionMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type UpdatePromotionMutation = {
 export type UpdatePromotionMutation = {
-    updatePromotion: PromotionFragment | Pick<MissingConditionsError, 'code' | 'message'>;
+    updatePromotion: PromotionFragment | Pick<MissingConditionsError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type ConfigurableOperationDefFragment = Pick<
 export type ConfigurableOperationDefFragment = Pick<

+ 67 - 74
packages/core/e2e/graphql/generated-e2e-shop-types.ts

@@ -75,7 +75,7 @@ export type AdministratorList = PaginatedList & {
 
 
 /** Retured when attemting to set the Customer for an Order when already logged in. */
 /** Retured when attemting to set the Customer for an Order when already logged in. */
 export type AlreadyLoggedInError = ErrorResult & {
 export type AlreadyLoggedInError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -300,21 +300,21 @@ export type CountryTranslation = {
 
 
 /** Returned if the provided coupon code is invalid */
 /** Returned if the provided coupon code is invalid */
 export type CouponCodeExpiredError = ErrorResult & {
 export type CouponCodeExpiredError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     couponCode: Scalars['String'];
     couponCode: Scalars['String'];
 };
 };
 
 
 /** Returned if the provided coupon code is invalid */
 /** Returned if the provided coupon code is invalid */
 export type CouponCodeInvalidError = ErrorResult & {
 export type CouponCodeInvalidError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     couponCode: Scalars['String'];
     couponCode: Scalars['String'];
 };
 };
 
 
 /** Returned if the provided coupon code is invalid */
 /** Returned if the provided coupon code is invalid */
 export type CouponCodeLimitError = ErrorResult & {
 export type CouponCodeLimitError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     couponCode: Scalars['String'];
     couponCode: Scalars['String'];
     limit: Scalars['Int'];
     limit: Scalars['Int'];
@@ -822,7 +822,7 @@ export enum DeletionResult {
 
 
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 export type EmailAddressConflictError = ErrorResult & {
 export type EmailAddressConflictError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -853,7 +853,7 @@ export enum ErrorCode {
 }
 }
 
 
 export type ErrorResult = {
 export type ErrorResult = {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1010,7 +1010,7 @@ export enum HistoryEntryType {
  * expired according to the `verificationTokenDuration` setting in the AuthOptions.
  * expired according to the `verificationTokenDuration` setting in the AuthOptions.
  */
  */
 export type IdentifierChangeTokenExpiredError = ErrorResult & {
 export type IdentifierChangeTokenExpiredError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1019,7 +1019,7 @@ export type IdentifierChangeTokenExpiredError = ErrorResult & {
  * invalid or does not match any expected tokens.
  * invalid or does not match any expected tokens.
  */
  */
 export type IdentifierChangeTokenInvalidError = ErrorResult & {
 export type IdentifierChangeTokenInvalidError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1044,7 +1044,7 @@ export type IntCustomFieldConfig = CustomField & {
 
 
 /** Returned if the user authentication credentials are not valid */
 /** Returned if the user authentication credentials are not valid */
 export type InvalidCredentialsError = ErrorResult & {
 export type InvalidCredentialsError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1398,7 +1398,7 @@ export enum LogicalOperator {
 
 
 /** Retured when attemting to register or verify a customer account without a password, when one is required. */
 /** Retured when attemting to register or verify a customer account without a password, when one is required. */
 export type MissingPasswordError = ErrorResult & {
 export type MissingPasswordError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1629,13 +1629,13 @@ export type NativeAuthInput = {
 
 
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 export type NativeAuthStrategyError = ErrorResult & {
 export type NativeAuthStrategyError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Retured when attemting to set a negative OrderLine quantity. */
 /** Retured when attemting to set a negative OrderLine quantity. */
 export type NegativeQuantityError = ErrorResult & {
 export type NegativeQuantityError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1738,7 +1738,7 @@ export type OrderItem = Node & {
 
 
 /** Retured when the maximum order size limit has been reached. */
 /** Retured when the maximum order size limit has been reached. */
 export type OrderLimitError = ErrorResult & {
 export type OrderLimitError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     maxItems: Scalars['Int'];
     maxItems: Scalars['Int'];
 };
 };
@@ -1773,13 +1773,13 @@ export type OrderListOptions = {
 
 
 /** Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. */
 /** Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. */
 export type OrderModificationError = ErrorResult & {
 export type OrderModificationError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. */
 /** Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. */
 export type OrderPaymentStateError = ErrorResult & {
 export type OrderPaymentStateError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1804,7 +1804,7 @@ export type OrderSortParameter = {
 
 
 /** Returned if there is an error in transitioning the Order state */
 /** Returned if there is an error in transitioning the Order state */
 export type OrderStateTransitionError = ErrorResult & {
 export type OrderStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -1818,7 +1818,7 @@ export type PaginatedList = {
 
 
 /** Retured when attemting to verify a customer account with a password, when a password has already been set. */
 /** Retured when attemting to verify a customer account with a password, when a password has already been set. */
 export type PasswordAlreadySetError = ErrorResult & {
 export type PasswordAlreadySetError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1827,7 +1827,7 @@ export type PasswordAlreadySetError = ErrorResult & {
  * expired according to the `verificationTokenDuration` setting in the AuthOptions.
  * expired according to the `verificationTokenDuration` setting in the AuthOptions.
  */
  */
 export type PasswordResetTokenExpiredError = ErrorResult & {
 export type PasswordResetTokenExpiredError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1836,7 +1836,7 @@ export type PasswordResetTokenExpiredError = ErrorResult & {
  * invalid or does not match any expected tokens.
  * invalid or does not match any expected tokens.
  */
  */
 export type PasswordResetTokenInvalidError = ErrorResult & {
 export type PasswordResetTokenInvalidError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1855,14 +1855,14 @@ export type Payment = Node & {
 
 
 /** Returned when a Payment is declined by the payment provider. */
 /** Returned when a Payment is declined by the payment provider. */
 export type PaymentDeclinedError = ErrorResult & {
 export type PaymentDeclinedError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
 };
 };
 
 
 /** Returned when a Payment fails due to an error. */
 /** Returned when a Payment fails due to an error. */
 export type PaymentFailedError = ErrorResult & {
 export type PaymentFailedError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
 };
 };
@@ -2525,7 +2525,7 @@ export type User = Node & {
  * expired according to the `verificationTokenDuration` setting in the AuthOptions.
  * expired according to the `verificationTokenDuration` setting in the AuthOptions.
  */
  */
 export type VerificationTokenExpiredError = ErrorResult & {
 export type VerificationTokenExpiredError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2534,7 +2534,7 @@ export type VerificationTokenExpiredError = ErrorResult & {
  * invalid or does not match any expected tokens.
  * invalid or does not match any expected tokens.
  */
  */
 export type VerificationTokenInvalidError = ErrorResult & {
 export type VerificationTokenInvalidError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2588,9 +2588,9 @@ export type AddItemToOrderMutationVariables = Exact<{
 export type AddItemToOrderMutation = {
 export type AddItemToOrderMutation = {
     addItemToOrder:
     addItemToOrder:
         | UpdatedOrderFragment
         | UpdatedOrderFragment
-        | (Pick<OrderModificationError, 'message'> & { errorCode: OrderModificationError['code'] })
-        | (Pick<OrderLimitError, 'message'> & { errorCode: OrderLimitError['code'] })
-        | (Pick<NegativeQuantityError, 'message'> & { errorCode: NegativeQuantityError['code'] });
+        | Pick<OrderModificationError, 'errorCode' | 'message'>
+        | Pick<OrderLimitError, 'errorCode' | 'message'>
+        | Pick<NegativeQuantityError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type SearchProductsShopQueryVariables = Exact<{
 export type SearchProductsShopQueryVariables = Exact<{
@@ -2622,8 +2622,8 @@ export type RegisterMutationVariables = Exact<{
 export type RegisterMutation = {
 export type RegisterMutation = {
     registerCustomerAccount:
     registerCustomerAccount:
         | Pick<Success, 'success'>
         | Pick<Success, 'success'>
-        | Pick<MissingPasswordError, 'code' | 'message'>
-        | Pick<NativeAuthStrategyError, 'code' | 'message'>;
+        | Pick<MissingPasswordError, 'errorCode' | 'message'>
+        | Pick<NativeAuthStrategyError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type CurrentUserShopFragment = Pick<CurrentUser, 'id' | 'identifier'> & {
 export type CurrentUserShopFragment = Pick<CurrentUser, 'id' | 'identifier'> & {
@@ -2638,11 +2638,11 @@ export type VerifyMutationVariables = Exact<{
 export type VerifyMutation = {
 export type VerifyMutation = {
     verifyCustomerAccount:
     verifyCustomerAccount:
         | CurrentUserShopFragment
         | CurrentUserShopFragment
-        | Pick<VerificationTokenInvalidError, 'code' | 'message'>
-        | Pick<VerificationTokenExpiredError, 'code' | 'message'>
-        | Pick<MissingPasswordError, 'code' | 'message'>
-        | Pick<PasswordAlreadySetError, 'code' | 'message'>
-        | Pick<NativeAuthStrategyError, 'code' | 'message'>;
+        | Pick<VerificationTokenInvalidError, 'errorCode' | 'message'>
+        | Pick<VerificationTokenExpiredError, 'errorCode' | 'message'>
+        | Pick<MissingPasswordError, 'errorCode' | 'message'>
+        | Pick<PasswordAlreadySetError, 'errorCode' | 'message'>
+        | Pick<NativeAuthStrategyError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type RefreshTokenMutationVariables = Exact<{
 export type RefreshTokenMutationVariables = Exact<{
@@ -2650,7 +2650,9 @@ export type RefreshTokenMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type RefreshTokenMutation = {
 export type RefreshTokenMutation = {
-    refreshCustomerVerification: Pick<Success, 'success'> | Pick<NativeAuthStrategyError, 'code' | 'message'>;
+    refreshCustomerVerification:
+        | Pick<Success, 'success'>
+        | Pick<NativeAuthStrategyError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type RequestPasswordResetMutationVariables = Exact<{
 export type RequestPasswordResetMutationVariables = Exact<{
@@ -2659,7 +2661,7 @@ export type RequestPasswordResetMutationVariables = Exact<{
 
 
 export type RequestPasswordResetMutation = {
 export type RequestPasswordResetMutation = {
     requestPasswordReset?: Maybe<
     requestPasswordReset?: Maybe<
-        Pick<Success, 'success'> | Pick<NativeAuthStrategyError, 'code' | 'message'>
+        Pick<Success, 'success'> | Pick<NativeAuthStrategyError, 'errorCode' | 'message'>
     >;
     >;
 };
 };
 
 
@@ -2671,9 +2673,9 @@ export type ResetPasswordMutationVariables = Exact<{
 export type ResetPasswordMutation = {
 export type ResetPasswordMutation = {
     resetPassword:
     resetPassword:
         | CurrentUserShopFragment
         | CurrentUserShopFragment
-        | Pick<PasswordResetTokenInvalidError, 'code' | 'message'>
-        | Pick<PasswordResetTokenExpiredError, 'code' | 'message'>
-        | Pick<NativeAuthStrategyError, 'code' | 'message'>;
+        | Pick<PasswordResetTokenInvalidError, 'errorCode' | 'message'>
+        | Pick<PasswordResetTokenExpiredError, 'errorCode' | 'message'>
+        | Pick<NativeAuthStrategyError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type RequestUpdateEmailAddressMutationVariables = Exact<{
 export type RequestUpdateEmailAddressMutationVariables = Exact<{
@@ -2684,9 +2686,9 @@ export type RequestUpdateEmailAddressMutationVariables = Exact<{
 export type RequestUpdateEmailAddressMutation = {
 export type RequestUpdateEmailAddressMutation = {
     requestUpdateCustomerEmailAddress:
     requestUpdateCustomerEmailAddress:
         | Pick<Success, 'success'>
         | Pick<Success, 'success'>
-        | Pick<InvalidCredentialsError, 'code' | 'message'>
-        | Pick<EmailAddressConflictError, 'code' | 'message'>
-        | Pick<NativeAuthStrategyError, 'code' | 'message'>;
+        | Pick<InvalidCredentialsError, 'errorCode' | 'message'>
+        | Pick<EmailAddressConflictError, 'errorCode' | 'message'>
+        | Pick<NativeAuthStrategyError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type UpdateEmailAddressMutationVariables = Exact<{
 export type UpdateEmailAddressMutationVariables = Exact<{
@@ -2696,9 +2698,9 @@ export type UpdateEmailAddressMutationVariables = Exact<{
 export type UpdateEmailAddressMutation = {
 export type UpdateEmailAddressMutation = {
     updateCustomerEmailAddress:
     updateCustomerEmailAddress:
         | Pick<Success, 'success'>
         | Pick<Success, 'success'>
-        | Pick<IdentifierChangeTokenInvalidError, 'code' | 'message'>
-        | Pick<IdentifierChangeTokenExpiredError, 'code' | 'message'>
-        | Pick<NativeAuthStrategyError, 'code' | 'message'>;
+        | Pick<IdentifierChangeTokenInvalidError, 'errorCode' | 'message'>
+        | Pick<IdentifierChangeTokenExpiredError, 'errorCode' | 'message'>
+        | Pick<NativeAuthStrategyError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type GetActiveCustomerQueryVariables = Exact<{ [key: string]: never }>;
 export type GetActiveCustomerQueryVariables = Exact<{ [key: string]: never }>;
@@ -2741,8 +2743,8 @@ export type UpdatePasswordMutationVariables = Exact<{
 export type UpdatePasswordMutation = {
 export type UpdatePasswordMutation = {
     updateCustomerPassword:
     updateCustomerPassword:
         | Pick<Success, 'success'>
         | Pick<Success, 'success'>
-        | Pick<InvalidCredentialsError, 'code' | 'message'>
-        | Pick<NativeAuthStrategyError, 'code' | 'message'>;
+        | Pick<InvalidCredentialsError, 'errorCode' | 'message'>
+        | Pick<NativeAuthStrategyError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type GetActiveOrderQueryVariables = Exact<{ [key: string]: never }>;
 export type GetActiveOrderQueryVariables = Exact<{ [key: string]: never }>;
@@ -2757,9 +2759,9 @@ export type AdjustItemQuantityMutationVariables = Exact<{
 export type AdjustItemQuantityMutation = {
 export type AdjustItemQuantityMutation = {
     adjustOrderLine:
     adjustOrderLine:
         | TestOrderFragmentFragment
         | TestOrderFragmentFragment
-        | (Pick<OrderModificationError, 'message'> & { errorCode: OrderModificationError['code'] })
-        | (Pick<OrderLimitError, 'message'> & { errorCode: OrderLimitError['code'] })
-        | (Pick<NegativeQuantityError, 'message'> & { errorCode: NegativeQuantityError['code'] });
+        | Pick<OrderModificationError, 'errorCode' | 'message'>
+        | Pick<OrderLimitError, 'errorCode' | 'message'>
+        | Pick<NegativeQuantityError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type RemoveItemFromOrderMutationVariables = Exact<{
 export type RemoveItemFromOrderMutationVariables = Exact<{
@@ -2767,9 +2769,7 @@ export type RemoveItemFromOrderMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type RemoveItemFromOrderMutation = {
 export type RemoveItemFromOrderMutation = {
-    removeOrderLine:
-        | TestOrderFragmentFragment
-        | (Pick<OrderModificationError, 'message'> & { errorCode: OrderModificationError['code'] });
+    removeOrderLine: TestOrderFragmentFragment | Pick<OrderModificationError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type GetShippingMethodsQueryVariables = Exact<{ [key: string]: never }>;
 export type GetShippingMethodsQueryVariables = Exact<{ [key: string]: never }>;
@@ -2783,9 +2783,7 @@ export type SetShippingMethodMutationVariables = Exact<{
 }>;
 }>;
 
 
 export type SetShippingMethodMutation = {
 export type SetShippingMethodMutation = {
-    setOrderShippingMethod:
-        | TestOrderFragmentFragment
-        | (Pick<OrderModificationError, 'message'> & { errorCode: OrderModificationError['code'] });
+    setOrderShippingMethod: TestOrderFragmentFragment | Pick<OrderModificationError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type ActiveOrderCustomerFragment = Pick<Order, 'id'> & {
 export type ActiveOrderCustomerFragment = Pick<Order, 'id'> & {
@@ -2800,8 +2798,8 @@ export type SetCustomerForOrderMutationVariables = Exact<{
 export type SetCustomerForOrderMutation = {
 export type SetCustomerForOrderMutation = {
     setCustomerForOrder?: Maybe<
     setCustomerForOrder?: Maybe<
         | ActiveOrderCustomerFragment
         | ActiveOrderCustomerFragment
-        | (Pick<AlreadyLoggedInError, 'message'> & { errorCode: AlreadyLoggedInError['code'] })
-        | (Pick<EmailAddressConflictError, 'message'> & { errorCode: EmailAddressConflictError['code'] })
+        | Pick<AlreadyLoggedInError, 'errorCode' | 'message'>
+        | Pick<EmailAddressConflictError, 'errorCode' | 'message'>
     >;
     >;
 };
 };
 
 
@@ -2830,9 +2828,10 @@ export type TransitionToStateMutationVariables = Exact<{
 export type TransitionToStateMutation = {
 export type TransitionToStateMutation = {
     transitionOrderToState?: Maybe<
     transitionOrderToState?: Maybe<
         | TestOrderFragmentFragment
         | TestOrderFragmentFragment
-        | (Pick<OrderStateTransitionError, 'message' | 'transitionError' | 'fromState' | 'toState'> & {
-              errorCode: OrderStateTransitionError['code'];
-          })
+        | Pick<
+              OrderStateTransitionError,
+              'errorCode' | 'message' | 'transitionError' | 'fromState' | 'toState'
+          >
     >;
     >;
 };
 };
 
 
@@ -2899,14 +2898,10 @@ export type AddPaymentToOrderMutationVariables = Exact<{
 export type AddPaymentToOrderMutation = {
 export type AddPaymentToOrderMutation = {
     addPaymentToOrder?: Maybe<
     addPaymentToOrder?: Maybe<
         | TestOrderWithPaymentsFragment
         | TestOrderWithPaymentsFragment
-        | (Pick<OrderPaymentStateError, 'message'> & { errorCode: OrderPaymentStateError['code'] })
-        | (Pick<PaymentFailedError, 'message' | 'paymentErrorMessage'> & {
-              errorCode: PaymentFailedError['code'];
-          })
-        | (Pick<PaymentDeclinedError, 'message' | 'paymentErrorMessage'> & {
-              errorCode: PaymentDeclinedError['code'];
-          })
-        | (Pick<OrderStateTransitionError, 'message'> & { errorCode: OrderStateTransitionError['code'] })
+        | Pick<OrderPaymentStateError, 'errorCode' | 'message'>
+        | Pick<PaymentFailedError, 'errorCode' | 'message' | 'paymentErrorMessage'>
+        | Pick<PaymentDeclinedError, 'errorCode' | 'message' | 'paymentErrorMessage'>
+        | Pick<OrderStateTransitionError, 'errorCode' | 'message'>
     >;
     >;
 };
 };
 
 
@@ -2952,9 +2947,9 @@ export type ApplyCouponCodeMutationVariables = Exact<{
 export type ApplyCouponCodeMutation = {
 export type ApplyCouponCodeMutation = {
     applyCouponCode:
     applyCouponCode:
         | TestOrderFragmentFragment
         | TestOrderFragmentFragment
-        | (Pick<CouponCodeExpiredError, 'message'> & { errorCode: CouponCodeExpiredError['code'] })
-        | (Pick<CouponCodeInvalidError, 'message'> & { errorCode: CouponCodeInvalidError['code'] })
-        | (Pick<CouponCodeLimitError, 'message'> & { errorCode: CouponCodeLimitError['code'] });
+        | Pick<CouponCodeExpiredError, 'errorCode' | 'message'>
+        | Pick<CouponCodeInvalidError, 'errorCode' | 'message'>
+        | Pick<CouponCodeLimitError, 'errorCode' | 'message'>;
 };
 };
 
 
 export type RemoveCouponCodeMutationVariables = Exact<{
 export type RemoveCouponCodeMutationVariables = Exact<{
@@ -2966,9 +2961,7 @@ export type RemoveCouponCodeMutation = { removeCouponCode?: Maybe<TestOrderFragm
 export type RemoveAllOrderLinesMutationVariables = Exact<{ [key: string]: never }>;
 export type RemoveAllOrderLinesMutationVariables = Exact<{ [key: string]: never }>;
 
 
 export type RemoveAllOrderLinesMutation = {
 export type RemoveAllOrderLinesMutation = {
-    removeAllOrderLines:
-        | TestOrderFragmentFragment
-        | (Pick<OrderModificationError, 'message'> & { errorCode: OrderModificationError['code'] });
+    removeAllOrderLines: TestOrderFragmentFragment | Pick<OrderModificationError, 'errorCode' | 'message'>;
 };
 };
 
 
 type DiscriminateUnion<T, U> = T extends U ? T : never;
 type DiscriminateUnion<T, U> = T extends U ? T : never;

+ 8 - 8
packages/core/e2e/graphql/shared-definitions.ts

@@ -289,7 +289,7 @@ export const CREATE_PROMOTION = gql`
         createPromotion(input: $input) {
         createPromotion(input: $input) {
             ...Promotion
             ...Promotion
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -310,7 +310,7 @@ export const CREATE_CHANNEL = gql`
         createChannel(input: $input) {
         createChannel(input: $input) {
             ...Channel
             ...Channel
             ... on LanguageNotAvailableError {
             ... on LanguageNotAvailableError {
-                errorCode: code
+                errorCode
                 message
                 message
                 languageCode
                 languageCode
             }
             }
@@ -375,7 +375,7 @@ export const UPDATE_CHANNEL = gql`
         updateChannel(input: $input) {
         updateChannel(input: $input) {
             ...Channel
             ...Channel
             ... on LanguageNotAvailableError {
             ... on LanguageNotAvailableError {
-                errorCode: code
+                errorCode
                 message
                 message
                 languageCode
                 languageCode
             }
             }
@@ -448,7 +448,7 @@ export const CREATE_FULFILLMENT = gql`
         addFulfillmentToOrder(input: $input) {
         addFulfillmentToOrder(input: $input) {
             ...Fulfillment
             ...Fulfillment
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -461,7 +461,7 @@ export const TRANSIT_FULFILLMENT = gql`
         transitionFulfillmentToState(id: $id, state: $state) {
         transitionFulfillmentToState(id: $id, state: $state) {
             ...Fulfillment
             ...Fulfillment
             ... on FulfillmentStateTransitionError {
             ... on FulfillmentStateTransitionError {
-                code
+                errorCode
                 message
                 message
                 transitionError
                 transitionError
                 fromState
                 fromState
@@ -540,7 +540,7 @@ export const CREATE_CUSTOMER = gql`
         createCustomer(input: $input, password: $password) {
         createCustomer(input: $input, password: $password) {
             ...Customer
             ...Customer
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -553,7 +553,7 @@ export const UPDATE_CUSTOMER = gql`
         updateCustomer(input: $input) {
         updateCustomer(input: $input) {
             ...Customer
             ...Customer
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -659,7 +659,7 @@ export const ADMIN_TRANSITION_TO_STATE = gql`
         transitionOrderToState(id: $id, state: $state) {
         transitionOrderToState(id: $id, state: $state) {
             ...Order
             ...Order
             ... on OrderStateTransitionError {
             ... on OrderStateTransitionError {
-                errorCode: code
+                errorCode
                 message
                 message
                 transitionError
                 transitionError
                 fromState
                 fromState

+ 17 - 17
packages/core/e2e/graphql/shop-definitions.ts

@@ -84,7 +84,7 @@ export const ADD_ITEM_TO_ORDER = gql`
         addItemToOrder(productVariantId: $productVariantId, quantity: $quantity) {
         addItemToOrder(productVariantId: $productVariantId, quantity: $quantity) {
             ...UpdatedOrder
             ...UpdatedOrder
             ... on ErrorResult {
             ... on ErrorResult {
-                errorCode: code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -124,7 +124,7 @@ export const REGISTER_ACCOUNT = gql`
                 success
                 success
             }
             }
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -148,7 +148,7 @@ export const VERIFY_EMAIL = gql`
         verifyCustomerAccount(password: $password, token: $token) {
         verifyCustomerAccount(password: $password, token: $token) {
             ...CurrentUserShop
             ...CurrentUserShop
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -163,7 +163,7 @@ export const REFRESH_TOKEN = gql`
                 success
                 success
             }
             }
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -176,7 +176,7 @@ export const REQUEST_PASSWORD_RESET = gql`
                 success
                 success
             }
             }
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -187,7 +187,7 @@ export const RESET_PASSWORD = gql`
         resetPassword(token: $token, password: $password) {
         resetPassword(token: $token, password: $password) {
             ...CurrentUserShop
             ...CurrentUserShop
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -201,7 +201,7 @@ export const REQUEST_UPDATE_EMAIL_ADDRESS = gql`
                 success
                 success
             }
             }
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -214,7 +214,7 @@ export const UPDATE_EMAIL_ADDRESS = gql`
                 success
                 success
             }
             }
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -274,7 +274,7 @@ export const UPDATE_PASSWORD = gql`
                 success
                 success
             }
             }
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -295,7 +295,7 @@ export const ADJUST_ITEM_QUANTITY = gql`
         adjustOrderLine(orderLineId: $orderLineId, quantity: $quantity) {
         adjustOrderLine(orderLineId: $orderLineId, quantity: $quantity) {
             ...TestOrderFragment
             ...TestOrderFragment
             ... on ErrorResult {
             ... on ErrorResult {
-                errorCode: code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -308,7 +308,7 @@ export const REMOVE_ITEM_FROM_ORDER = gql`
         removeOrderLine(orderLineId: $orderLineId) {
         removeOrderLine(orderLineId: $orderLineId) {
             ...TestOrderFragment
             ...TestOrderFragment
             ... on ErrorResult {
             ... on ErrorResult {
-                errorCode: code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -331,7 +331,7 @@ export const SET_SHIPPING_METHOD = gql`
         setOrderShippingMethod(shippingMethodId: $id) {
         setOrderShippingMethod(shippingMethodId: $id) {
             ...TestOrderFragment
             ...TestOrderFragment
             ... on ErrorResult {
             ... on ErrorResult {
-                errorCode: code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -359,7 +359,7 @@ export const SET_CUSTOMER = gql`
         setCustomerForOrder(input: $input) {
         setCustomerForOrder(input: $input) {
             ...ActiveOrderCustomer
             ...ActiveOrderCustomer
             ... on ErrorResult {
             ... on ErrorResult {
-                errorCode: code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -403,7 +403,7 @@ export const TRANSITION_TO_STATE = gql`
         transitionOrderToState(state: $state) {
         transitionOrderToState(state: $state) {
             ...TestOrderFragment
             ...TestOrderFragment
             ... on OrderStateTransitionError {
             ... on OrderStateTransitionError {
-                errorCode: code
+                errorCode
                 message
                 message
                 transitionError
                 transitionError
                 fromState
                 fromState
@@ -479,7 +479,7 @@ export const ADD_PAYMENT = gql`
         addPaymentToOrder(input: $input) {
         addPaymentToOrder(input: $input) {
             ...TestOrderWithPayments
             ...TestOrderWithPayments
             ... on ErrorResult {
             ... on ErrorResult {
-                errorCode: code
+                errorCode
                 message
                 message
             }
             }
             ... on PaymentDeclinedError {
             ... on PaymentDeclinedError {
@@ -548,7 +548,7 @@ export const APPLY_COUPON_CODE = gql`
         applyCouponCode(couponCode: $couponCode) {
         applyCouponCode(couponCode: $couponCode) {
             ...TestOrderFragment
             ...TestOrderFragment
             ... on ErrorResult {
             ... on ErrorResult {
-                errorCode: code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -570,7 +570,7 @@ export const REMOVE_ALL_ORDER_LINES = gql`
         removeAllOrderLines {
         removeAllOrderLines {
             ...TestOrderFragment
             ...TestOrderFragment
             ... on ErrorResult {
             ... on ErrorResult {
-                errorCode: code
+                errorCode
                 message
                 message
             }
             }
         }
         }

+ 17 - 17
packages/core/e2e/order.e2e-spec.ts

@@ -177,7 +177,7 @@ describe('Orders resolver', () => {
             paymentGuard.assertErrorResult(settlePayment);
             paymentGuard.assertErrorResult(settlePayment);
 
 
             expect(settlePayment.message).toBe('Settling the payment failed');
             expect(settlePayment.message).toBe('Settling the payment failed');
-            expect(settlePayment.code).toBe(ErrorCode.SETTLE_PAYMENT_ERROR);
+            expect(settlePayment.errorCode).toBe(ErrorCode.SETTLE_PAYMENT_ERROR);
             expect((settlePayment as any).paymentErrorMessage).toBe('Something went horribly wrong');
             expect((settlePayment as any).paymentErrorMessage).toBe('Something went horribly wrong');
 
 
             const result = await adminClient.query<GetOrder.Query, GetOrder.Variables>(GET_ORDER, {
             const result = await adminClient.query<GetOrder.Query, GetOrder.Variables>(GET_ORDER, {
@@ -292,7 +292,7 @@ describe('Orders resolver', () => {
             fulfillmentGuard.assertErrorResult(addFulfillmentToOrder);
             fulfillmentGuard.assertErrorResult(addFulfillmentToOrder);
 
 
             expect(addFulfillmentToOrder.message).toBe('At least one OrderLine must be specified');
             expect(addFulfillmentToOrder.message).toBe('At least one OrderLine must be specified');
-            expect(addFulfillmentToOrder.code).toBe(ErrorCode.EMPTY_ORDER_LINE_SELECTION_ERROR);
+            expect(addFulfillmentToOrder.errorCode).toBe(ErrorCode.EMPTY_ORDER_LINE_SELECTION_ERROR);
         });
         });
 
 
         it('returns error result if all quantities are zero', async () => {
         it('returns error result if all quantities are zero', async () => {
@@ -312,7 +312,7 @@ describe('Orders resolver', () => {
             fulfillmentGuard.assertErrorResult(addFulfillmentToOrder);
             fulfillmentGuard.assertErrorResult(addFulfillmentToOrder);
 
 
             expect(addFulfillmentToOrder.message).toBe('At least one OrderLine must be specified');
             expect(addFulfillmentToOrder.message).toBe('At least one OrderLine must be specified');
-            expect(addFulfillmentToOrder.code).toBe(ErrorCode.EMPTY_ORDER_LINE_SELECTION_ERROR);
+            expect(addFulfillmentToOrder.errorCode).toBe(ErrorCode.EMPTY_ORDER_LINE_SELECTION_ERROR);
         });
         });
 
 
         it('creates the first fulfillment', async () => {
         it('creates the first fulfillment', async () => {
@@ -408,7 +408,7 @@ describe('Orders resolver', () => {
             expect(addFulfillmentToOrder.message).toBe(
             expect(addFulfillmentToOrder.message).toBe(
                 'One or more OrderItems are already part of a Fulfillment',
                 'One or more OrderItems are already part of a Fulfillment',
             );
             );
-            expect(addFulfillmentToOrder.code).toBe(ErrorCode.ITEMS_ALREADY_FULFILLED_ERROR);
+            expect(addFulfillmentToOrder.errorCode).toBe(ErrorCode.ITEMS_ALREADY_FULFILLED_ERROR);
         });
         });
 
 
         it('transits the first fulfillment from created to Shipped and automatically change the order state to PartiallyShipped', async () => {
         it('transits the first fulfillment from created to Shipped and automatically change the order state to PartiallyShipped', async () => {
@@ -787,7 +787,7 @@ describe('Orders resolver', () => {
             expect(cancelOrder.message).toBe(
             expect(cancelOrder.message).toBe(
                 'Cannot cancel OrderLines from an Order in the "AddingItems" state',
                 'Cannot cancel OrderLines from an Order in the "AddingItems" state',
             );
             );
-            expect(cancelOrder.code).toBe(ErrorCode.CANCEL_ACTIVE_ORDER_ERROR);
+            expect(cancelOrder.errorCode).toBe(ErrorCode.CANCEL_ACTIVE_ORDER_ERROR);
         });
         });
 
 
         it('cannot cancel from ArrangingPayment state', async () => {
         it('cannot cancel from ArrangingPayment state', async () => {
@@ -810,7 +810,7 @@ describe('Orders resolver', () => {
             expect(cancelOrder.message).toBe(
             expect(cancelOrder.message).toBe(
                 'Cannot cancel OrderLines from an Order in the "ArrangingPayment" state',
                 'Cannot cancel OrderLines from an Order in the "ArrangingPayment" state',
             );
             );
-            expect(cancelOrder.code).toBe(ErrorCode.CANCEL_ACTIVE_ORDER_ERROR);
+            expect(cancelOrder.errorCode).toBe(ErrorCode.CANCEL_ACTIVE_ORDER_ERROR);
         });
         });
 
 
         it('returns error result if lines are empty', async () => {
         it('returns error result if lines are empty', async () => {
@@ -831,7 +831,7 @@ describe('Orders resolver', () => {
             orderGuard.assertErrorResult(cancelOrder);
             orderGuard.assertErrorResult(cancelOrder);
 
 
             expect(cancelOrder.message).toBe('At least one OrderLine must be specified');
             expect(cancelOrder.message).toBe('At least one OrderLine must be specified');
-            expect(cancelOrder.code).toBe(ErrorCode.EMPTY_ORDER_LINE_SELECTION_ERROR);
+            expect(cancelOrder.errorCode).toBe(ErrorCode.EMPTY_ORDER_LINE_SELECTION_ERROR);
         });
         });
 
 
         it('returns error result if all quantities zero', async () => {
         it('returns error result if all quantities zero', async () => {
@@ -850,7 +850,7 @@ describe('Orders resolver', () => {
             orderGuard.assertErrorResult(cancelOrder);
             orderGuard.assertErrorResult(cancelOrder);
 
 
             expect(cancelOrder.message).toBe('At least one OrderLine must be specified');
             expect(cancelOrder.message).toBe('At least one OrderLine must be specified');
-            expect(cancelOrder.code).toBe(ErrorCode.EMPTY_ORDER_LINE_SELECTION_ERROR);
+            expect(cancelOrder.errorCode).toBe(ErrorCode.EMPTY_ORDER_LINE_SELECTION_ERROR);
         });
         });
 
 
         it('partial cancellation', async () => {
         it('partial cancellation', async () => {
@@ -935,7 +935,7 @@ describe('Orders resolver', () => {
             expect(cancelOrder.message).toBe(
             expect(cancelOrder.message).toBe(
                 'The specified quantity is greater than the available OrderItems',
                 'The specified quantity is greater than the available OrderItems',
             );
             );
-            expect(cancelOrder.code).toBe(ErrorCode.QUANTITY_TOO_GREAT_ERROR);
+            expect(cancelOrder.errorCode).toBe(ErrorCode.QUANTITY_TOO_GREAT_ERROR);
         });
         });
 
 
         it('complete cancellation', async () => {
         it('complete cancellation', async () => {
@@ -1073,7 +1073,7 @@ describe('Orders resolver', () => {
             refundGuard.assertErrorResult(refundOrder);
             refundGuard.assertErrorResult(refundOrder);
 
 
             expect(refundOrder.message).toBe('Cannot refund an Order in the "PaymentAuthorized" state');
             expect(refundOrder.message).toBe('Cannot refund an Order in the "PaymentAuthorized" state');
-            expect(refundOrder.code).toBe(ErrorCode.REFUND_ORDER_STATE_ERROR);
+            expect(refundOrder.errorCode).toBe(ErrorCode.REFUND_ORDER_STATE_ERROR);
         });
         });
 
 
         it('returns error result if no lines and no shipping', async () => {
         it('returns error result if no lines and no shipping', async () => {
@@ -1104,7 +1104,7 @@ describe('Orders resolver', () => {
             refundGuard.assertErrorResult(refundOrder);
             refundGuard.assertErrorResult(refundOrder);
 
 
             expect(refundOrder.message).toBe('Nothing to refund');
             expect(refundOrder.message).toBe('Nothing to refund');
-            expect(refundOrder.code).toBe(ErrorCode.NOTHING_TO_REFUND_ERROR);
+            expect(refundOrder.errorCode).toBe(ErrorCode.NOTHING_TO_REFUND_ERROR);
         });
         });
 
 
         it(
         it(
@@ -1145,7 +1145,7 @@ describe('Orders resolver', () => {
             refundGuard.assertErrorResult(refundOrder);
             refundGuard.assertErrorResult(refundOrder);
 
 
             expect(refundOrder.message).toBe('The Payment and OrderLines do not belong to the same Order');
             expect(refundOrder.message).toBe('The Payment and OrderLines do not belong to the same Order');
-            expect(refundOrder.code).toBe(ErrorCode.PAYMENT_ORDER_MISMATCH_ERROR);
+            expect(refundOrder.errorCode).toBe(ErrorCode.PAYMENT_ORDER_MISMATCH_ERROR);
         });
         });
 
 
         it('creates a Refund to be manually settled', async () => {
         it('creates a Refund to be manually settled', async () => {
@@ -1192,7 +1192,7 @@ describe('Orders resolver', () => {
             refundGuard.assertErrorResult(refundOrder);
             refundGuard.assertErrorResult(refundOrder);
 
 
             expect(refundOrder.message).toBe('Cannot refund an OrderItem which has already been refunded');
             expect(refundOrder.message).toBe('Cannot refund an OrderItem which has already been refunded');
-            expect(refundOrder.code).toBe(ErrorCode.ALREADY_REFUNDED_ERROR);
+            expect(refundOrder.errorCode).toBe(ErrorCode.ALREADY_REFUNDED_ERROR);
         });
         });
 
 
         it('manually settle a Refund', async () => {
         it('manually settle a Refund', async () => {
@@ -1463,7 +1463,7 @@ export const SETTLE_PAYMENT = gql`
         settlePayment(id: $id) {
         settlePayment(id: $id) {
             ...Payment
             ...Payment
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
             ... on SettlePaymentError {
             ... on SettlePaymentError {
@@ -1513,7 +1513,7 @@ export const CANCEL_ORDER = gql`
         cancelOrder(input: $input) {
         cancelOrder(input: $input) {
             ...CanceledOrder
             ...CanceledOrder
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -1547,7 +1547,7 @@ export const REFUND_ORDER = gql`
         refundOrder(input: $input) {
         refundOrder(input: $input) {
             ...Refund
             ...Refund
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }
@@ -1560,7 +1560,7 @@ export const SETTLE_REFUND = gql`
         settleRefund(input: $input) {
         settleRefund(input: $input) {
             ...Refund
             ...Refund
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }

+ 2 - 2
packages/core/e2e/product.e2e-spec.ts

@@ -714,7 +714,7 @@ describe('Product resolver', () => {
             expect(removeOptionGroupFromProduct.message).toBe(
             expect(removeOptionGroupFromProduct.message).toBe(
                 `Cannot remove ProductOptionGroup "curvy-monitor-monitor-size" as it is used by 2 ProductVariants`,
                 `Cannot remove ProductOptionGroup "curvy-monitor-monitor-size" as it is used by 2 ProductVariants`,
             );
             );
-            expect(removeOptionGroupFromProduct.code).toBe(ErrorCode.PRODUCT_OPTION_IN_USE_ERROR);
+            expect(removeOptionGroupFromProduct.errorCode).toBe(ErrorCode.PRODUCT_OPTION_IN_USE_ERROR);
             expect(removeOptionGroupFromProduct.optionGroupCode).toBe('curvy-monitor-monitor-size');
             expect(removeOptionGroupFromProduct.optionGroupCode).toBe('curvy-monitor-monitor-size');
             expect(removeOptionGroupFromProduct.productVariantCount).toBe(2);
             expect(removeOptionGroupFromProduct.productVariantCount).toBe(2);
         });
         });
@@ -1196,7 +1196,7 @@ export const REMOVE_OPTION_GROUP_FROM_PRODUCT = gql`
         removeOptionGroupFromProduct(productId: $productId, optionGroupId: $optionGroupId) {
         removeOptionGroupFromProduct(productId: $productId, optionGroupId: $optionGroupId) {
             ...ProductWithOptions
             ...ProductWithOptions
             ... on ProductOptionInUseError {
             ... on ProductOptionInUseError {
-                code
+                errorCode
                 message
                 message
                 optionGroupCode
                 optionGroupCode
                 productVariantCount
                 productVariantCount

+ 3 - 3
packages/core/e2e/promotion.e2e-spec.ts

@@ -130,7 +130,7 @@ describe('Promotion resolver', () => {
         expect(createPromotion.message).toBe(
         expect(createPromotion.message).toBe(
             'A Promotion must have either at least one condition or a coupon code set',
             'A Promotion must have either at least one condition or a coupon code set',
         );
         );
-        expect(createPromotion.code).toBe(ErrorCode.MISSING_CONDITIONS_ERROR);
+        expect(createPromotion.errorCode).toBe(ErrorCode.MISSING_CONDITIONS_ERROR);
     });
     });
 
 
     it('updatePromotion', async () => {
     it('updatePromotion', async () => {
@@ -176,7 +176,7 @@ describe('Promotion resolver', () => {
         expect(updatePromotion.message).toBe(
         expect(updatePromotion.message).toBe(
             'A Promotion must have either at least one condition or a coupon code set',
             'A Promotion must have either at least one condition or a coupon code set',
         );
         );
-        expect(updatePromotion.code).toBe(ErrorCode.MISSING_CONDITIONS_ERROR);
+        expect(updatePromotion.errorCode).toBe(ErrorCode.MISSING_CONDITIONS_ERROR);
     });
     });
 
 
     it('promotion', async () => {
     it('promotion', async () => {
@@ -314,7 +314,7 @@ export const UPDATE_PROMOTION = gql`
         updatePromotion(input: $input) {
         updatePromotion(input: $input) {
             ...Promotion
             ...Promotion
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }

+ 2 - 1
packages/core/e2e/role.e2e-spec.ts

@@ -13,6 +13,7 @@ import { TEST_SETUP_TIMEOUT_MS, testConfig } from '../../../e2e-common/test-conf
 
 
 import { ROLE_FRAGMENT } from './graphql/fragments';
 import { ROLE_FRAGMENT } from './graphql/fragments';
 import {
 import {
+    ChannelFragment,
     CreateChannel,
     CreateChannel,
     CreateRole,
     CreateRole,
     CurrencyCode,
     CurrencyCode,
@@ -280,7 +281,7 @@ describe('Role resolver', () => {
     });
     });
 
 
     describe('multi-channel', () => {
     describe('multi-channel', () => {
-        let secondChannel: CreateChannel.CreateChannel;
+        let secondChannel: ChannelFragment;
         let multiChannelRole: CreateRole.CreateRole;
         let multiChannelRole: CreateRole.CreateRole;
 
 
         beforeAll(async () => {
         beforeAll(async () => {

+ 16 - 14
packages/core/e2e/shop-auth.e2e-spec.ts

@@ -246,7 +246,7 @@ describe('Shop auth & accounts', () => {
 
 
         it('login fails before verification', async () => {
         it('login fails before verification', async () => {
             const result = await shopClient.asUserWithCredentials(emailAddress, '');
             const result = await shopClient.asUserWithCredentials(emailAddress, '');
-            expect(result.code).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
+            expect(result.errorCode).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
         });
         });
 
 
         it('verification fails with wrong token', async () => {
         it('verification fails with wrong token', async () => {
@@ -260,7 +260,7 @@ describe('Shop auth & accounts', () => {
             currentUserErrorGuard.assertErrorResult(verifyCustomerAccount);
             currentUserErrorGuard.assertErrorResult(verifyCustomerAccount);
 
 
             expect(verifyCustomerAccount.message).toBe(`Verification token not recognized`);
             expect(verifyCustomerAccount.message).toBe(`Verification token not recognized`);
-            expect(verifyCustomerAccount.code).toBe(ErrorCode.VERIFICATION_TOKEN_INVALID_ERROR);
+            expect(verifyCustomerAccount.errorCode).toBe(ErrorCode.VERIFICATION_TOKEN_INVALID_ERROR);
         });
         });
 
 
         it('verification fails with no password', async () => {
         it('verification fails with no password', async () => {
@@ -273,7 +273,7 @@ describe('Shop auth & accounts', () => {
             currentUserErrorGuard.assertErrorResult(verifyCustomerAccount);
             currentUserErrorGuard.assertErrorResult(verifyCustomerAccount);
 
 
             expect(verifyCustomerAccount.message).toBe(`A password must be provided.`);
             expect(verifyCustomerAccount.message).toBe(`A password must be provided.`);
-            expect(verifyCustomerAccount.code).toBe(ErrorCode.MISSING_PASSWORD_ERROR);
+            expect(verifyCustomerAccount.errorCode).toBe(ErrorCode.MISSING_PASSWORD_ERROR);
         });
         });
 
 
         it('verification succeeds with password and correct token', async () => {
         it('verification succeeds with password and correct token', async () => {
@@ -321,7 +321,7 @@ describe('Shop auth & accounts', () => {
             currentUserErrorGuard.assertErrorResult(verifyCustomerAccount);
             currentUserErrorGuard.assertErrorResult(verifyCustomerAccount);
 
 
             expect(verifyCustomerAccount.message).toBe(`Verification token not recognized`);
             expect(verifyCustomerAccount.message).toBe(`Verification token not recognized`);
-            expect(verifyCustomerAccount.code).toBe(ErrorCode.VERIFICATION_TOKEN_INVALID_ERROR);
+            expect(verifyCustomerAccount.errorCode).toBe(ErrorCode.VERIFICATION_TOKEN_INVALID_ERROR);
         });
         });
 
 
         it('customer history contains entries for registration & verification', async () => {
         it('customer history contains entries for registration & verification', async () => {
@@ -413,7 +413,7 @@ describe('Shop auth & accounts', () => {
             currentUserErrorGuard.assertErrorResult(verifyCustomerAccount);
             currentUserErrorGuard.assertErrorResult(verifyCustomerAccount);
 
 
             expect(verifyCustomerAccount.message).toBe(`A password has already been set during registration`);
             expect(verifyCustomerAccount.message).toBe(`A password has already been set during registration`);
-            expect(verifyCustomerAccount.code).toBe(ErrorCode.PASSWORD_ALREADY_SET_ERROR);
+            expect(verifyCustomerAccount.errorCode).toBe(ErrorCode.PASSWORD_ALREADY_SET_ERROR);
         });
         });
 
 
         it('verification succeeds with no password and correct token', async () => {
         it('verification succeeds with no password and correct token', async () => {
@@ -488,7 +488,7 @@ describe('Shop auth & accounts', () => {
             currentUserErrorGuard.assertErrorResult(resetPassword);
             currentUserErrorGuard.assertErrorResult(resetPassword);
 
 
             expect(resetPassword.message).toBe(`Password reset token not recognized`);
             expect(resetPassword.message).toBe(`Password reset token not recognized`);
-            expect(resetPassword.code).toBe(ErrorCode.PASSWORD_RESET_TOKEN_INVALID_ERROR);
+            expect(resetPassword.errorCode).toBe(ErrorCode.PASSWORD_RESET_TOKEN_INVALID_ERROR);
         });
         });
 
 
         it('resetPassword works with valid token', async () => {
         it('resetPassword works with valid token', async () => {
@@ -577,7 +577,7 @@ describe('Shop auth & accounts', () => {
             successErrorGuard.assertErrorResult(requestUpdateCustomerEmailAddress);
             successErrorGuard.assertErrorResult(requestUpdateCustomerEmailAddress);
 
 
             expect(requestUpdateCustomerEmailAddress.message).toBe('The provided credentials are invalid');
             expect(requestUpdateCustomerEmailAddress.message).toBe('The provided credentials are invalid');
-            expect(requestUpdateCustomerEmailAddress.code).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
+            expect(requestUpdateCustomerEmailAddress.errorCode).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
         });
         });
 
 
         it('return error result email address already in use', async () => {
         it('return error result email address already in use', async () => {
@@ -597,7 +597,7 @@ describe('Shop auth & accounts', () => {
             successErrorGuard.assertErrorResult(requestUpdateCustomerEmailAddress);
             successErrorGuard.assertErrorResult(requestUpdateCustomerEmailAddress);
 
 
             expect(requestUpdateCustomerEmailAddress.message).toBe('The email address is not available.');
             expect(requestUpdateCustomerEmailAddress.message).toBe('The email address is not available.');
-            expect(requestUpdateCustomerEmailAddress.code).toBe(ErrorCode.EMAIL_ADDRESS_CONFLICT_ERROR);
+            expect(requestUpdateCustomerEmailAddress.errorCode).toBe(ErrorCode.EMAIL_ADDRESS_CONFLICT_ERROR);
         });
         });
 
 
         it('triggers event with token', async () => {
         it('triggers event with token', async () => {
@@ -622,7 +622,7 @@ describe('Shop auth & accounts', () => {
         it('cannot login with new email address before verification', async () => {
         it('cannot login with new email address before verification', async () => {
             const result = await shopClient.asUserWithCredentials(NEW_EMAIL_ADDRESS, PASSWORD);
             const result = await shopClient.asUserWithCredentials(NEW_EMAIL_ADDRESS, PASSWORD);
 
 
-            expect(result.code).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
+            expect(result.errorCode).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
         });
         });
 
 
         it('return error result for bad token', async () => {
         it('return error result for bad token', async () => {
@@ -633,7 +633,9 @@ describe('Shop auth & accounts', () => {
             successErrorGuard.assertErrorResult(updateCustomerEmailAddress);
             successErrorGuard.assertErrorResult(updateCustomerEmailAddress);
 
 
             expect(updateCustomerEmailAddress.message).toBe('Identifier change token not recognized');
             expect(updateCustomerEmailAddress.message).toBe('Identifier change token not recognized');
-            expect(updateCustomerEmailAddress.code).toBe(ErrorCode.IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR);
+            expect(updateCustomerEmailAddress.errorCode).toBe(
+                ErrorCode.IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR,
+            );
         });
         });
 
 
         it('verify the new email address', async () => {
         it('verify the new email address', async () => {
@@ -659,7 +661,7 @@ describe('Shop auth & accounts', () => {
         it('cannot login with old email address after verification', async () => {
         it('cannot login with old email address after verification', async () => {
             const result = await shopClient.asUserWithCredentials(customer.emailAddress, PASSWORD);
             const result = await shopClient.asUserWithCredentials(customer.emailAddress, PASSWORD);
 
 
-            expect(result.code).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
+            expect(result.errorCode).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
         });
         });
 
 
         it('customer history for email update', async () => {
         it('customer history for email update', async () => {
@@ -826,7 +828,7 @@ describe('Expiring tokens', () => {
         expect(verifyCustomerAccount.message).toBe(
         expect(verifyCustomerAccount.message).toBe(
             `Verification token has expired. Use refreshCustomerVerification to send a new token.`,
             `Verification token has expired. Use refreshCustomerVerification to send a new token.`,
         );
         );
-        expect(verifyCustomerAccount.code).toBe(ErrorCode.VERIFICATION_TOKEN_EXPIRED_ERROR);
+        expect(verifyCustomerAccount.errorCode).toBe(ErrorCode.VERIFICATION_TOKEN_EXPIRED_ERROR);
     });
     });
 
 
     it('attempting to reset password after token has expired returns error result', async () => {
     it('attempting to reset password after token has expired returns error result', async () => {
@@ -862,7 +864,7 @@ describe('Expiring tokens', () => {
         currentUserErrorGuard.assertErrorResult(resetPassword);
         currentUserErrorGuard.assertErrorResult(resetPassword);
 
 
         expect(resetPassword.message).toBe(`Password reset token has expired`);
         expect(resetPassword.message).toBe(`Password reset token has expired`);
-        expect(resetPassword.code).toBe(ErrorCode.PASSWORD_RESET_TOKEN_EXPIRED_ERROR);
+        expect(resetPassword.errorCode).toBe(ErrorCode.PASSWORD_RESET_TOKEN_EXPIRED_ERROR);
     });
     });
 });
 });
 
 
@@ -908,7 +910,7 @@ describe('Registration without email verification', () => {
         successErrorGuard.assertErrorResult(registerCustomerAccount);
         successErrorGuard.assertErrorResult(registerCustomerAccount);
 
 
         expect(registerCustomerAccount.message).toBe('A password must be provided.');
         expect(registerCustomerAccount.message).toBe('A password must be provided.');
-        expect(registerCustomerAccount.code).toBe(ErrorCode.MISSING_PASSWORD_ERROR);
+        expect(registerCustomerAccount.errorCode).toBe(ErrorCode.MISSING_PASSWORD_ERROR);
     });
     });
 
 
     it('register a new account with password', async () => {
     it('register a new account with password', async () => {

+ 1 - 1
packages/core/e2e/shop-customer.e2e-spec.ts

@@ -302,7 +302,7 @@ describe('Shop customers', () => {
             successErrorGuard.assertErrorResult(updateCustomerPassword);
             successErrorGuard.assertErrorResult(updateCustomerPassword);
 
 
             expect(updateCustomerPassword.message).toBe('The provided credentials are invalid');
             expect(updateCustomerPassword.message).toBe('The provided credentials are invalid');
-            expect(updateCustomerPassword.code).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
+            expect(updateCustomerPassword.errorCode).toBe(ErrorCode.INVALID_CREDENTIALS_ERROR);
         });
         });
 
 
         it('updatePassword works', async () => {
         it('updatePassword works', async () => {

+ 1 - 1
packages/core/src/api/resolvers/shop/shop-auth.resolver.ts

@@ -117,7 +117,7 @@ export class ShopAuthResolver extends BaseAuthResolver {
         }
         }
         const result = await this.customerService.registerCustomerAccount(ctx, args.input);
         const result = await this.customerService.registerCustomerAccount(ctx, args.input);
         if (isGraphQlErrorResult(result)) {
         if (isGraphQlErrorResult(result)) {
-            if (result.code === ErrorCode.EMAIL_ADDRESS_CONFLICT_ERROR) {
+            if (result.errorCode === ErrorCode.EMAIL_ADDRESS_CONFLICT_ERROR) {
                 // We do not want to reveal the email address conflict,
                 // We do not want to reveal the email address conflict,
                 // otherwise account enumeration attacks become possible.
                 // otherwise account enumeration attacks become possible.
                 return { success: true };
                 return { success: true };

+ 1 - 1
packages/core/src/api/schema/admin-api/asset.api.graphql

@@ -17,7 +17,7 @@ type Mutation {
 }
 }
 
 
 type MimeTypeError implements ErrorResult {
 type MimeTypeError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     fileName: String!
     fileName: String!
     mimeType: String!
     mimeType: String!

+ 1 - 1
packages/core/src/api/schema/admin-api/channel.api.graphql

@@ -38,7 +38,7 @@ input UpdateChannelInput {
 
 
 "Returned if attempting to set a Channel's defaultLanguageCode to a language which is not enabled in GlobalSettings"
 "Returned if attempting to set a Channel's defaultLanguageCode to a language which is not enabled in GlobalSettings"
 type LanguageNotAvailableError implements ErrorResult {
 type LanguageNotAvailableError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     languageCode: String!
     languageCode: String!
 }
 }

+ 1 - 1
packages/core/src/api/schema/admin-api/global-settings.api.graphql

@@ -16,7 +16,7 @@ Returned when the default LanguageCode of a Channel is no longer found in the `a
 of the GlobalSettings
 of the GlobalSettings
 """
 """
 type ChannelDefaultLanguageError implements ErrorResult {
 type ChannelDefaultLanguageError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     language: String!
     language: String!
     channelCode: String!
     channelCode: String!

+ 13 - 13
packages/core/src/api/schema/admin-api/order.api.graphql

@@ -75,71 +75,71 @@ input UpdateOrderNoteInput {
 
 
 "Returned if the Payment settlement fails"
 "Returned if the Payment settlement fails"
 type SettlePaymentError implements ErrorResult {
 type SettlePaymentError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     paymentErrorMessage: String!
     paymentErrorMessage: String!
 }
 }
 
 
 "Returned if no OrderLines have been specified for the operation"
 "Returned if no OrderLines have been specified for the operation"
 type EmptyOrderLineSelectionError implements ErrorResult {
 type EmptyOrderLineSelectionError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned if the specified items are already part of a Fulfillment"
 "Returned if the specified items are already part of a Fulfillment"
 type ItemsAlreadyFulfilledError implements ErrorResult {
 type ItemsAlreadyFulfilledError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned if an operation has specified OrderLines from multiple Orders"
 "Returned if an operation has specified OrderLines from multiple Orders"
 type MultipleOrderError implements ErrorResult {
 type MultipleOrderError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned if an attempting to cancel lines from an Order which is still active"
 "Returned if an attempting to cancel lines from an Order which is still active"
 type CancelActiveOrderError implements ErrorResult {
 type CancelActiveOrderError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     orderState: String!
     orderState: String!
 }
 }
 
 
 "Returned if an attempting to refund a Payment against OrderLines from a different Order"
 "Returned if an attempting to refund a Payment against OrderLines from a different Order"
 type PaymentOrderMismatchError implements ErrorResult {
 type PaymentOrderMismatchError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned if an attempting to refund an Order which is not in the expected state"
 "Returned if an attempting to refund an Order which is not in the expected state"
 type RefundOrderStateError implements ErrorResult {
 type RefundOrderStateError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     orderState: String!
     orderState: String!
 }
 }
 
 
 "Returned if an attempting to refund an Order but neither items nor shipping refund was specified"
 "Returned if an attempting to refund an Order but neither items nor shipping refund was specified"
 type NothingToRefundError implements ErrorResult {
 type NothingToRefundError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned if an attempting to refund an OrderItem which has already been refunded"
 "Returned if an attempting to refund an OrderItem which has already been refunded"
 type AlreadyRefundedError implements ErrorResult {
 type AlreadyRefundedError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     refundId: ID!
     refundId: ID!
 }
 }
 
 
 "Returned if the specified quantity of an OrderLine is greater than the number of items in that line"
 "Returned if the specified quantity of an OrderLine is greater than the number of items in that line"
 type QuantityTooGreatError implements ErrorResult {
 type QuantityTooGreatError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned when there is an error in transitioning the Refund state"
 "Returned when there is an error in transitioning the Refund state"
 type RefundStateTransitionError implements ErrorResult {
 type RefundStateTransitionError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     transitionError: String!
     transitionError: String!
     fromState: String!
     fromState: String!
@@ -148,7 +148,7 @@ type RefundStateTransitionError implements ErrorResult {
 
 
 "Returned when there is an error in transitioning the Payment state"
 "Returned when there is an error in transitioning the Payment state"
 type PaymentStateTransitionError implements ErrorResult {
 type PaymentStateTransitionError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     transitionError: String!
     transitionError: String!
     fromState: String!
     fromState: String!
@@ -157,7 +157,7 @@ type PaymentStateTransitionError implements ErrorResult {
 
 
 "Returned when there is an error in transitioning the Fulfillment state"
 "Returned when there is an error in transitioning the Fulfillment state"
 type FulfillmentStateTransitionError implements ErrorResult {
 type FulfillmentStateTransitionError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     transitionError: String!
     transitionError: String!
     fromState: String!
     fromState: String!

+ 1 - 1
packages/core/src/api/schema/admin-api/product.api.graphql

@@ -141,7 +141,7 @@ input RemoveProductsFromChannelInput {
 }
 }
 
 
 type ProductOptionInUseError implements ErrorResult {
 type ProductOptionInUseError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     optionGroupCode: String!
     optionGroupCode: String!
     productVariantCount: Int!
     productVariantCount: Int!

+ 1 - 1
packages/core/src/api/schema/admin-api/promotion.api.graphql

@@ -39,7 +39,7 @@ input UpdatePromotionInput {
 
 
 "Returned if a PromotionCondition has neither a couponCode nor any conditions set"
 "Returned if a PromotionCondition has neither a couponCode nor any conditions set"
 type MissingConditionsError implements ErrorResult {
 type MissingConditionsError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 

+ 5 - 5
packages/core/src/api/schema/common/common-types.graphql

@@ -86,7 +86,7 @@ enum ErrorCode {
 }
 }
 
 
 interface ErrorResult {
 interface ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
@@ -193,19 +193,19 @@ type Success {
 
 
 "Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured."
 "Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured."
 type NativeAuthStrategyError implements ErrorResult {
 type NativeAuthStrategyError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned if the user authentication credentials are not valid"
 "Returned if the user authentication credentials are not valid"
 type InvalidCredentialsError implements ErrorResult {
 type InvalidCredentialsError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned if there is an error in transitioning the Order state"
 "Returned if there is an error in transitioning the Order state"
 type OrderStateTransitionError implements ErrorResult {
 type OrderStateTransitionError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     transitionError: String!
     transitionError: String!
     fromState: String!
     fromState: String!
@@ -214,6 +214,6 @@ type OrderStateTransitionError implements ErrorResult {
 
 
 "Retured when attemting to create a Customer with an email address already registered to an existing User."
 "Retured when attemting to create a Customer with an email address already registered to an existing User."
 type EmailAddressConflictError implements ErrorResult {
 type EmailAddressConflictError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }

+ 19 - 19
packages/core/src/api/schema/shop-api/shop.api.graphql

@@ -180,67 +180,67 @@ input ProductListOptions
 
 
 "Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state."
 "Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state."
 type OrderModificationError implements ErrorResult {
 type OrderModificationError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Retured when the maximum order size limit has been reached."
 "Retured when the maximum order size limit has been reached."
 type OrderLimitError implements ErrorResult {
 type OrderLimitError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     maxItems: Int!
     maxItems: Int!
 }
 }
 
 
 "Retured when attemting to set a negative OrderLine quantity."
 "Retured when attemting to set a negative OrderLine quantity."
 type NegativeQuantityError implements ErrorResult {
 type NegativeQuantityError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state."
 "Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state."
 type OrderPaymentStateError implements ErrorResult {
 type OrderPaymentStateError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Returned when a Payment fails due to an error."
 "Returned when a Payment fails due to an error."
 type PaymentFailedError implements ErrorResult {
 type PaymentFailedError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     paymentErrorMessage: String!
     paymentErrorMessage: String!
 }
 }
 
 
 "Returned when a Payment is declined by the payment provider."
 "Returned when a Payment is declined by the payment provider."
 type PaymentDeclinedError implements ErrorResult {
 type PaymentDeclinedError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     paymentErrorMessage: String!
     paymentErrorMessage: String!
 }
 }
 
 
 "Returned if the provided coupon code is invalid"
 "Returned if the provided coupon code is invalid"
 type CouponCodeInvalidError implements ErrorResult {
 type CouponCodeInvalidError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     couponCode: String!
     couponCode: String!
 }
 }
 
 
 "Returned if the provided coupon code is invalid"
 "Returned if the provided coupon code is invalid"
 type CouponCodeInvalidError implements ErrorResult {
 type CouponCodeInvalidError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     couponCode: String!
     couponCode: String!
 }
 }
 
 
 "Returned if the provided coupon code is invalid"
 "Returned if the provided coupon code is invalid"
 type CouponCodeExpiredError implements ErrorResult {
 type CouponCodeExpiredError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     couponCode: String!
     couponCode: String!
 }
 }
 
 
 "Returned if the provided coupon code is invalid"
 "Returned if the provided coupon code is invalid"
 type CouponCodeLimitError implements ErrorResult {
 type CouponCodeLimitError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
     couponCode: String!
     couponCode: String!
     limit: Int!
     limit: Int!
@@ -248,19 +248,19 @@ type CouponCodeLimitError implements ErrorResult {
 
 
 "Retured when attemting to set the Customer for an Order when already logged in."
 "Retured when attemting to set the Customer for an Order when already logged in."
 type AlreadyLoggedInError implements ErrorResult {
 type AlreadyLoggedInError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Retured when attemting to register or verify a customer account without a password, when one is required."
 "Retured when attemting to register or verify a customer account without a password, when one is required."
 type MissingPasswordError implements ErrorResult {
 type MissingPasswordError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
 "Retured when attemting to verify a customer account with a password, when a password has already been set."
 "Retured when attemting to verify a customer account with a password, when a password has already been set."
 type PasswordAlreadySetError implements ErrorResult {
 type PasswordAlreadySetError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
@@ -269,7 +269,7 @@ Retured if the verification token (used to verify a Customer's email address) is
 invalid or does not match any expected tokens.
 invalid or does not match any expected tokens.
 """
 """
 type VerificationTokenInvalidError implements ErrorResult {
 type VerificationTokenInvalidError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
@@ -278,7 +278,7 @@ Returned if the verification token (used to verify a Customer's email address) i
 expired according to the `verificationTokenDuration` setting in the AuthOptions.
 expired according to the `verificationTokenDuration` setting in the AuthOptions.
 """
 """
 type VerificationTokenExpiredError implements ErrorResult {
 type VerificationTokenExpiredError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
@@ -287,7 +287,7 @@ Retured if the token used to change a Customer's email address is either
 invalid or does not match any expected tokens.
 invalid or does not match any expected tokens.
 """
 """
 type IdentifierChangeTokenInvalidError implements ErrorResult {
 type IdentifierChangeTokenInvalidError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
@@ -296,7 +296,7 @@ Retured if the token used to change a Customer's email address is valid, but has
 expired according to the `verificationTokenDuration` setting in the AuthOptions.
 expired according to the `verificationTokenDuration` setting in the AuthOptions.
 """
 """
 type IdentifierChangeTokenExpiredError implements ErrorResult {
 type IdentifierChangeTokenExpiredError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
@@ -305,7 +305,7 @@ Retured if the token used to reset a Customer's password is either
 invalid or does not match any expected tokens.
 invalid or does not match any expected tokens.
 """
 """
 type PasswordResetTokenInvalidError implements ErrorResult {
 type PasswordResetTokenInvalidError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 
@@ -314,7 +314,7 @@ Retured if the token used to reset a Customer's password is valid, but has
 expired according to the `verificationTokenDuration` setting in the AuthOptions.
 expired according to the `verificationTokenDuration` setting in the AuthOptions.
 """
 """
 type PasswordResetTokenExpiredError implements ErrorResult {
 type PasswordResetTokenExpiredError implements ErrorResult {
-    code: ErrorCode!
+    errorCode: ErrorCode!
     message: String!
     message: String!
 }
 }
 
 

+ 9 - 2
packages/core/src/common/error/error-result.ts

@@ -1,5 +1,5 @@
 import { ErrorResult as GraphQLErrorResultShop } from '@vendure/common/lib/generated-shop-types';
 import { ErrorResult as GraphQLErrorResultShop } from '@vendure/common/lib/generated-shop-types';
-import { ErrorResult as GraphQLErrorResultAdmin } from '@vendure/common/lib/generated-types';
+import { ErrorResult, ErrorResult as GraphQLErrorResultAdmin } from '@vendure/common/lib/generated-types';
 
 
 import { VendureEntity } from '../../entity/base/base.entity';
 import { VendureEntity } from '../../entity/base/base.entity';
 
 
@@ -52,5 +52,12 @@ export function isGraphQlErrorResult<T extends GraphQLErrorResult | U, U = any>(
 export function isGraphQlErrorResult<T, E extends VendureEntity>(
 export function isGraphQlErrorResult<T, E extends VendureEntity>(
     input: ErrorResultUnion<T, E>,
     input: ErrorResultUnion<T, E>,
 ): input is JustErrorResults<ErrorResultUnion<T, E>> {
 ): input is JustErrorResults<ErrorResultUnion<T, E>> {
-    return input && !!((input as any).code && (input as any).message != null) && (input as any).__typename;
+    return (
+        input &&
+        !!(
+            ((input as unknown) as GraphQLErrorResult).errorCode &&
+            ((input as unknown) as GraphQLErrorResult).message != null
+        ) &&
+        (input as any).__typename
+    );
 }
 }

+ 23 - 23
packages/core/src/common/error/generated-graphql-admin-errors.ts

@@ -14,13 +14,13 @@ export type Scalars = {
 
 
 export class ErrorResult {
 export class ErrorResult {
   readonly __typename: string;
   readonly __typename: string;
-  readonly code: string;
+  readonly errorCode: string;
   message: Scalars['String'];
   message: Scalars['String'];
 }
 }
 
 
 export class AlreadyRefundedError extends ErrorResult {
 export class AlreadyRefundedError extends ErrorResult {
   readonly __typename = 'AlreadyRefundedError';
   readonly __typename = 'AlreadyRefundedError';
-  readonly code = 'ALREADY_REFUNDED_ERROR' as any;
+  readonly errorCode = 'ALREADY_REFUNDED_ERROR' as any;
   readonly message = 'ALREADY_REFUNDED_ERROR';
   readonly message = 'ALREADY_REFUNDED_ERROR';
   constructor(
   constructor(
     public   refundId: Scalars['ID'],
     public   refundId: Scalars['ID'],
@@ -31,7 +31,7 @@ export class AlreadyRefundedError extends ErrorResult {
 
 
 export class CancelActiveOrderError extends ErrorResult {
 export class CancelActiveOrderError extends ErrorResult {
   readonly __typename = 'CancelActiveOrderError';
   readonly __typename = 'CancelActiveOrderError';
-  readonly code = 'CANCEL_ACTIVE_ORDER_ERROR' as any;
+  readonly errorCode = 'CANCEL_ACTIVE_ORDER_ERROR' as any;
   readonly message = 'CANCEL_ACTIVE_ORDER_ERROR';
   readonly message = 'CANCEL_ACTIVE_ORDER_ERROR';
   constructor(
   constructor(
     public   orderState: Scalars['String'],
     public   orderState: Scalars['String'],
@@ -42,7 +42,7 @@ export class CancelActiveOrderError extends ErrorResult {
 
 
 export class ChannelDefaultLanguageError extends ErrorResult {
 export class ChannelDefaultLanguageError extends ErrorResult {
   readonly __typename = 'ChannelDefaultLanguageError';
   readonly __typename = 'ChannelDefaultLanguageError';
-  readonly code = 'CHANNEL_DEFAULT_LANGUAGE_ERROR' as any;
+  readonly errorCode = 'CHANNEL_DEFAULT_LANGUAGE_ERROR' as any;
   readonly message = 'CHANNEL_DEFAULT_LANGUAGE_ERROR';
   readonly message = 'CHANNEL_DEFAULT_LANGUAGE_ERROR';
   constructor(
   constructor(
     public   language: Scalars['String'],
     public   language: Scalars['String'],
@@ -54,7 +54,7 @@ export class ChannelDefaultLanguageError extends ErrorResult {
 
 
 export class EmailAddressConflictError extends ErrorResult {
 export class EmailAddressConflictError extends ErrorResult {
   readonly __typename = 'EmailAddressConflictError';
   readonly __typename = 'EmailAddressConflictError';
-  readonly code = 'EMAIL_ADDRESS_CONFLICT_ERROR' as any;
+  readonly errorCode = 'EMAIL_ADDRESS_CONFLICT_ERROR' as any;
   readonly message = 'EMAIL_ADDRESS_CONFLICT_ERROR';
   readonly message = 'EMAIL_ADDRESS_CONFLICT_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -64,7 +64,7 @@ export class EmailAddressConflictError extends ErrorResult {
 
 
 export class EmptyOrderLineSelectionError extends ErrorResult {
 export class EmptyOrderLineSelectionError extends ErrorResult {
   readonly __typename = 'EmptyOrderLineSelectionError';
   readonly __typename = 'EmptyOrderLineSelectionError';
-  readonly code = 'EMPTY_ORDER_LINE_SELECTION_ERROR' as any;
+  readonly errorCode = 'EMPTY_ORDER_LINE_SELECTION_ERROR' as any;
   readonly message = 'EMPTY_ORDER_LINE_SELECTION_ERROR';
   readonly message = 'EMPTY_ORDER_LINE_SELECTION_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -74,7 +74,7 @@ export class EmptyOrderLineSelectionError extends ErrorResult {
 
 
 export class FulfillmentStateTransitionError extends ErrorResult {
 export class FulfillmentStateTransitionError extends ErrorResult {
   readonly __typename = 'FulfillmentStateTransitionError';
   readonly __typename = 'FulfillmentStateTransitionError';
-  readonly code = 'FULFILLMENT_STATE_TRANSITION_ERROR' as any;
+  readonly errorCode = 'FULFILLMENT_STATE_TRANSITION_ERROR' as any;
   readonly message = 'FULFILLMENT_STATE_TRANSITION_ERROR';
   readonly message = 'FULFILLMENT_STATE_TRANSITION_ERROR';
   constructor(
   constructor(
     public   transitionError: Scalars['String'],
     public   transitionError: Scalars['String'],
@@ -87,7 +87,7 @@ export class FulfillmentStateTransitionError extends ErrorResult {
 
 
 export class InvalidCredentialsError extends ErrorResult {
 export class InvalidCredentialsError extends ErrorResult {
   readonly __typename = 'InvalidCredentialsError';
   readonly __typename = 'InvalidCredentialsError';
-  readonly code = 'INVALID_CREDENTIALS_ERROR' as any;
+  readonly errorCode = 'INVALID_CREDENTIALS_ERROR' as any;
   readonly message = 'INVALID_CREDENTIALS_ERROR';
   readonly message = 'INVALID_CREDENTIALS_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -97,7 +97,7 @@ export class InvalidCredentialsError extends ErrorResult {
 
 
 export class ItemsAlreadyFulfilledError extends ErrorResult {
 export class ItemsAlreadyFulfilledError extends ErrorResult {
   readonly __typename = 'ItemsAlreadyFulfilledError';
   readonly __typename = 'ItemsAlreadyFulfilledError';
-  readonly code = 'ITEMS_ALREADY_FULFILLED_ERROR' as any;
+  readonly errorCode = 'ITEMS_ALREADY_FULFILLED_ERROR' as any;
   readonly message = 'ITEMS_ALREADY_FULFILLED_ERROR';
   readonly message = 'ITEMS_ALREADY_FULFILLED_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -107,7 +107,7 @@ export class ItemsAlreadyFulfilledError extends ErrorResult {
 
 
 export class LanguageNotAvailableError extends ErrorResult {
 export class LanguageNotAvailableError extends ErrorResult {
   readonly __typename = 'LanguageNotAvailableError';
   readonly __typename = 'LanguageNotAvailableError';
-  readonly code = 'LANGUAGE_NOT_AVAILABLE_ERROR' as any;
+  readonly errorCode = 'LANGUAGE_NOT_AVAILABLE_ERROR' as any;
   readonly message = 'LANGUAGE_NOT_AVAILABLE_ERROR';
   readonly message = 'LANGUAGE_NOT_AVAILABLE_ERROR';
   constructor(
   constructor(
     public   languageCode: Scalars['String'],
     public   languageCode: Scalars['String'],
@@ -118,7 +118,7 @@ export class LanguageNotAvailableError extends ErrorResult {
 
 
 export class MimeTypeError extends ErrorResult {
 export class MimeTypeError extends ErrorResult {
   readonly __typename = 'MimeTypeError';
   readonly __typename = 'MimeTypeError';
-  readonly code = 'MIME_TYPE_ERROR' as any;
+  readonly errorCode = 'MIME_TYPE_ERROR' as any;
   readonly message = 'MIME_TYPE_ERROR';
   readonly message = 'MIME_TYPE_ERROR';
   constructor(
   constructor(
     public   fileName: Scalars['String'],
     public   fileName: Scalars['String'],
@@ -130,7 +130,7 @@ export class MimeTypeError extends ErrorResult {
 
 
 export class MissingConditionsError extends ErrorResult {
 export class MissingConditionsError extends ErrorResult {
   readonly __typename = 'MissingConditionsError';
   readonly __typename = 'MissingConditionsError';
-  readonly code = 'MISSING_CONDITIONS_ERROR' as any;
+  readonly errorCode = 'MISSING_CONDITIONS_ERROR' as any;
   readonly message = 'MISSING_CONDITIONS_ERROR';
   readonly message = 'MISSING_CONDITIONS_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -140,7 +140,7 @@ export class MissingConditionsError extends ErrorResult {
 
 
 export class MultipleOrderError extends ErrorResult {
 export class MultipleOrderError extends ErrorResult {
   readonly __typename = 'MultipleOrderError';
   readonly __typename = 'MultipleOrderError';
-  readonly code = 'MULTIPLE_ORDER_ERROR' as any;
+  readonly errorCode = 'MULTIPLE_ORDER_ERROR' as any;
   readonly message = 'MULTIPLE_ORDER_ERROR';
   readonly message = 'MULTIPLE_ORDER_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -150,7 +150,7 @@ export class MultipleOrderError extends ErrorResult {
 
 
 export class NativeAuthStrategyError extends ErrorResult {
 export class NativeAuthStrategyError extends ErrorResult {
   readonly __typename = 'NativeAuthStrategyError';
   readonly __typename = 'NativeAuthStrategyError';
-  readonly code = 'NATIVE_AUTH_STRATEGY_ERROR' as any;
+  readonly errorCode = 'NATIVE_AUTH_STRATEGY_ERROR' as any;
   readonly message = 'NATIVE_AUTH_STRATEGY_ERROR';
   readonly message = 'NATIVE_AUTH_STRATEGY_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -160,7 +160,7 @@ export class NativeAuthStrategyError extends ErrorResult {
 
 
 export class NothingToRefundError extends ErrorResult {
 export class NothingToRefundError extends ErrorResult {
   readonly __typename = 'NothingToRefundError';
   readonly __typename = 'NothingToRefundError';
-  readonly code = 'NOTHING_TO_REFUND_ERROR' as any;
+  readonly errorCode = 'NOTHING_TO_REFUND_ERROR' as any;
   readonly message = 'NOTHING_TO_REFUND_ERROR';
   readonly message = 'NOTHING_TO_REFUND_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -170,7 +170,7 @@ export class NothingToRefundError extends ErrorResult {
 
 
 export class OrderStateTransitionError extends ErrorResult {
 export class OrderStateTransitionError extends ErrorResult {
   readonly __typename = 'OrderStateTransitionError';
   readonly __typename = 'OrderStateTransitionError';
-  readonly code = 'ORDER_STATE_TRANSITION_ERROR' as any;
+  readonly errorCode = 'ORDER_STATE_TRANSITION_ERROR' as any;
   readonly message = 'ORDER_STATE_TRANSITION_ERROR';
   readonly message = 'ORDER_STATE_TRANSITION_ERROR';
   constructor(
   constructor(
     public   transitionError: Scalars['String'],
     public   transitionError: Scalars['String'],
@@ -183,7 +183,7 @@ export class OrderStateTransitionError extends ErrorResult {
 
 
 export class PaymentOrderMismatchError extends ErrorResult {
 export class PaymentOrderMismatchError extends ErrorResult {
   readonly __typename = 'PaymentOrderMismatchError';
   readonly __typename = 'PaymentOrderMismatchError';
-  readonly code = 'PAYMENT_ORDER_MISMATCH_ERROR' as any;
+  readonly errorCode = 'PAYMENT_ORDER_MISMATCH_ERROR' as any;
   readonly message = 'PAYMENT_ORDER_MISMATCH_ERROR';
   readonly message = 'PAYMENT_ORDER_MISMATCH_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -193,7 +193,7 @@ export class PaymentOrderMismatchError extends ErrorResult {
 
 
 export class PaymentStateTransitionError extends ErrorResult {
 export class PaymentStateTransitionError extends ErrorResult {
   readonly __typename = 'PaymentStateTransitionError';
   readonly __typename = 'PaymentStateTransitionError';
-  readonly code = 'PAYMENT_STATE_TRANSITION_ERROR' as any;
+  readonly errorCode = 'PAYMENT_STATE_TRANSITION_ERROR' as any;
   readonly message = 'PAYMENT_STATE_TRANSITION_ERROR';
   readonly message = 'PAYMENT_STATE_TRANSITION_ERROR';
   constructor(
   constructor(
     public   transitionError: Scalars['String'],
     public   transitionError: Scalars['String'],
@@ -206,7 +206,7 @@ export class PaymentStateTransitionError extends ErrorResult {
 
 
 export class ProductOptionInUseError extends ErrorResult {
 export class ProductOptionInUseError extends ErrorResult {
   readonly __typename = 'ProductOptionInUseError';
   readonly __typename = 'ProductOptionInUseError';
-  readonly code = 'PRODUCT_OPTION_IN_USE_ERROR' as any;
+  readonly errorCode = 'PRODUCT_OPTION_IN_USE_ERROR' as any;
   readonly message = 'PRODUCT_OPTION_IN_USE_ERROR';
   readonly message = 'PRODUCT_OPTION_IN_USE_ERROR';
   constructor(
   constructor(
     public   optionGroupCode: Scalars['String'],
     public   optionGroupCode: Scalars['String'],
@@ -218,7 +218,7 @@ export class ProductOptionInUseError extends ErrorResult {
 
 
 export class QuantityTooGreatError extends ErrorResult {
 export class QuantityTooGreatError extends ErrorResult {
   readonly __typename = 'QuantityTooGreatError';
   readonly __typename = 'QuantityTooGreatError';
-  readonly code = 'QUANTITY_TOO_GREAT_ERROR' as any;
+  readonly errorCode = 'QUANTITY_TOO_GREAT_ERROR' as any;
   readonly message = 'QUANTITY_TOO_GREAT_ERROR';
   readonly message = 'QUANTITY_TOO_GREAT_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -228,7 +228,7 @@ export class QuantityTooGreatError extends ErrorResult {
 
 
 export class RefundOrderStateError extends ErrorResult {
 export class RefundOrderStateError extends ErrorResult {
   readonly __typename = 'RefundOrderStateError';
   readonly __typename = 'RefundOrderStateError';
-  readonly code = 'REFUND_ORDER_STATE_ERROR' as any;
+  readonly errorCode = 'REFUND_ORDER_STATE_ERROR' as any;
   readonly message = 'REFUND_ORDER_STATE_ERROR';
   readonly message = 'REFUND_ORDER_STATE_ERROR';
   constructor(
   constructor(
     public   orderState: Scalars['String'],
     public   orderState: Scalars['String'],
@@ -239,7 +239,7 @@ export class RefundOrderStateError extends ErrorResult {
 
 
 export class RefundStateTransitionError extends ErrorResult {
 export class RefundStateTransitionError extends ErrorResult {
   readonly __typename = 'RefundStateTransitionError';
   readonly __typename = 'RefundStateTransitionError';
-  readonly code = 'REFUND_STATE_TRANSITION_ERROR' as any;
+  readonly errorCode = 'REFUND_STATE_TRANSITION_ERROR' as any;
   readonly message = 'REFUND_STATE_TRANSITION_ERROR';
   readonly message = 'REFUND_STATE_TRANSITION_ERROR';
   constructor(
   constructor(
     public   transitionError: Scalars['String'],
     public   transitionError: Scalars['String'],
@@ -252,7 +252,7 @@ export class RefundStateTransitionError extends ErrorResult {
 
 
 export class SettlePaymentError extends ErrorResult {
 export class SettlePaymentError extends ErrorResult {
   readonly __typename = 'SettlePaymentError';
   readonly __typename = 'SettlePaymentError';
-  readonly code = 'SETTLE_PAYMENT_ERROR' as any;
+  readonly errorCode = 'SETTLE_PAYMENT_ERROR' as any;
   readonly message = 'SETTLE_PAYMENT_ERROR';
   readonly message = 'SETTLE_PAYMENT_ERROR';
   constructor(
   constructor(
     public   paymentErrorMessage: Scalars['String'],
     public   paymentErrorMessage: Scalars['String'],

+ 23 - 23
packages/core/src/common/error/generated-graphql-shop-errors.ts

@@ -14,13 +14,13 @@ export type Scalars = {
 
 
 export class ErrorResult {
 export class ErrorResult {
   readonly __typename: string;
   readonly __typename: string;
-  readonly code: string;
+  readonly errorCode: string;
   message: Scalars['String'];
   message: Scalars['String'];
 }
 }
 
 
 export class AlreadyLoggedInError extends ErrorResult {
 export class AlreadyLoggedInError extends ErrorResult {
   readonly __typename = 'AlreadyLoggedInError';
   readonly __typename = 'AlreadyLoggedInError';
-  readonly code = 'ALREADY_LOGGED_IN_ERROR' as any;
+  readonly errorCode = 'ALREADY_LOGGED_IN_ERROR' as any;
   readonly message = 'ALREADY_LOGGED_IN_ERROR';
   readonly message = 'ALREADY_LOGGED_IN_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -30,7 +30,7 @@ export class AlreadyLoggedInError extends ErrorResult {
 
 
 export class CouponCodeExpiredError extends ErrorResult {
 export class CouponCodeExpiredError extends ErrorResult {
   readonly __typename = 'CouponCodeExpiredError';
   readonly __typename = 'CouponCodeExpiredError';
-  readonly code = 'COUPON_CODE_EXPIRED_ERROR' as any;
+  readonly errorCode = 'COUPON_CODE_EXPIRED_ERROR' as any;
   readonly message = 'COUPON_CODE_EXPIRED_ERROR';
   readonly message = 'COUPON_CODE_EXPIRED_ERROR';
   constructor(
   constructor(
     public   couponCode: Scalars['String'],
     public   couponCode: Scalars['String'],
@@ -41,7 +41,7 @@ export class CouponCodeExpiredError extends ErrorResult {
 
 
 export class CouponCodeInvalidError extends ErrorResult {
 export class CouponCodeInvalidError extends ErrorResult {
   readonly __typename = 'CouponCodeInvalidError';
   readonly __typename = 'CouponCodeInvalidError';
-  readonly code = 'COUPON_CODE_INVALID_ERROR' as any;
+  readonly errorCode = 'COUPON_CODE_INVALID_ERROR' as any;
   readonly message = 'COUPON_CODE_INVALID_ERROR';
   readonly message = 'COUPON_CODE_INVALID_ERROR';
   constructor(
   constructor(
     public   couponCode: Scalars['String'],
     public   couponCode: Scalars['String'],
@@ -52,7 +52,7 @@ export class CouponCodeInvalidError extends ErrorResult {
 
 
 export class CouponCodeLimitError extends ErrorResult {
 export class CouponCodeLimitError extends ErrorResult {
   readonly __typename = 'CouponCodeLimitError';
   readonly __typename = 'CouponCodeLimitError';
-  readonly code = 'COUPON_CODE_LIMIT_ERROR' as any;
+  readonly errorCode = 'COUPON_CODE_LIMIT_ERROR' as any;
   readonly message = 'COUPON_CODE_LIMIT_ERROR';
   readonly message = 'COUPON_CODE_LIMIT_ERROR';
   constructor(
   constructor(
     public   couponCode: Scalars['String'],
     public   couponCode: Scalars['String'],
@@ -64,7 +64,7 @@ export class CouponCodeLimitError extends ErrorResult {
 
 
 export class EmailAddressConflictError extends ErrorResult {
 export class EmailAddressConflictError extends ErrorResult {
   readonly __typename = 'EmailAddressConflictError';
   readonly __typename = 'EmailAddressConflictError';
-  readonly code = 'EMAIL_ADDRESS_CONFLICT_ERROR' as any;
+  readonly errorCode = 'EMAIL_ADDRESS_CONFLICT_ERROR' as any;
   readonly message = 'EMAIL_ADDRESS_CONFLICT_ERROR';
   readonly message = 'EMAIL_ADDRESS_CONFLICT_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -74,7 +74,7 @@ export class EmailAddressConflictError extends ErrorResult {
 
 
 export class IdentifierChangeTokenExpiredError extends ErrorResult {
 export class IdentifierChangeTokenExpiredError extends ErrorResult {
   readonly __typename = 'IdentifierChangeTokenExpiredError';
   readonly __typename = 'IdentifierChangeTokenExpiredError';
-  readonly code = 'IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR' as any;
+  readonly errorCode = 'IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR' as any;
   readonly message = 'IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR';
   readonly message = 'IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -84,7 +84,7 @@ export class IdentifierChangeTokenExpiredError extends ErrorResult {
 
 
 export class IdentifierChangeTokenInvalidError extends ErrorResult {
 export class IdentifierChangeTokenInvalidError extends ErrorResult {
   readonly __typename = 'IdentifierChangeTokenInvalidError';
   readonly __typename = 'IdentifierChangeTokenInvalidError';
-  readonly code = 'IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR' as any;
+  readonly errorCode = 'IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR' as any;
   readonly message = 'IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR';
   readonly message = 'IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -94,7 +94,7 @@ export class IdentifierChangeTokenInvalidError extends ErrorResult {
 
 
 export class InvalidCredentialsError extends ErrorResult {
 export class InvalidCredentialsError extends ErrorResult {
   readonly __typename = 'InvalidCredentialsError';
   readonly __typename = 'InvalidCredentialsError';
-  readonly code = 'INVALID_CREDENTIALS_ERROR' as any;
+  readonly errorCode = 'INVALID_CREDENTIALS_ERROR' as any;
   readonly message = 'INVALID_CREDENTIALS_ERROR';
   readonly message = 'INVALID_CREDENTIALS_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -104,7 +104,7 @@ export class InvalidCredentialsError extends ErrorResult {
 
 
 export class MissingPasswordError extends ErrorResult {
 export class MissingPasswordError extends ErrorResult {
   readonly __typename = 'MissingPasswordError';
   readonly __typename = 'MissingPasswordError';
-  readonly code = 'MISSING_PASSWORD_ERROR' as any;
+  readonly errorCode = 'MISSING_PASSWORD_ERROR' as any;
   readonly message = 'MISSING_PASSWORD_ERROR';
   readonly message = 'MISSING_PASSWORD_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -114,7 +114,7 @@ export class MissingPasswordError extends ErrorResult {
 
 
 export class NativeAuthStrategyError extends ErrorResult {
 export class NativeAuthStrategyError extends ErrorResult {
   readonly __typename = 'NativeAuthStrategyError';
   readonly __typename = 'NativeAuthStrategyError';
-  readonly code = 'NATIVE_AUTH_STRATEGY_ERROR' as any;
+  readonly errorCode = 'NATIVE_AUTH_STRATEGY_ERROR' as any;
   readonly message = 'NATIVE_AUTH_STRATEGY_ERROR';
   readonly message = 'NATIVE_AUTH_STRATEGY_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -124,7 +124,7 @@ export class NativeAuthStrategyError extends ErrorResult {
 
 
 export class NegativeQuantityError extends ErrorResult {
 export class NegativeQuantityError extends ErrorResult {
   readonly __typename = 'NegativeQuantityError';
   readonly __typename = 'NegativeQuantityError';
-  readonly code = 'NEGATIVE_QUANTITY_ERROR' as any;
+  readonly errorCode = 'NEGATIVE_QUANTITY_ERROR' as any;
   readonly message = 'NEGATIVE_QUANTITY_ERROR';
   readonly message = 'NEGATIVE_QUANTITY_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -134,7 +134,7 @@ export class NegativeQuantityError extends ErrorResult {
 
 
 export class OrderLimitError extends ErrorResult {
 export class OrderLimitError extends ErrorResult {
   readonly __typename = 'OrderLimitError';
   readonly __typename = 'OrderLimitError';
-  readonly code = 'ORDER_LIMIT_ERROR' as any;
+  readonly errorCode = 'ORDER_LIMIT_ERROR' as any;
   readonly message = 'ORDER_LIMIT_ERROR';
   readonly message = 'ORDER_LIMIT_ERROR';
   constructor(
   constructor(
     public   maxItems: Scalars['Int'],
     public   maxItems: Scalars['Int'],
@@ -145,7 +145,7 @@ export class OrderLimitError extends ErrorResult {
 
 
 export class OrderModificationError extends ErrorResult {
 export class OrderModificationError extends ErrorResult {
   readonly __typename = 'OrderModificationError';
   readonly __typename = 'OrderModificationError';
-  readonly code = 'ORDER_MODIFICATION_ERROR' as any;
+  readonly errorCode = 'ORDER_MODIFICATION_ERROR' as any;
   readonly message = 'ORDER_MODIFICATION_ERROR';
   readonly message = 'ORDER_MODIFICATION_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -155,7 +155,7 @@ export class OrderModificationError extends ErrorResult {
 
 
 export class OrderPaymentStateError extends ErrorResult {
 export class OrderPaymentStateError extends ErrorResult {
   readonly __typename = 'OrderPaymentStateError';
   readonly __typename = 'OrderPaymentStateError';
-  readonly code = 'ORDER_PAYMENT_STATE_ERROR' as any;
+  readonly errorCode = 'ORDER_PAYMENT_STATE_ERROR' as any;
   readonly message = 'ORDER_PAYMENT_STATE_ERROR';
   readonly message = 'ORDER_PAYMENT_STATE_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -165,7 +165,7 @@ export class OrderPaymentStateError extends ErrorResult {
 
 
 export class OrderStateTransitionError extends ErrorResult {
 export class OrderStateTransitionError extends ErrorResult {
   readonly __typename = 'OrderStateTransitionError';
   readonly __typename = 'OrderStateTransitionError';
-  readonly code = 'ORDER_STATE_TRANSITION_ERROR' as any;
+  readonly errorCode = 'ORDER_STATE_TRANSITION_ERROR' as any;
   readonly message = 'ORDER_STATE_TRANSITION_ERROR';
   readonly message = 'ORDER_STATE_TRANSITION_ERROR';
   constructor(
   constructor(
     public   transitionError: Scalars['String'],
     public   transitionError: Scalars['String'],
@@ -178,7 +178,7 @@ export class OrderStateTransitionError extends ErrorResult {
 
 
 export class PasswordAlreadySetError extends ErrorResult {
 export class PasswordAlreadySetError extends ErrorResult {
   readonly __typename = 'PasswordAlreadySetError';
   readonly __typename = 'PasswordAlreadySetError';
-  readonly code = 'PASSWORD_ALREADY_SET_ERROR' as any;
+  readonly errorCode = 'PASSWORD_ALREADY_SET_ERROR' as any;
   readonly message = 'PASSWORD_ALREADY_SET_ERROR';
   readonly message = 'PASSWORD_ALREADY_SET_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -188,7 +188,7 @@ export class PasswordAlreadySetError extends ErrorResult {
 
 
 export class PasswordResetTokenExpiredError extends ErrorResult {
 export class PasswordResetTokenExpiredError extends ErrorResult {
   readonly __typename = 'PasswordResetTokenExpiredError';
   readonly __typename = 'PasswordResetTokenExpiredError';
-  readonly code = 'PASSWORD_RESET_TOKEN_EXPIRED_ERROR' as any;
+  readonly errorCode = 'PASSWORD_RESET_TOKEN_EXPIRED_ERROR' as any;
   readonly message = 'PASSWORD_RESET_TOKEN_EXPIRED_ERROR';
   readonly message = 'PASSWORD_RESET_TOKEN_EXPIRED_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -198,7 +198,7 @@ export class PasswordResetTokenExpiredError extends ErrorResult {
 
 
 export class PasswordResetTokenInvalidError extends ErrorResult {
 export class PasswordResetTokenInvalidError extends ErrorResult {
   readonly __typename = 'PasswordResetTokenInvalidError';
   readonly __typename = 'PasswordResetTokenInvalidError';
-  readonly code = 'PASSWORD_RESET_TOKEN_INVALID_ERROR' as any;
+  readonly errorCode = 'PASSWORD_RESET_TOKEN_INVALID_ERROR' as any;
   readonly message = 'PASSWORD_RESET_TOKEN_INVALID_ERROR';
   readonly message = 'PASSWORD_RESET_TOKEN_INVALID_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -208,7 +208,7 @@ export class PasswordResetTokenInvalidError extends ErrorResult {
 
 
 export class PaymentDeclinedError extends ErrorResult {
 export class PaymentDeclinedError extends ErrorResult {
   readonly __typename = 'PaymentDeclinedError';
   readonly __typename = 'PaymentDeclinedError';
-  readonly code = 'PAYMENT_DECLINED_ERROR' as any;
+  readonly errorCode = 'PAYMENT_DECLINED_ERROR' as any;
   readonly message = 'PAYMENT_DECLINED_ERROR';
   readonly message = 'PAYMENT_DECLINED_ERROR';
   constructor(
   constructor(
     public   paymentErrorMessage: Scalars['String'],
     public   paymentErrorMessage: Scalars['String'],
@@ -219,7 +219,7 @@ export class PaymentDeclinedError extends ErrorResult {
 
 
 export class PaymentFailedError extends ErrorResult {
 export class PaymentFailedError extends ErrorResult {
   readonly __typename = 'PaymentFailedError';
   readonly __typename = 'PaymentFailedError';
-  readonly code = 'PAYMENT_FAILED_ERROR' as any;
+  readonly errorCode = 'PAYMENT_FAILED_ERROR' as any;
   readonly message = 'PAYMENT_FAILED_ERROR';
   readonly message = 'PAYMENT_FAILED_ERROR';
   constructor(
   constructor(
     public   paymentErrorMessage: Scalars['String'],
     public   paymentErrorMessage: Scalars['String'],
@@ -230,7 +230,7 @@ export class PaymentFailedError extends ErrorResult {
 
 
 export class VerificationTokenExpiredError extends ErrorResult {
 export class VerificationTokenExpiredError extends ErrorResult {
   readonly __typename = 'VerificationTokenExpiredError';
   readonly __typename = 'VerificationTokenExpiredError';
-  readonly code = 'VERIFICATION_TOKEN_EXPIRED_ERROR' as any;
+  readonly errorCode = 'VERIFICATION_TOKEN_EXPIRED_ERROR' as any;
   readonly message = 'VERIFICATION_TOKEN_EXPIRED_ERROR';
   readonly message = 'VERIFICATION_TOKEN_EXPIRED_ERROR';
   constructor(
   constructor(
   ) {
   ) {
@@ -240,7 +240,7 @@ export class VerificationTokenExpiredError extends ErrorResult {
 
 
 export class VerificationTokenInvalidError extends ErrorResult {
 export class VerificationTokenInvalidError extends ErrorResult {
   readonly __typename = 'VerificationTokenInvalidError';
   readonly __typename = 'VerificationTokenInvalidError';
-  readonly code = 'VERIFICATION_TOKEN_INVALID_ERROR' as any;
+  readonly errorCode = 'VERIFICATION_TOKEN_INVALID_ERROR' as any;
   readonly message = 'VERIFICATION_TOKEN_INVALID_ERROR';
   readonly message = 'VERIFICATION_TOKEN_INVALID_ERROR';
   constructor(
   constructor(
   ) {
   ) {

+ 24 - 23
packages/elasticsearch-plugin/e2e/graphql/generated-e2e-elasticsearch-plugin-types.ts

@@ -109,7 +109,7 @@ export type AdministratorSortParameter = {
 
 
 /** Returned if an attempting to refund an OrderItem which has already been refunded */
 /** Returned if an attempting to refund an OrderItem which has already been refunded */
 export type AlreadyRefundedError = ErrorResult & {
 export type AlreadyRefundedError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     refundId: Scalars['ID'];
     refundId: Scalars['ID'];
 };
 };
@@ -208,7 +208,7 @@ export type BooleanOperators = {
 
 
 /** Returned if an attempting to cancel lines from an Order which is still active */
 /** Returned if an attempting to cancel lines from an Order which is still active */
 export type CancelActiveOrderError = ErrorResult & {
 export type CancelActiveOrderError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     orderState: Scalars['String'];
     orderState: Scalars['String'];
 };
 };
@@ -258,7 +258,7 @@ export type Channel = Node & {
  * of the GlobalSettings
  * of the GlobalSettings
  */
  */
 export type ChannelDefaultLanguageError = ErrorResult & {
 export type ChannelDefaultLanguageError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     language: Scalars['String'];
     language: Scalars['String'];
     channelCode: Scalars['String'];
     channelCode: Scalars['String'];
@@ -1141,13 +1141,13 @@ export enum DeletionResult {
 
 
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 /** Retured when attemting to create a Customer with an email address already registered to an existing User. */
 export type EmailAddressConflictError = ErrorResult & {
 export type EmailAddressConflictError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned if no OrderLines have been specified for the operation */
 /** Returned if no OrderLines have been specified for the operation */
 export type EmptyOrderLineSelectionError = ErrorResult & {
 export type EmptyOrderLineSelectionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1178,7 +1178,7 @@ export enum ErrorCode {
 }
 }
 
 
 export type ErrorResult = {
 export type ErrorResult = {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1301,7 +1301,7 @@ export type Fulfillment = Node & {
 
 
 /** Returned when there is an error in transitioning the Fulfillment state */
 /** Returned when there is an error in transitioning the Fulfillment state */
 export type FulfillmentStateTransitionError = ErrorResult & {
 export type FulfillmentStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -1406,13 +1406,13 @@ export type IntCustomFieldConfig = CustomField & {
 
 
 /** Returned if the user authentication credentials are not valid */
 /** Returned if the user authentication credentials are not valid */
 export type InvalidCredentialsError = ErrorResult & {
 export type InvalidCredentialsError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned if the specified items are already part of a Fulfillment */
 /** Returned if the specified items are already part of a Fulfillment */
 export type ItemsAlreadyFulfilledError = ErrorResult & {
 export type ItemsAlreadyFulfilledError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1809,8 +1809,9 @@ export enum LanguageCode {
     zu = 'zu',
     zu = 'zu',
 }
 }
 
 
+/** Returned if attempting to set a Channel's defaultLanguageCode to a language which is not enabled in GlobalSettings */
 export type LanguageNotAvailableError = ErrorResult & {
 export type LanguageNotAvailableError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     languageCode: Scalars['String'];
     languageCode: Scalars['String'];
 };
 };
@@ -1838,7 +1839,7 @@ export enum LogicalOperator {
 }
 }
 
 
 export type MimeTypeError = ErrorResult & {
 export type MimeTypeError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     fileName: Scalars['String'];
     fileName: Scalars['String'];
     mimeType: Scalars['String'];
     mimeType: Scalars['String'];
@@ -1846,7 +1847,7 @@ export type MimeTypeError = ErrorResult & {
 
 
 /** Returned if a PromotionCondition has neither a couponCode nor any conditions set */
 /** Returned if a PromotionCondition has neither a couponCode nor any conditions set */
 export type MissingConditionsError = ErrorResult & {
 export type MissingConditionsError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -1858,7 +1859,7 @@ export type MoveCollectionInput = {
 
 
 /** Returned if an operation has specified OrderLines from multiple Orders */
 /** Returned if an operation has specified OrderLines from multiple Orders */
 export type MultipleOrderError = ErrorResult & {
 export type MultipleOrderError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2413,7 +2414,7 @@ export type NativeAuthInput = {
 
 
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 /** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */
 export type NativeAuthStrategyError = ErrorResult & {
 export type NativeAuthStrategyError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2423,7 +2424,7 @@ export type Node = {
 
 
 /** Returned if an attempting to refund an Order but neither items nor shipping refund was specified */
 /** Returned if an attempting to refund an Order but neither items nor shipping refund was specified */
 export type NothingToRefundError = ErrorResult & {
 export type NothingToRefundError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -2575,7 +2576,7 @@ export type OrderSortParameter = {
 
 
 /** Returned if there is an error in transitioning the Order state */
 /** Returned if there is an error in transitioning the Order state */
 export type OrderStateTransitionError = ErrorResult & {
 export type OrderStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -2638,13 +2639,13 @@ export type PaymentMethodSortParameter = {
 
 
 /** Returned if an attempting to refund a Payment against OrderLines from a different Order */
 /** Returned if an attempting to refund a Payment against OrderLines from a different Order */
 export type PaymentOrderMismatchError = ErrorResult & {
 export type PaymentOrderMismatchError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
 /** Returned when there is an error in transitioning the Payment state */
 /** Returned when there is an error in transitioning the Payment state */
 export type PaymentStateTransitionError = ErrorResult & {
 export type PaymentStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -2783,7 +2784,7 @@ export type ProductOptionGroupTranslationInput = {
 };
 };
 
 
 export type ProductOptionInUseError = ErrorResult & {
 export type ProductOptionInUseError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     optionGroupCode: Scalars['String'];
     optionGroupCode: Scalars['String'];
     productVariantCount: Scalars['Int'];
     productVariantCount: Scalars['Int'];
@@ -2967,7 +2968,7 @@ export type PromotionSortParameter = {
 
 
 /** Returned if the specified quantity of an OrderLine is greater than the number of items in that line */
 /** Returned if the specified quantity of an OrderLine is greater than the number of items in that line */
 export type QuantityTooGreatError = ErrorResult & {
 export type QuantityTooGreatError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
 };
 };
 
 
@@ -3231,14 +3232,14 @@ export type RefundOrderResult =
 
 
 /** Returned if an attempting to refund an Order which is not in the expected state */
 /** Returned if an attempting to refund an Order which is not in the expected state */
 export type RefundOrderStateError = ErrorResult & {
 export type RefundOrderStateError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     orderState: Scalars['String'];
     orderState: Scalars['String'];
 };
 };
 
 
 /** Returned when there is an error in transitioning the Refund state */
 /** Returned when there is an error in transitioning the Refund state */
 export type RefundStateTransitionError = ErrorResult & {
 export type RefundStateTransitionError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     transitionError: Scalars['String'];
     transitionError: Scalars['String'];
     fromState: Scalars['String'];
     fromState: Scalars['String'];
@@ -3383,7 +3384,7 @@ export type ServerConfig = {
 
 
 /** Returned if the Payment settlement fails */
 /** Returned if the Payment settlement fails */
 export type SettlePaymentError = ErrorResult & {
 export type SettlePaymentError = ErrorResult & {
-    code: ErrorCode;
+    errorCode: ErrorCode;
     message: Scalars['String'];
     message: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
     paymentErrorMessage: Scalars['String'];
 };
 };

+ 1 - 1
packages/testing/src/simple-graphql-client.ts

@@ -22,7 +22,7 @@ const LOGIN = gql`
                 }
                 }
             }
             }
             ... on ErrorResult {
             ... on ErrorResult {
-                code
+                errorCode
                 message
                 message
             }
             }
         }
         }

File diff suppressed because it is too large
+ 0 - 0
schema-admin.json


File diff suppressed because it is too large
+ 0 - 0
schema-shop.json


+ 21 - 18
scripts/codegen/generate-graphql-types.ts

@@ -106,24 +106,27 @@ Promise.all([
                     plugins: clientPlugins,
                     plugins: clientPlugins,
                     config: e2eConfig,
                     config: e2eConfig,
                 },
                 },
-                // [path.join(
-                //     __dirname,
-                //     '../../packages/admin-ui/src/lib/core/src/common/generated-types.ts',
-                // )]: {
-                //     schema: [ADMIN_SCHEMA_OUTPUT_FILE, path.join(__dirname, 'client-schema.ts')],
-                //     documents: CLIENT_QUERY_FILES,
-                //     plugins: clientPlugins,
-                //     config,
-                // },
-                // [path.join(
-                //     __dirname,
-                //     '../../packages/admin-ui/src/lib/core/src/common/introspection-result.ts',
-                // )]: {
-                //     schema: [ADMIN_SCHEMA_OUTPUT_FILE, path.join(__dirname, 'client-schema.ts')],
-                //     documents: CLIENT_QUERY_FILES,
-                //     plugins: [disableTsLintPlugin, 'fragment-matcher'],
-                //     config,
-                // },
+                [path.join(
+                    __dirname,
+                    '../../packages/admin-ui/src/lib/core/src/common/generated-types.ts',
+                )]: {
+                    schema: [ADMIN_SCHEMA_OUTPUT_FILE, path.join(__dirname, 'client-schema.ts')],
+                    documents: CLIENT_QUERY_FILES,
+                    plugins: clientPlugins,
+                    config: {
+                        ...config,
+                        skipTypeNameForRoot: true,
+                    },
+                },
+                [path.join(
+                    __dirname,
+                    '../../packages/admin-ui/src/lib/core/src/common/introspection-result.ts',
+                )]: {
+                    schema: [ADMIN_SCHEMA_OUTPUT_FILE, path.join(__dirname, 'client-schema.ts')],
+                    documents: CLIENT_QUERY_FILES,
+                    plugins: [disableTsLintPlugin, 'fragment-matcher'],
+                    config,
+                },
                 [path.join(__dirname, '../../packages/common/src/generated-types.ts')]: {
                 [path.join(__dirname, '../../packages/common/src/generated-types.ts')]: {
                     schema: [ADMIN_SCHEMA_OUTPUT_FILE],
                     schema: [ADMIN_SCHEMA_OUTPUT_FILE],
                     plugins: commonPlugins,
                     plugins: commonPlugins,

+ 4 - 4
scripts/codegen/plugins/graphql-errors-plugin.ts

@@ -56,8 +56,8 @@ const errorsVisitor: Visitor<any> = {
         return [
         return [
             `export class ${ERROR_INTERFACE_NAME} {`,
             `export class ${ERROR_INTERFACE_NAME} {`,
             `  readonly __typename: string;`,
             `  readonly __typename: string;`,
-            `  readonly code: string;`,
-            ...node.fields.filter(f => !(f as any).includes('code:')).map(f => `${f};`),
+            `  readonly errorCode: string;`,
+            ...node.fields.filter(f => !(f as any).includes('errorCode:')).map(f => `${f};`),
             `}`,
             `}`,
         ].join('\n');
         ].join('\n');
     },
     },
@@ -78,11 +78,11 @@ const errorsVisitor: Visitor<any> = {
             // We cast this to "any" otherwise we need to specify it as type "ErrorCode",
             // We cast this to "any" otherwise we need to specify it as type "ErrorCode",
             // which means shared ErrorResult classes e.g. OrderStateTransitionError
             // which means shared ErrorResult classes e.g. OrderStateTransitionError
             // will not be compatible between the admin and shop variations.
             // will not be compatible between the admin and shop variations.
-            `  readonly code = '${camelToUpperSnakeCase(node.name.value)}' as any;`,
+            `  readonly errorCode = '${camelToUpperSnakeCase(node.name.value)}' as any;`,
             `  readonly message = '${camelToUpperSnakeCase(node.name.value)}';`,
             `  readonly message = '${camelToUpperSnakeCase(node.name.value)}';`,
             `  constructor(`,
             `  constructor(`,
             ...node.fields
             ...node.fields
-                .filter(f => !(f as any).includes('code:') && !(f as any).includes('message:'))
+                .filter(f => !(f as any).includes('errorCode:') && !(f as any).includes('message:'))
                 .map(f => `    public ${f},`),
                 .map(f => `    public ${f},`),
             `  ) {`,
             `  ) {`,
             `    super();`,
             `    super();`,

Some files were not shown because too many files changed in this diff