Closed asatvilker closed 3 years ago
Hey @asatvilker 👋 Are you using DataStore in your app? Also, are you experiencing the same behavior when updating records from your application or is this only happening on the AppSync console?
Well, I was able to reproduce this pretty quickly and consistently. Will look into this further and bring it to the team's attention. Thank you!
Spoke to a member of the AppSync team today about this issue and, as it turns out, because your API has DataStore enabled and Auto Merge as the Conflict Handler, you simply need to include the _version
of the record you're trying to update. If you take a look at the graphql queries DataStore makes in the browser, you can see it included in the variables.
False alarm! 😅 haha
In the AppSync console
I see, thank you for your help, just wondering if its possible to remove data store then as this is more problematic? I tried using the amplify cli to update api -> graphQL -> remove data store from api. However then the queries dont work at all? Is there anyway to reverse the use of data store back to how it was? I just enabled data store i didn’t actively start using it so sort of no point having it. Thanks again for the support
Hey @asatvilker. DataStore would automatically include the version of the record being updated when it triggers the GraphQL mutations from your application. What behavior are you seeing when attempting to perform queries through the AppSync console now that DataStore is disabled? I just tried disabling DataStore for my app through the CLI (be sure to run amplify push
after doing so), and it seems to have just removed the _version
, _lastChangedAt
, etc fields but I am still able to query the data.
Looking over your environment information it seems you're behind on amplify updates. Is there a reason you haven't upgraded aws-amplify
to v4 and/or the CLI to v5? I believe there used to be issues on older versions where the API data had to be cleared after removing DataStore for it to work afterwards. I'll have to double check on that though. Might be worth trying in your dev environment to see if it gets your queries working again.
Hi @chrisbonifacio . I did the same to disable and also I did run amplify push. However when running an update mutation on appsync it would return an error. The error is essentially saying that it is looking for the _version but of course that has been removed.
I haven’t done any updates, haven’t used amplify in a while ahaha. Perhaps that is the reason!
@asatvilker We have these pages to help with upgrading the CLI and packages respectively.
https://docs.amplify.aws/cli/usage/upgrade
https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js
Let me know if updating helps! Otherwise, we can continue to work together towards getting you in a working state 😄
Hi 👋 Closing this as we have not heard back from you. If you are still experiencing this issue and in need of assistance, please feel free to comment and provide us with any information previously requested by our team members so we can re-open this issue and be better able to assist you. Thank you!
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help
channels or Discussions for those types of questions.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
Describe the bug
When running a graphQL update query, 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, they are still the same and the updatedAt timestamp has also not changed.
Expected behavior
The query should update the values specified
Reproduction steps
setup a graphQL api from the amplify cli in your project
then go to the AWS console -> appsync -> select your api -> queries
in the editor run a similar update query as shown below. As you can see it does not return an error but it is not updating the title, the result shows the title is still 'Python' not 'PythonUpdated'
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response