The graphql mutation below returns an Account
type on success:
@Mutation(() => Account)
async updateAccount(
@Arg('accountIdentifier', () => String) accountIdentifier: string,
@Arg('input', () => AccountUpdateInput) input: AccountUpdateInput
) {
await Account.update({ accountIdentifier }, input)
return Account.findOne({ accountIdentifier })
}
To execute this mutation one can use the following:
mutation {
updateAccount(
accountIdentifier: "06760b98-9a9b-4686-961c-051d6b01581f",
input: {
name: "mark"
}) {
accountIdentifier
email
}
}
However, using this same mutation without specifying a return value results in an error. I was wondering if it's possible to execute the above mutation or the below mutation (without return value specified) and at the same time have the mutation executed correctly?
mutation {
updateAccount(
accountIdentifier: "06760b98-9a9b-4686-961c-051d6b01581f",
input: {
name: "mark"
}
)
}