Closed anaya12345 closed 1 year ago
any updates?
Hi @anaya12345. I created an app locally using your model schema but was unable to reproduce any errors locally. I was able to successfully mutate an existing record and log it.
I see that you are using a predicate to query for the existing record in the first place - a couple questions:
As a sanity check, could you:
Daily health data record saved:
?solved using Graph QL query instead of API.mutate
is there any more detail on this? Experiencing similar issues
I am also experiencing the same issue. Why was this issue closed? The solution above that led to this issue's closing was not really a solution but a workaround. As it stands, it seems that API.mutate
is unable to do the updates for us.
When I use API.mutate
to update - as described in the documentation, e.g, via this type of code:
Future<void> updateTodo(Todo originalTodo) async {
final todoWithNewName = originalTodo.copyWith(name: 'new name');
final request = ModelMutations.update(todoWithNewName);
final response = await Amplify.API.mutate(request: request).response;
safePrint('Response: $response');
}
Then the update finishes without error, but what is returned in response
is the non-updated original object from the DB, i.e, the update does not fail but the result is as if we did not do the update at all, it is not taken into account and processed in the DB, the DB does not change. Please revive this issue until API.mutate
works or until the documentation tells us to do things differently. Thanks!
solved using Graph QL query instead of API.mutate
@anaya12345 Do you mean you solved this by using API.query
instead of API.mutate
? is it possible to share how you did this via a GraphQL query? Or if anybody has any links to the proper way of implementing this workaround (syntax) I would very much appreciate it.
I am facing this issue. Please help me if this issue is fixed. API.mutate did not update the model though _version is updated at model butnot values.
Mine worked after disabling conflict detection .
Description
In flutte application, when I call Amplify.API.mutate for ModelMutations.update(), the query does not return an error however it is not updating the item. The result of the query is not an error but if you look at the values meant to have been updated. Here is my code:
DateTime curDateTime = DateTime.now();
Here create is working file, but for update, it returning the existing object values, updated values I am not getting in response.
Please guide asap, I am struggling for this from 2 days. I am waiting for some reply.
Categories
Steps to Reproduce
No response
Screenshots
No response
Platforms
Android Device/Emulator API Level
No response
Environment
Dependencies
Device
Nokia 6.1plus
OS
Android 11
CLI Version
9.1.0
Additional Context
No response