Is there a way I can remove the action name from my actions response in Hasura?

Is there a way I can remove the action name from my actions response in Hasura?


0

I attempted to use response transformation in Hasura to extract the response_body from an action response. However, the action response is structured as follows

1. 
{
  "action_name": {
      response_body
  }
}

My desired outcome is to obtain the response_body without the action_name key, like this:

2. 
{
  response_body
}

Using response transform {{$body}} you get the 1.
When I attempt to access {{$body.action_name}} in the response transformation, it results in an error, as described below:

{
    "code": "unexpected",
    "error": "Response Transformation Failed",
    "internal": [
        {
            "error_code": "Attribute Error",
            "message": "'Object' has no attritubte 'action_name'.",
            "source_position": {
                "end_column": 17,
                "end_line": 0,
                "start_column": 1,
                "start_line": 0
            }
        }
    ],
    "path": "$"
}

New contributor

Punit Sureka is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


Load 6 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *