Closed amlcodes closed 5 years ago
It throws only if the values that you are trying to put are different. For example, if I have a field Mutation.createBlog
with this template:
{
"version": "2017-02-28",
"operation": "PutItem",
"key": {
"id": $util.dynamodb.toDynamoDBJson($util.defaultIfNullOrBlank($ctx.args.input.id, $util.autoId()))
},
"attributeValues": $util.dynamodb.toMapValuesJson($context.args.input),
"condition": {
"expression": "attribute_not_exists(#id)",
"expressionNames": {
"#id": "id"
}
}
}
and I run
mutation {
createBlog(input:{
id:2,
name:"hi"
}) {
id
name
}
}
followed by
# This does not fail and returns { id: 2, name: "a blog" }
mutation {
createBlog(input:{
id:2,
name:"a blog"
}) {
id
name
}
}
however if I run
# This does fail
mutation {
createBlog(input:{
id:2,
name:"another blog"
}) {
id
name
}
}
If you are seeing something different please let me know.
@amlcodes Are you still blocked on this? Feel free to re-open if this is still an issue.
@mikeparisstuff I still don't get why name:"a blog" doesn't fail but name:"another blog" fails. They are both different values from the first the one name:"hi"
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.
appsync request resolver is not working as I think it is intended. I cannot find any documentation at all about attribute_not_exists or much about conditions in resolvers. my current resolver should only succeed if both keys, id and netlifyid are unique.
I end up succeeding anyways currently. condition expression is not being resolved correctly