Hacker News new | ask | show | jobs
by RoboTeddy 2557 days ago
I like GraphQL a lot — but found that writing mutations involved a ton of boilerplate. For example, I'd have to keep writing the same key names over and over again. Anyone else experience this?
2 comments

You could use input types and reduce the boilerplate to a single parameter, which you then send as an object in the request variables?
yeah that's what i did. inputs also help a bit with code reuse, imho.
Yes, Mutations are still annoying to write. Especially with all the optimisticResponses and pushing things into collections.