Replies: 1 comment 1 reply
-
'api-key': "Bearer {context.headers['x-my-api-token']}" |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys,
First of all thanks for this awesome project. I really love it. ❤️ ❤️ ❤️
I personally prefer to use
.meshrc.ts
rather than.meshrc.yaml
because I really like to use the typescript and IDE auto-completion feature when working on a mesh config file. But I have some difficulty as all of the examples and CodeSandbox and ... is based on.meshrc.yaml
file.So as a suggestion: I suggest adding more examples and docs regarding using javascript and typescript for GraphQL Mesh.
And now let's back to my question:
I wanna pass an
api-key
from my supergraph header request (mesh project) to one of my subgraphs (a graphql handler) I tried to pass it like this:But it seems this one is wrong because I have some error in my config file now. How can I access the
context
value here??For the
.meshrc.yaml
file there are an example in the docs and the way it's working is like this:But it seems this format is not working for
.meshrc.ts
config file. I also triedcontext.headers['api-key']
andthis..context.headers['api-key']
but these are not working. Any idea for this?Beta Was this translation helpful? Give feedback.
All reactions