-
This is more of a question. I'm trying to use the library as a client in node / typescript. // https://github.com/enisdenjo/graphql-ws
import ws from 'ws';
import { createClient } from 'graphql-ws';
import { randomUUID } from 'crypto';
const client = createClient({
url: 'ws://10.36.83.233:5513/graphql',
webSocketImpl: ws,
generateID: () => randomUUID()
});
export const graphql_play = () => {
const sub = client.subscribe(
{
query: 'subscription { Resource { mutation instance { id }}}'
},
{
next: (data) => console.log('data"', data),
error: (error) => { console.log('error:', error) },
complete: () => console.log('finished')
}
)
} main from where it is called import { graphql_play} from './graphql-play'
function wait(): Promise<any> {
return new Promise( () => {});
}
async function run() {
console.log('run')
graphql_play();
await wait();
console.log('end')
}
run(); The returned error is
Same work if I use the deprecated |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
It is very likely that your server does not support Note that the deprecated |
Beta Was this translation helpful? Give feedback.
-
I appreciate you quick response, and I did miss the disclaimer part. Appreciate your help. |
Beta Was this translation helpful? Give feedback.
-
yeah, unfortunately I do not have control of that service. But I have requested for an update. Again, thank you for your help |
Beta Was this translation helpful? Give feedback.
I appreciate you quick response, and I did miss the disclaimer part.
I think you are right about incompatibility issue.
The service I'm trying to connect to is running
"apollo-server-express": "^2.14.0",
I will continue using the deprecated package until the serve is upgraded.
Appreciate your help.