Good day! How can I insert some query in mutation resolver?
j
jeggy
06/15/2020, 8:58 AM
not really sure what you mean? But you can return anything you want from a mutation resolver just like you would with a query resolver.
y
Yuri Kornienko
06/16/2020, 4:13 AM
returning a query field with Query type will allow the client in one round-trip not only to call mutation but also to get a wagon of data to update their application
type Mutation {
likePost(id: 1): LikePostPayload
}
type LikePostPayload {
record: Post
query: Query
}
Something like this is not supported by KGraphQL 😞
I don't really follow why someone would recommend returning the whole Query type on any type.
My suggestion would be to have a mutation and that should return the updated value back. And if you need some complicated query on a mutation then you just need to make sure that you are returning the correct value back