Skip to content

Frequent socket closes (with code 1001) #116

Answered by enisdenjo
morajabi asked this question in Q&A
Discussion options

You must be logged in to vote

Hey hey, the close event is triggered by the server. Client is just communicating it. Our server implementation closes with 1001 when the server is going away (or shutting down as the close reason suggests).

graphql-ws/src/use/ws.ts

Lines 126 to 128 in 88a12ef

for (const client of ws.clients) {
client.close(1001, 'Going away');
}

Looking at the close reason from the provided dev-tools screenshot, the server is closing the client with a "shutting down" reason. This tells me that you're not using the graphql-ws server implementation, but rather a different one. So, sadly, I cannot be of much help - you have to check your server implementation out.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@enisdenjo
Comment options

@morajabi
Comment options

@enisdenjo
Comment options

@morajabi
Comment options

@enisdenjo
Comment options

Answer selected by enisdenjo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants