Prerequisites
Describe the bug
I tried to follow docs example referencing " {{.headers.x-user-id}} "" and found it never get evaluated successfully.
When hyphen is involved in the header key, it just doesn't evaluate.
When is a a-z header key, it evaluates to empty.
Note: I already added allowedHeaders in @upstream directive.
Steps to reproduce
tailcall init hello && cd hello
- Replace the main.graphql content as below
schema @server @upstream(allowedHeaders: ["aaa", "x-user-id"]) {
query: Query
}
type Query {
greet: String! @expr(body: "Hello, World!")
debugHeader(name: String!): String @expr(body: "{{.headers.{{.args.name}}}}")
aaa: String @expr(body: "{{.headers.aaa}}")
xUserId: String @expr(body: "{{.headers.x-user-id}}")
}
Then tailall start ./main.json
- Now try to make a graphQL request as below
HTTP headers:
{
"aaa": "my-aaa-value",
"x-user-id": "my-user-id"
}
Query
{
greet
debugHeader(name: "aaa")
aaa
xUserId
}
Expected behavior
{
"data": {
"greet": "Hello, World!",
"debugHeader": "my-aaa-value",
"aaa": "my-aaa-value",
"xUserId": "my-user-id"
}
}
Actual behavior
Received response:
{
"data": {
"greet": "Hello, World!",
"debugHeader": "{{.headers.{{.args.name}}}}",
"aaa": "",
"xUserId": "{{.headers.x-user-id}}"
}
}
Screenshots
N/A
Environment information:
- Operating System: (MacOS 15.4.1 (24E263))
- Tailcall Version: (v1.6.8)
- GraphQL Client/version : I tried both the playgound and Postman, same result.
Prerequisites
Describe the bug
I tried to follow docs example referencing " {{.headers.x-user-id}} "" and found it never get evaluated successfully.
When hyphen is involved in the header key, it just doesn't evaluate.
When is a a-z header key, it evaluates to empty.
Note: I already added allowedHeaders in @upstream directive.
Steps to reproduce
tailcall init hello && cd helloThen
tailall start ./main.jsonHTTP headers:
{
"aaa": "my-aaa-value",
"x-user-id": "my-user-id"
}
Query
Expected behavior
Actual behavior
Received response:
{ "data": { "greet": "Hello, World!", "debugHeader": "{{.headers.{{.args.name}}}}", "aaa": "", "xUserId": "{{.headers.x-user-id}}" } }Screenshots
N/A
Environment information: