突变后,我需要发送电子邮件。我的graphql模式使用@model指令保存到数据库,但是我想添加到数据库中,并在发生突变后发送电子邮件。有人可以推荐最好的方法吗?下面是我的graphql模式。
enum Service {
AIRPORT_PICKUP
AIRPORT_DROPOFF
GUIDED_TOUR
DRIVER
}
type Message
@model
@auth(
rules: [
{ allow: public, provider: iam, operations: [create] }
{ allow: groups, groups: ["admin"], operations: [update, delete, read] }
]
) {
id: ID!
firstName: String!
lastName: String!
email: AWSEmail!
phoneCountryCode: String
phoneNumber: String
message: String!
arrivalFlightNumber: String
arrivalDateTime: AWSDateTime
departurelFlightNumber: String
departureDateTime: AWSDateTime
travelers: Int
services: [Service]
owner: String
group: String
}