@graphql-mesh/[email protected]
Minor Changes
-
#8189
83a73ab
Thanks @jjangga0214! -
#3590 Do not throw when `request` is not
available in the context, it can be a WebSockets connection- Export helper
extractFromConnectionParams
to get the token from WebSocketconnectionParams
when GraphQL WS is used like
here
import { defineConfig, extractFromConnectionParams, extractFromHeader, useJWT } from '@graphql-hive/gateway' export const gatewayConfig = defineConfig({ jwt: { // So it will look for the token in the connectionParams.my-token field in case of a WebSockets connection // It will check WS params and headers, and get the available one lookupLocations: [ extractFromConnectionParams({ name: 'my-token' }), extractFromHeader({ name: 'authorization', prefix: 'Bearer ' }) ] } })
- Export helper