capactio / capact

Simple way to manage applications and infrastructure.
https://capact.io
Apache License 2.0
80 stars 19 forks source link

Always store the `value` property on `update` mutation #661

Closed mszostok closed 2 years ago

mszostok commented 2 years ago

Description

Currently, we don't update the value property on update mutation when the value field is not requested to be returned on response. This is not acceptable, and we need to fix it. We were not able to solve this problem in https://github.com/capactio/capact/issues/645 as we run of time.

Options

We pick option 1:

1. Move code to the update mutation resolver, but this will make the transaction handling harder. This will be done before the query will be executed. In case of failed query, we won't be able to remove it from external storage.

~1. On update mutation, return only id and alias. Same as we do on create mutation. It is the simplest solution, but significantly degrades usability.~

~1. Manipulate the query fields. If user didn't ask for value add it on request, and remove it on response.~

Expected behavior

The value property is always updated, and it doesn't depend on the user query return fields.

Actual behavior

If the value is not requested on the GQL response, the value is not updated.

Related issues

See epic #604 for reason and use cases.