I have generated a simple GraphQL API on AWS AppSync (using CLI) from this model:
type WalletProperty @model {
id: ID!
title: String!
}
This generated a CreateWalletProperty, UpdateWalletProperty and DeleteWalletProperty mutations all similar to this:
mutation CreateWalletProperty(
$input: CreateWalletPropertyInput!
$condition: ModelWalletPropertyConditionInput <<<<<<<<<<<< what is this for?
) {
createWalletProperty(input: $input, condition: $condition) {
id
title
createdAt
updatedAt
}
}
and the schema for the condition being:
input ModelWalletPropertyConditionInput {
title: ModelStringInput
and: [ModelWalletPropertyConditionInput]
or: [ModelWalletPropertyConditionInput]
not: ModelWalletPropertyConditionInput
}
Given that I always have to supply the mandatory $input, what is the $condition parameter for?
!
then not mandatory/not required ... optional parameter to filter affected rows/items – Flesher