Describe the bug
I get this kind of response resolvers for some mutations when I execute amplify push:

Mutation successfully updates table. But nested objects which I request in mutation have NULL value.
When I replace response resolver with simple:
$util.toJson($context.result)
the problem dissapears
Also I noticed that when I execute mutation with such resolver, in a CloudWatch I see 2 simultaneous mutations was performed. First one has correct response template mapping, second one with empty result {}.
@lenarmazitov The duplication of this set has been fixed in the latest release.
Are you using per-field @auth? If you are this is to protect the subscription which you can read more about here:
https://aws-amplify.github.io/docs/cli-toolchain/graphql#authorizing-subscriptions
@SwaySway
Sorry for closing issue, but bug still exists.
Description
If in response file Mutation.updateUser.res.vtl: we do not have string:
#set( $context.result.operation = "Mutation" )

All works fine.
But if we have
#set( $context.result.operation = "Mutation" )
Then response will be:

In schema I'm using per field @auth directive for field avatar here.
@lenarmazitov That is to protect fields in the subscription as specified in the docs.
If you would like the response in the mutation you can can either subscriptions to either off or public.
type User
@model (subscriptions: { level: public }) # or off
@auth(rules: []) {
# user fields
}
@SwaySway thank you, I just have found it in documentation, sorry for disturbing.
https://aws-amplify.github.io/docs/cli-toolchain/graphql#per-field-with-subscriptions