ngraphql
ngraphql copied to clipboard
Query type field
Hi @rivantsov ,
When reading this, it suggests that for each mutation should have a dedicated payload, and the payload should return a field of Query type.
I am wondering how do we achieve this with NGraphQL?
Thanks in advance.
that's an interesting trick they suggest, not sure it aligns with graphql standard and principles, never saw it used - to add a query field to Mutation object. It might work in NGraphQL I will try it on my test app and let you know. and you can try it too
no, that's not possible currently with NGraphQL. I will look in the future if it can be accommodated, but I feel like this trick goes against basic rules of GraphQL - keeping mutation and Query object completely separated. I do agree that this is a questionable principle, and there were suggestions to improve it by 'merging' mutation and Query objects, and also allowing nested mutations, but this did not go anywhere. Folks at GraphQL Working Group strongly oppose any such moves because of some abstract principles they established bla bla bla