Good day! How can I insert some query in mutation ...
# kgraphql
y
Good day! How can I insert some query in mutation resolver?
j
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
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
Copy code
type Mutation {
  likePost(id: 1): LikePostPayload
}

type LikePostPayload {
   record: Post
   query: Query
}
j
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
Here's an example