Skip to content

How can I do multiple mutations with one request using an array? #11

@cotterjd

Description

@cotterjd

For an example. I have an array of things that I want to save with one request.
Without graphql-client it would look something like this.

const query = `
  mutation {
    ${things.map((x, i) => `
        m${i}: createThing(data: {name: "${x.name}"}) { id }
      `).join(' ')}
   }`

How would you do it with graphql-client making use of variables?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions