Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple mutation graphql dose not work KeystoneJS #3537

Closed
maheraldous opened this issue Aug 31, 2020 · 2 comments
Closed

Multiple mutation graphql dose not work KeystoneJS #3537

maheraldous opened this issue Aug 31, 2020 · 2 comments

Comments

@maheraldous
Copy link
Contributor

maheraldous commented Aug 31, 2020

I just started using Keystone and when I use this code below in the image, it work and create one user but as long I use the second code it won't work.
I want to create multiple mutation graphql

https://prnt.sc/u97b18

https://prnt.sc/u97bmq
https://prnt.sc/ukmj9q

This issue is closed in here issue#562 but seems is not done yet.

@dylantmarsh
Copy link

You need to nest data again. The type UserCreateInput is wrapped by UsersCreateInput. I tested this and it works fine.

mutation createMultipleUsersAtOnce {
  createUsers(data: [
    {
      data: {
        name: "user1",
        email: "user1@test.com"
      }
    },
    {
      data: {
        name: "user2",
        email: "user2@test.com"
    	}
    }
  ]) {
    name
  }
}

@maheraldous
Copy link
Contributor Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants