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

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: "[email protected]"
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.

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