This is with regard to the Warp terminal app. It runs on Mac and has just been released for Windows.
I was having a lot of questions wrt updating graphql-ws from v5 to v6. The docs say the new import statement should be:
import { useServer } from 'graphql-ws/use/ws';
…but that was throwing:
“Cannot find module ‘graphql-ws/use/ws’”
Warp uses Claude AI, with the advantage that, since it’s the terminal app, in can inspect files and file paths if you give it permission.
I asked why I was getting that error on that import statement. Here’s what it came back with:
Would you like me to check your package.json and tsconfig.json configurations?
> yes
Let me check both your package.json and tsconfig.json to verify the module configuration settings.
I see the issue now. You’re using a Meteor project (based on the “meteor run” script and dependencies), and Meteor has its own module system and build configuration.
For Meteor projects using GraphQL WebSocket subscriptions, you should use a different import path. Try this instead:
import { useServer } from ‘graphql-ws/dist/use/ws’;
This should work because:
Meteor doesn’t use Node.js’s native ES modules system by default
The’graphql-ws package’s dist directory contains the compiled JavaScrint that’s more compatible with Meteor’s module system
I followed that GitHub link, but I could be wrong. graphql-sse and graphql-ws are two packages, they use different protocols web socket and Server-Sent Events. I wonder what’s the different in area of performance. graphql-sse might require less CPU/Ram compare to graphql-ws.
Edit: There is a performance test here: https://www.timeplus.com/post/websocket-vs-sse. They are very close. So I guess we’ll choose the one which is easier to set up.