Recall & Review
beginner
What is WebSocket transport in GraphQL?
WebSocket transport is a way to keep a live connection open between client and server, allowing real-time data exchange for GraphQL subscriptions.
Click to reveal answer
beginner
Why use WebSocket transport instead of HTTP for GraphQL subscriptions?
WebSocket keeps the connection open, so the server can send updates instantly without the client asking repeatedly, unlike HTTP which opens a new connection for each request.
Click to reveal answer
intermediate
How does a GraphQL subscription work over WebSocket transport?
The client sends a subscription request over WebSocket. The server listens and sends data updates back through the same connection whenever data changes.
Click to reveal answer
intermediate
Name one common protocol used for GraphQL subscriptions over WebSocket.
The 'graphql-ws' protocol is commonly used to handle GraphQL subscriptions over WebSocket connections.
Click to reveal answer
intermediate
What happens if the WebSocket connection drops during a GraphQL subscription?
The client usually tries to reconnect automatically to keep receiving updates without losing data.
Click to reveal answer
What is the main benefit of using WebSocket transport for GraphQL subscriptions?
✗ Incorrect
WebSocket transport keeps the connection open, allowing the server to push real-time updates without the client needing to ask repeatedly.
Which GraphQL operation commonly uses WebSocket transport?
✗ Incorrect
Subscriptions use WebSocket transport to receive live updates from the server.
What does the client send first to start a GraphQL subscription over WebSocket?
✗ Incorrect
The client sends a subscription request to start receiving live data updates.
If the WebSocket connection drops, what usually happens?
✗ Incorrect
Clients often try to reconnect automatically to keep the subscription active.
Which protocol is commonly used for GraphQL subscriptions over WebSocket?
✗ Incorrect
The 'graphql-ws' protocol is designed for GraphQL subscriptions over WebSocket.
Explain how WebSocket transport enables real-time updates in GraphQL subscriptions.
Think about how the connection stays open and data flows both ways.
You got /4 concepts.
Describe what happens when a WebSocket connection drops during a GraphQL subscription and how it is handled.
Consider how the client keeps the subscription alive despite connection issues.
You got /4 concepts.