|
|
@@ -127,6 +127,19 @@ export class CreateFulfillmentError extends ErrorResult {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+export class DuplicateEntityError extends ErrorResult {
|
|
|
+ readonly __typename = 'DuplicateEntityError';
|
|
|
+ readonly errorCode = 'DUPLICATE_ENTITY_ERROR' as any;
|
|
|
+ readonly message = 'DUPLICATE_ENTITY_ERROR';
|
|
|
+ readonly duplicationError: Scalars['String'];
|
|
|
+ constructor(
|
|
|
+ input: { duplicationError: Scalars['String'] }
|
|
|
+ ) {
|
|
|
+ super();
|
|
|
+ this.duplicationError = input.duplicationError
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
export class EmailAddressConflictError extends ErrorResult {
|
|
|
readonly __typename = 'EmailAddressConflictError';
|
|
|
readonly errorCode = 'EMAIL_ADDRESS_CONFLICT_ERROR' as any;
|
|
|
@@ -575,7 +588,7 @@ export class SettlePaymentError extends ErrorResult {
|
|
|
}
|
|
|
|
|
|
|
|
|
-const errorTypeNames = new Set<string>(['AlreadyRefundedError', 'CancelActiveOrderError', 'CancelPaymentError', 'ChannelDefaultLanguageError', 'CouponCodeExpiredError', 'CouponCodeInvalidError', 'CouponCodeLimitError', 'CreateFulfillmentError', 'EmailAddressConflictError', 'EmptyOrderLineSelectionError', 'FacetInUseError', 'FulfillmentStateTransitionError', 'GuestCheckoutError', 'IneligibleShippingMethodError', 'InsufficientStockError', 'InsufficientStockOnHandError', 'InvalidCredentialsError', 'InvalidFulfillmentHandlerError', 'ItemsAlreadyFulfilledError', 'LanguageNotAvailableError', 'ManualPaymentStateError', 'MimeTypeError', 'MissingConditionsError', 'MultipleOrderError', 'NativeAuthStrategyError', 'NegativeQuantityError', 'NoActiveOrderError', 'NoChangesSpecifiedError', 'NothingToRefundError', 'OrderLimitError', 'OrderModificationError', 'OrderModificationStateError', 'OrderStateTransitionError', 'PaymentMethodMissingError', 'PaymentOrderMismatchError', 'PaymentStateTransitionError', 'ProductOptionInUseError', 'QuantityTooGreatError', 'RefundAmountError', 'RefundOrderStateError', 'RefundPaymentIdMissingError', 'RefundStateTransitionError', 'SettlePaymentError']);
|
|
|
+const errorTypeNames = new Set<string>(['AlreadyRefundedError', 'CancelActiveOrderError', 'CancelPaymentError', 'ChannelDefaultLanguageError', 'CouponCodeExpiredError', 'CouponCodeInvalidError', 'CouponCodeLimitError', 'CreateFulfillmentError', 'DuplicateEntityError', 'EmailAddressConflictError', 'EmptyOrderLineSelectionError', 'FacetInUseError', 'FulfillmentStateTransitionError', 'GuestCheckoutError', 'IneligibleShippingMethodError', 'InsufficientStockError', 'InsufficientStockOnHandError', 'InvalidCredentialsError', 'InvalidFulfillmentHandlerError', 'ItemsAlreadyFulfilledError', 'LanguageNotAvailableError', 'ManualPaymentStateError', 'MimeTypeError', 'MissingConditionsError', 'MultipleOrderError', 'NativeAuthStrategyError', 'NegativeQuantityError', 'NoActiveOrderError', 'NoChangesSpecifiedError', 'NothingToRefundError', 'OrderLimitError', 'OrderModificationError', 'OrderModificationStateError', 'OrderStateTransitionError', 'PaymentMethodMissingError', 'PaymentOrderMismatchError', 'PaymentStateTransitionError', 'ProductOptionInUseError', 'QuantityTooGreatError', 'RefundAmountError', 'RefundOrderStateError', 'RefundPaymentIdMissingError', 'RefundStateTransitionError', 'SettlePaymentError']);
|
|
|
function isGraphQLError(input: any): input is import('@vendure/common/lib/generated-types').ErrorResult {
|
|
|
return input instanceof ErrorResult || errorTypeNames.has(input.__typename);
|
|
|
}
|
|
|
@@ -636,6 +649,11 @@ export const adminErrorOperationTypeResolvers = {
|
|
|
return isGraphQLError(value) ? (value as any).__typename : 'Promotion';
|
|
|
},
|
|
|
},
|
|
|
+ DuplicateEntityResult: {
|
|
|
+ __resolveType(value: any) {
|
|
|
+ return isGraphQLError(value) ? (value as any).__typename : 'DuplicateEntitySuccess';
|
|
|
+ },
|
|
|
+ },
|
|
|
NativeAuthenticationResult: {
|
|
|
__resolveType(value: any) {
|
|
|
return isGraphQLError(value) ? (value as any).__typename : 'CurrentUser';
|