I'm having trouble with update mutations with react-native and amplify.
addProfileDetails = async (sub) => {
let UserDetails = await API.graphql(graphqlOperation(mutations.updatePeople, {updatePeopleInput:
{
UserID: sub,
Organization: "Organization"
Name: "name"
}
}));
console.log(UserDetails);
};
This code doesn't generate any errors, and it's pretty much the same as the code I used to create the record in the first place which works.
but it returns this data and doesn't actually update the record as intended.
Object {
"data": Object {
"updatePeople": null,
},
}
I tested this query on the appsync query editor:
mutation update {
updatePeople (updatePeopleInput: {
PersonID: "XXXXXXXXXXXXXXXXXXXXXXXXXX",
Gender: "Male"
})
{
PersonID
Gender
}
}
And it returns the same. Create mutations work, Queries work. I don't understand what is happening here.
Any insights of what I'm doing wrong would be helpful. Also, if you need to the schema or the mutation code, I can provide that.