How does GraphQL handle real-time data and subscriptions?
- By periodically polling the server for updates
- By sending email notifications to clients
- By using RESTful APIs
- By using WebSockets to establish persistent connections
GraphQL handles real-time data and subscriptions by using WebSockets to establish persistent connections. This allows the server to push updates to clients as soon as new data is available, enabling real-time interaction without the need for frequent polling, which is both inefficient and less responsive in comparison.
Loading...
Related Quiz
- How does GraphQL handle real-time data and subscriptions?
- What is the purpose of debugging in API development?
- You are tasked with ensuring secure communication between microservices in a distributed system. How can JWT be used to ensure that the calls between microservices are authorized?
- In Node.js and Express, the ________ method is used to send a JSON response to the client.
- How can rate limiting be used in conjunction with API keys?