hasura / hasura/graphql-engine
Actions "Headers" section error with {{ $body.input?.xxx }}
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: 2.38.1
CLI Version (for CLI related issue):
### Environment
OSS
### What is the current behaviour?
I'm experiencing an error when using {{ $body.input?.xxx }} in the "Headers" section of Hasura Actions.
### What is the expected behaviour?
{{ $body.input?.xxx }} should be evaluated and the result should be included in the request headers.
### How to reproduce the issue?
1. Goto Actions
2. New Action Or Modify
3. Try to use {{ $body.input?.xxx }} in the "Headers" section.
4. Goto API
5. Call API
### Screenshots or Screencast


### Please provide any traces or logs that could help here.
### Any possible solutions/workarounds you're aware of?
I was able to work around this issue by adding request_transform.request_headers.add_headers to the metadata.
setting showRequestHeaders to true in the frontend source code.
[Link](https://github.com/hasura/graphql-engine/blob/release/v2.38/frontend/libs/console/legacy-ce/src/lib/components/Common/ConfigureTransformation/RequestOptionsTransforms.tsx#L35)
### Keywords
1. OpenAPI
2. Headers
3. add_headers
6. showRequestHeaders
Contributor guide
Research direction
Start by reading frontend/libs/console/legacy-ce/src/lib/components/Common/ConfigureTransformation/RequestOptionsTransforms.tsx around showRequestHeaders and reproduce the issue through a Hasura Action with {{ $body.input?.xxx }} in Headers. Compare the generated request with the request_transform.request_headers.add_headers workaround; done means the expression is evaluated and its result is included in the request headers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100