Closed gmineropfdrive closed 2 years ago
I see a typo that may lead to this issue. In the provided code snippet, under the else block, you have used organiztionId
(missing "a"). Could you try fixing this and see if the issue persists?
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!
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
DataStore
Amplify Categories
storage, api
Environment information
Describe the bug
we are using Datastore to save a custom graphql model as documented, and everything works fine on the first iteration or attempt of doing so, however, when we attempt to save/update new rows, we get an error stating that a field is missing, however, this is not the case.
Expected behavior
Datastore.Save should create a new instance of the model and save a new row, as documented.
Reproduction steps
create a schema which has the following:
(we have a list of users, which are linked to an organization Id returned from an API)
using Datastore, we try to save multiple users belonging to an org as follows:
All users save fine the first time that we (for example, select what users to save through an interface), however, if we re-open the interface and add new users, we get the error
datastore.ts:273 Uncaught (in promise) Error: Field organizationId is required, however, after debugging, we validate the the organizationId IS there.
additionally, for some strange reason, if I change the instance of the user model when saving as follows:
it will save on the device locally, but the organizationID will be null....
fyi: the schema is set to public for testing purposes.
Code Snippet
Log output
aws-exports.js
Manual configuration
No response
Additional configuration
No response
Mobile Device
not applicable
Mobile Operating System
not applicable
Mobile Browser
Brave
Mobile Browser Version
Version 1.39.111 Chromium: 102.0.5005.61 (Official Build) (32-bit)
Additional information and screenshots
No response