Closed andreialecu closed 4 years ago
Upon further investigation, it seems even after removing all @auth
directives from the model the error persists.
I think amplify push
is not updating cloud AWS resources properly even though it detects changes and succeeds in pushing:
UPDATE_COMPLETE apix AWS::CloudFormation::Stack Thu Apr 16 2020 18:56:36 GMT+0300 (Eastern European Summer Time)
⠇ Updating resources in the cloud. This may take a few minutes...
UPDATE_COMPLETE x-dev-y AWS::CloudFormation::Stack Thu Apr 16 2020 18:56:41 GMT+0300 (Eastern European Summer Time)
UPDATE_COMPLETE authxff7aed9e AWS::CloudFormation::Stack Thu Apr 16 2020 18:56:40 GMT+0300 (Eastern European Summer Time)
✔ Generated GraphQL operations successfully and saved at ../../../../s/Projects/x/src/graphql
✔ Code generated successfully and saved in file ../../../../s/Projects/x/src/API.ts
✔ All resources are updated in the cloud
GraphQL endpoint: https://xyz.appsync-api.eu-west-1.amazonaws.com/graphql
Update:
It looks like the Resolver for Mutation.deleteFriend
as per the AppSync console does not match the contents of amplify/backend/api/xyz/build/resolvers/Mutation.deleteFriend.req.vtl
and is never being updated even though modifying the schema and pushing it results in a bunch of cloudformation updates being completed properly.
The contents of the resolver on AppSync is the same as the initial one where the default owner
field was being used.
So the files in amplify/backend/api/xyz/build/resolvers/
are being updated, but they are not updating in AppSync even though amplify push
is completing successfully.
Looks like this was again related to the path saved in amplify/.config/local-env-info.json/projectPath
after creating a copy of the project.
The project was copied to a new directory but the path in the configuration json remained the old one.
Please do something to validate whether the path is correct at least for the current project when the amplify
cli is called, if it cannot be automatically determined for some reason.
This makes it a duplicate of https://github.com/aws-amplify/amplify-cli/issues/3901
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 for those types of questions.
Which Category is your question related to?
auth
Amplify CLI Version
You can use
amplify -v
to check the amplify cli version on your system4.18.0
What AWS Services are you utilizing?
appsync + cognito
Provide additional details e.g. code snippets
We're running into an issue with allowing two separate users access over a single model. This is the schema:
The main owner (
userId == cognito.username
) can modify the record, butfriendId
cannot.I have even tried it on the appsync console:
The error is as follows:
Here's a screenshot that confirms on the appsync console that the current logged in user is the same user as what
friendId
is assigned to.What could be wrong?
An additional question: Why is the
owner
field still being populated in dynamodb? The initial model didn't specify anownerField
, but it seems new records still get assigned theowner
field. Shouldn't it just populate and useuserId
instead?