You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, updateReview wouldn't allow user to specify the owner field, which is fine, but, because the owner is the partition key of the Review table, DynamoDB requires the the owner field to update the item. So to make this work, we have to generate the value of 'owner'.
sure I can use @auto(updatable: true), so I can manually input the owner field, but it really should be generated automatically in this case.
I saw you have already auto generated the createdAt field, why not for the owner as well?
so the logic would be
set ownerField default value to "owner".
check if @auth directive contains ownerField argument, if it is, set ownerField to that value.
check if fields argument of @key contains the value of ownerField.
if step 3 is true, set $context.args.input.${ownerField} to the incoming request's identity.
The text was updated successfully, but these errors were encountered:
Hi, I'm really appreciate your work on this, without this plugin, I would have had to quit using Amplify...!!
I found an issue with a usecase that the primary key contain
owner
field.For instance:
Now,
updateReview
wouldn't allow user to specify theowner
field, which is fine, but, because theowner
is the partition key of theReview
table, DynamoDB requires the theowner
field to update the item. So to make this work, we have to generate the value of 'owner'.sure I can use
@auto(updatable: true)
, so I can manually input the owner field, but it really should be generated automatically in this case.I saw you have already auto generated the
createdAt
field, why not for theowner
as well?so the logic would be
ownerField
default value to"owner"
.@auth
directive containsownerField
argument, if it is, setownerField
to that value.fields
argument of@key
contains the value ofownerField
.$context.args.input.${ownerField}
to the incoming request's identity.The text was updated successfully, but these errors were encountered: