我从这个模型在 AWS AppSync(使用 CLI)上生成了一个简单的 GraphQL API:
type WalletProperty @model {
id: ID!
title: String!
}
这会生成一个 CreateWalletProperty、UpdateWalletProperty 和 DeleteWalletProperty 突变,都与此类似:
mutation CreateWalletProperty(
$input: CreateWalletPropertyInput!
$condition: ModelWalletPropertyConditionInput <<<<<<<<<<<< what is this for?
) {
createWalletProperty(input: $input, condition: $condition) {
id
title
createdAt
updatedAt
}
}
条件的架构是:
input ModelWalletPropertyConditionInput {
title: ModelStringInput
and: [ModelWalletPropertyConditionInput]
or: [ModelWalletPropertyConditionInput]
not: ModelWalletPropertyConditionInput
}
鉴于我总是必须提供强制性的 $input,$condition 参数的用途是什么?