Y
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
KenanSulayman
2557 days ago
You could use input types and reduce the boilerplate to a single parameter, which you then send as an object in the request variables?
link
fernandotakai
2557 days ago
yeah that's what i did. inputs also help a bit with code reuse, imho.
link
crucialfelix
2557 days ago
Yes, Mutations are still annoying to write. Especially with all the optimisticResponses and pushing things into collections.
link