Closed PeteDuncanson closed 2 years ago
Hi @PeteDuncanson sorry for the delay. Could you specify which SDK you're using?
https://github.com/awslabs/aws-mobile-appsync-sdk-js
OR
https://github.com/aws/aws-sdk-js-v3
Is there a reason why you're using an AppSync client directly rather than the Amplify?
It seems like you're trying to update the LocationInputType while performing an updateAddress
mutation? Couldn't you do that in the schema itself first?
Lastly, could you provide an updated link to the docs? It seems the one mentioned in the issue description links to a page mentioning DataStore and and not the AppSync SDK buildMutation
helper function.
@chrisbonifacio wow this is an old one!
I've a feeling that the doc page is correct its just been edited to remove reference to the buildMutation stuff, anyway you can find the repos and check? I had a look for it but could only find this (https://github.com/aws-amplify/docs) which doesn't appear to be that doc site.
In honestly I think this is a problem with some really old code that you folks don't recommend or support anyway, you push everyone to DataStore (which also has its problems) for anything Offline so I'm assuming that using the buildMutation helpers is no longer the recommended or supported route.
Additionally we transitioned away from DataStore to Amplify's GraphQL queries as you suggested due to us being stuck with issues like above. As a work around for anyone coming behind me we chose to flatten our types when we hit this, so instead of having a Location type we just added a geoCodeLat and geoCodeLong field to the types that used to nest these. Not pretty but it worked around the issue.
I'd hazard to guess that this one can be closed and forgotten to the bowels of time. No longer an issue for us, we worked around it or away from it.
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
Describe the bug
Using AppSync SDK (Offline setup but
disableOffline: true
in the config for now) I'm trying to update a GraphQL type within one of my models and I can't for the life of me get it to.When I try up update I get this error thrown:
Given a schema like this:
I'm running a mutation like so using the
buildMutation
helpers (https://docs.amplify.aws/lib/graphqlapi/offline/q/platform/js/#with-helper):Its an odd error message as it calms it already has data stored but if I run the page in Incognito then it still throws it even though that shouldn't have it stored? Could be wrong there though.
Expected behavior
The update goes through and no error thrown.
With some messing around I have had it save but its blowing up my app, a refresh though will show the new data in my app. Maybe I can just "handle it" by catching the error but its causing me headaches.
Reproduction steps
See description of the issue.
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