Skip to content

How can I deliberately fail a mutation for testing purposes? #2673

Description

@john1625b

For example in the following code, how do I make the code go into the .catch block

    changeSubjectLine({
      variables: {
        campaignId,
      },
    })
      .then(() => {
        toast(successToast('Subject line dynamic saved.'));
      })
      .catch((e) => {
        toast(errorToastConfig(e));
      // I want the code to go into here
      });

Is there a flag I can put in there to make it do that

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions