tailcallhq / tailcall

High Performance GraphQL Runtime
https://tailcall.run
Apache License 2.0
1.29k stars 253 forks source link

feat: add allowedHeaders setting in upstream when the api requires some headers for config generator. #2348

Closed laststylebender14 closed 1 month ago

laststylebender14 commented 3 months ago

Present Behaviour:

In order album(p1: String!): Album @http(path: "/v1/albums/{{.args.p1}}") this to work, we have to set the allowedHeaders setting with Authorization else it throws 401 error.

schema @server @upstream(baseURL: "https://api.spotify.com") {
  query: Query
}

type Query {
  album(p1: String!): Album @http(path: "/v1/albums/{{.args.p1}}")
}

Expected

upstream should've the allowedHeaders setting, which should contain the headers which are required to resolve the http call i.e in following case it's Authorization.

schema @server @upstream(baseURL: "https://api.spotify.com", allowedHeaders: ["Authorization"]) {
  query: Query
}

type Query {
  album(p1: String!): Album @http(path: "/v1/albums/{{.args.p1}}")
}

technical requirements:

github-actions[bot] commented 2 months ago

Action required: Issue inactive for 30 days. Status update or closure in 7 days.

github-actions[bot] commented 2 months ago

Issue closed after 7 days of inactivity.