enisdenjo / graphql-mesh-apollo-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

connectionParams for Subscriptions are not resolved

Reproduction for the follwing issue in graphql-mesh: ardatan/graphql-mesh#5774

Reproduction Steps

  1. yarn install

  2. yarn build

  3. yarn start

The Apollo Server is available on port 3500, the GraphQL Mesh on port 4000 and the react app on port 5000.

⚠️ Yoga GraphiQL doesn't work with subscription. It throws Must provide query string. Any other graphql client like Banana Cake Pop oder Apollo Studio works fine.

  1. Once the GraphQL Mesh and Apollo Server are started, the React App must be started in a new terminal.

`yarn start:react'

  1. Add the following Header to your Requests
{
  "Authorization": "TOKEN",
  "Tenant":"TENANT"
}

After execeute the queries/mutation or subscription, you can find a console.log output with the available headers (header values).

  1. Execute Query
query {
    books {
        id
        title
        author
    }
}
  1. Execute Subscription
subscription {
  commentAdded {
    id
    content
  }
}

You will see that here the correct header values are not passed like e.g. with query or mutation.

  1. The react app subscribes directly to the GraphQL mesh via websocket at startup. The subscription goes through to the Apollo server, but the connection parameters passed by the client do not follow. GraphQL Mesh does not resolve them correctly

About


Languages

Language:TypeScript 90.2%Language:CSS 6.8%Language:JavaScript 1.6%Language:HTML 1.4%