We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ws://localhost:3000/graphql
Let me know if you'd like to refine this further!
https://github.com/e-labInnovations/nest-ws-with-graphql-ws
Clone the repository:
git clone https://github.com/e-labInnovations/nest-ws-with-graphql-ws.git cd nest-ws-with-graphql-ws
Install dependencies:
npm ci
Start the server:
npm start
Open http://localhost:3000/graphql and test the following:
Query:
query { getEvents { id title description } }
Mutation:
mutation { createEvent(input: { title: "New Event", description: "This is a new event." }) { id title description } }
To test subscriptions:
subscription { eventCreated { id title description } }
graphql-ws
Now enable the WebSocket Gateway:
src/main.ts
src/events/events.module.ts
Test the WebSocket Gateway using a WebSocket client like WebSocket King :
ws://localhost:3000/
{"event":"message","data":"new text msg"}
Finally, recheck the GraphQL subscription. It will no longer work while queries and mutations continue functioning.
12.2.2
^12.2.2
^16.10.0
^3.0.0
^5.16.2
^10.4.15
10.4.15
22.12.0
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is there an existing issue for this?
Current behavior
GraphQL queries, mutations, and subscriptions work as expected using the Altair GraphQL extension.
ws://localhost:3000/graphql
) is unresponsive, even though other features function properly.Let me know if you'd like to refine this further!
Minimum reproduction code
https://github.com/e-labInnovations/nest-ws-with-graphql-ws
Steps to reproduce
Clone the repository:
git clone https://github.com/e-labInnovations/nest-ws-with-graphql-ws.git cd nest-ws-with-graphql-ws
Install dependencies:
Start the server:
Open http://localhost:3000/graphql and test the following:
Query:
Mutation:
To test subscriptions:
ws://localhost:3000/graphql
graphql-ws
)Now enable the WebSocket Gateway:
src/main.ts
andsrc/events/events.module.ts
.Test the WebSocket Gateway using a WebSocket client like WebSocket King :
ws://localhost:3000/
Finally, recheck the GraphQL subscription. It will no longer work while queries and mutations continue functioning.
Expected behavior
Package version
12.2.2
Graphql version
^12.2.2
^16.10.0
^3.0.0
^5.16.2
NestJS Version
^10.4.15
^10.4.15
^12.2.2
NestJS version
10.4.15
Node.js version
22.12.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: