graphql-mesh: @graphql-mesh/graphql does not pass through auth-headers.
When trying to pass through auth tokens through header context it does not .meshrc.yaml
sources:
- name: GraphQLEndpoint
handler:
graphql:
endpoint: http://localhost:8911/graphql
operationHeaders:
Authorization: "{context.headers.authorization}"
"auth-provider": "{context.headers['auth-provider']}"
package.json
{
"name": "graphql-mesh",
"version": "1.0.0",
"main": "index.js",
"author": "Christopher Burns",
"license": "MIT",
"scripts": {
"start": "mesh serve"
},
"dependencies": {
"@graphql-mesh/cli": "^0.16.3",
"@graphql-mesh/graphql": "^0.13.4",
"@graphql-mesh/openapi": "^0.12.2",
"@graphql-mesh/transform-prefix": "^0.6.17",
"graphql": "^15.4.0"
}
}
when console.log is called here
executor: async (params) => {
const { executor } = await getExecutorAndSubscriberForParams(params, operationHeadersFactory, endpointFactory);
console.log(params)
return executor(params);
},
it shows the auth token being passed in as rawHeaders
array and [Symbol(kHeaders)]: {}
but it seems like its not being pass through into the apollo client. empty headers.
Thank you 😃
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 2
- Comments: 18 (5 by maintainers)
Fixed in
@graphql-mesh/graphql@0.13.6
!Turns out I was looking for
schemaHeaders
. All good. Thanks!@Burnsy Thank you! I’ll write back soon!
@Burnsy If you share a reproduction in a repo or somewhere else, I could help you better.
Hello @ardatan
It looks like its still happening
Package.json