Background: I have built a data grid with cell editing on the frontend. Everytime you edit a field in a cell, it is instantly updated on the server. So I thought it would be a good practice to only submit that single field in my mutation. This would reduce network traffic size and the backend would process the update faster (this is all optimization on a very high level of course).
This means the argument that I send with my GraphQL mutation is variable. You can very nicely inject argument values through GraphQL variables, but what is a good way for the keys?
To visualize the problem, this is something I'd wish for:
mutation($id: 1, $field: "first_name", $value: "John") {
updateClient(
id: $id,
$field: $value
) {
id
}
}