Skip to content
New issue

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

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

Already on GitHub? # to your account

Question: How can I define nested mutation? #33

Open
mtheolog opened this issue Mar 28, 2019 · 1 comment
Open

Question: How can I define nested mutation? #33

mtheolog opened this issue Mar 28, 2019 · 1 comment

Comments

@mtheolog
Copy link

Suppose i have the following schema:
type User{
id: ID! @unique
age: Int
email: String! @unique
name: String!
posts: [Post!]!
}

type Post {
id: ID! @unique
title: String!
published: Boolean!
author: User!
}
How can I implemented a nested mutation like:
mutation {
createPost(data: {
title: "This is a draft"
published: false
author: {
create: {
email: "athina@example.com"
name:"athina"
}
}
}) {
id
title
published
author {
name
email
}
}
}

@5achinJani
Copy link

#14 there's closed PR for this. It isn't merged yet so you can create a fork and merge this in your fork and use this.

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

No branches or pull requests

2 participants