-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Feat: Support Graphql subscription via websocket[INS-4390] #7990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
70cb07c to
bde59c0
Compare
72ae829 to
742ecec
Compare
jackkav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious the see how persistent the connection is. What if you navigate to another workspace and back? Or open a second instance of insomnia.
| const { url, method } = activeRequest; | ||
| const isEventStreamOpen = useReadyState({ requestId: activeRequest._id, protocol: 'curl' }); | ||
| const isCancellable = currentInterval || currentTimeout || isEventStreamOpen; | ||
| const isGraphQLSubscriptionOpen = useReadyState({ requestId: activeRequest._id, protocol: 'webSocket' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit tempted to try to merge the action-bar.tsx into this one as its mostly copypasta and this is the only important line in that component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, so both normal request and websocket request could use request-url-bar.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can scope it out of this PR though.
jackkav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really elegant implementation
It's a reuse of the current websocket connection logic so it will have the same behavior. Current when nav to another workspace and back, the connection will be closed |
packages/insomnia/package.json
Outdated
| "graphql-ws": "^5.16.0", | ||
| "graphql": "^16.8.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running npm i -w insomnia -S graphql-ws will fix this ordering issue
0335289 to
5e194b2
Compare
notjaywu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Changes:
graphql-subscription.mp4
Closes #6055