hasura / hasura/graphql-engine

$response.status NOT AVAILABLE in response_template

Open
#9,792 3 comments 0 reactions 0 assignees View on GitHub
k/bug t/gql-services
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version: v2.25.0-ce
CLI Version (for CLI related issue): 2.29.1 (latest)

### Environment

docker image hasura/graphql-engine:v2.25.0-ce

### What is the current behaviour?

Error message in hasura log when you place {{$response.status}} in response_template

### What is the expected behaviour?

expect it to return a code e.g. 200, 400, 401

### How to reproduce the issue?

Excerpt of code from actions.yaml

response_transform:
body:
action: transform
template: |-
{
"result": "{{response.status}}"
}
template_engine: Kriti
version: 2

### Please provide any traces or logs that could help here.

"error":"Response Transformation Failed","internal":[{"error_code":"Name Error","message":"Variable 'response' not in scope","source_position":{"end_column":24,"end_line":1,"start_column":16,"start_line":1}}]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.