graphql-mesh
graphql-mesh copied to clipboard
Error: No `subscribe` function found! Register it using "useEngine" plugin.
``Hello!
I have a server with graphql-mesh. Querys and mutations works well, but when I try to call a subscription, the server of graphql-mesh does not work and return me this error:
Internal error occurred during message handling. Please check your implementation. Error: No `subscribe` function found! Register it using "useEngine" plugin.
at throwEngineFunctionError (C:\Users\jhoma\www\kawchi\kawchi-mesh-service\node_modules\.pnpm\@[email protected]\node_modules\@envelop\core\cjs\orchestrator.js:7:11)
at subscribe (C:\Users\jhoma\www\kawchi\kawchi-mesh-service\node_modules\.pnpm\@[email protected]\node_modules\@envelop\core\cjs\orchestrator.js:15:29)
at C:\Users\jhoma\www\kawchi\kawchi-mesh-service\node_modules\.pnpm\@[email protected]\node_modules\@envelop\core\cjs\orchestrator.js:287:32
at async Object.onMessage [as handleMessage] (C:\Users\jhoma\www\kawchi\kawchi-mesh-service\node_modules\.pnpm\[email protected][email protected]\node_modules\graphql-ws\lib\server.js:199:51)
at async message (C:\Users\jhoma\www\kawchi\kawchi-mesh-service\node_modules\.pnpm\[email protected][email protected]\node_modules\graphql-ws\lib\use\uWebSockets.js:116:17)
I could see that, when I try to subscribe to the server of graphql-mesh, it dindn't send the "request" to my source server.
I'm using this versions of packages: "@graphql-mesh/cli": "0.90.5", "@graphql-mesh/graphql": "0.98.4", "@graphql-mesh/runtime": "0.99.5", "@graphql-mesh/store": "0.98.4", "@graphql-mesh/utils": "0.98.4", "@graphql-tools/utils": "10.2.0", "graphql": "16.8.1"
and this is a part of my meshrc.yaml file:
serve:
hostname: 0.0.0.0
port: 5000
playground: true
browser: false
sources:
- name: chats-service
handler:
graphql:
endpoint: ${CHATS_ENDPOINT}
subscriptionsEndpoint: ${CHATS_SUBSCRIPTIONS_ENDPOINT}
subscriptionsProtocol: WS
operationHeaders:
Authorization: "{context.headers['authorization']}"
Language: "{context.headers['language']}"
"connectionstatus": "{context.headers['connectionstatus']}"
"connectionid": "{context.headers['connectionid']}"
connectionParams:
Authorization: "{context.connectionParams['authorization']}"
Language: "{context.connectionParams['language']}"
"connectionstatus": "{context.connectionParams['connectionstatus']}"
"connectionid": "{context.connectionParams['connectionid']}"
multipart: true