Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubles with connectionParams on subscriptions #5782

Open
Jhomalex opened this issue Dec 17, 2023 · 0 comments
Open

Troubles with connectionParams on subscriptions #5782

Jhomalex opened this issue Dec 17, 2023 · 0 comments

Comments

@Jhomalex
Copy link

Jhomalex commented Dec 17, 2023

Hello I'm having troubles with connectionParams.

I have a server with support to queries, mutations and subscriptions. It works fine, but when I tried to use with graphql-mesh, it send to my server bad connectionParams. Most exactly I'm receiving this string on Authorization connectionParam: "{context.headers['authorization']}" (the graphql-mesh don't recognize the variables and send me the string of the yaml file)

My setup of .yaml file is more or less like that:

...
handler:
      graphql:
          endpoint: ${CHATS_ENDPOINT}
          subscriptionsEndpoint: ${CHATS_SUBSCRIPTIONS_ENDPOINT}
          subscriptionsProtocol: WS
          operationHeaders:
                    Authorization: "{context.headers['authorization']}"
          connectionParams:
                    Authorization: "{context.headers['authorization']}"
      multipart: true
...

I tried too use "{context.connectionParams['authorization']}" instead.

I'm using these dependencies on the server with graphql-mesh (all is updated to the newest version):

{
    "@graphql-mesh/cli": "0.88.4",
    "@graphql-mesh/graphql": "0.96.2",
    "@graphql-mesh/runtime": "0.97.3",
    "@graphql-mesh/store": "0.96.2",
    "@graphql-mesh/utils": "0.96.2",
    "graphql": "15.8.0"
  }

I have tested that on Windows 11 with node.js 18.15.0 and on Debian with node.js 18.15.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant