Skip to content
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

Pass error code in Websocket InitFunc #2881

Open
muku2211 opened this issue Jan 15, 2024 · 0 comments
Open

Pass error code in Websocket InitFunc #2881

muku2211 opened this issue Jan 15, 2024 · 0 comments

Comments

@muku2211
Copy link

What happened?

For websockets, authentication errors in InitFunc, closes the connection with a normal closure (status code: 1000).
However, as defined here, for the ConnectionInit message,

Closing the socket with a close event 4403: Forbidden indicating that the connection request has been denied because of access control. The server has returned false in the onConnect callback.
Closing the socket with a close event 4400: indicating that the connection request has been denied because of an implementation specific error. The server has thrown an error in the onConnect callback, the thrown error's message is the in the close event.

What did you expect?

The ability to specify the close code for connection init i.e either 4403 or 4400 depending on the use-case and the ability to send a custom message. Currently, the string "terminated" is hardcoded in the library.

Minimal graphql.schema and models to reproduce

NA

versions

  • go run github.com/99designs/gqlgen version? 0.17.5, though the code is the same in the latest version as well
  • go version? 1.20.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant