Recall & Review
beginner
What is a Subscription in NestJS GraphQL?
A Subscription in NestJS GraphQL is a way to send real-time updates from the server to the client. It uses WebSockets to push data whenever an event happens, like new messages or notifications.
Click to reveal answer
beginner
Which decorator is used to define a Subscription resolver method in NestJS?
The @Subscription() decorator is used to mark a method as a Subscription resolver in NestJS GraphQL.
Click to reveal answer
intermediate
How does NestJS handle the event stream for Subscriptions?
NestJS uses an event-based system, often with PubSub (Publish-Subscribe) pattern, to emit events that trigger Subscription updates to clients.
Click to reveal answer
beginner
What transport protocol do GraphQL Subscriptions typically use in NestJS?
GraphQL Subscriptions in NestJS typically use WebSockets to maintain a persistent connection for real-time data transfer.
Click to reveal answer
beginner
Why are Subscriptions useful in web applications?
Subscriptions let the server send updates instantly to clients without the client asking repeatedly. This is great for chat apps, live feeds, or notifications.Click to reveal answer
Which decorator do you use to create a Subscription resolver in NestJS?
✗ Incorrect
The @Subscription() decorator marks a method as a Subscription resolver.
What protocol do NestJS GraphQL Subscriptions use to send real-time data?
✗ Incorrect
WebSockets provide a persistent connection for real-time data in Subscriptions.
What pattern is commonly used in NestJS to manage events for Subscriptions?
✗ Incorrect
PubSub pattern helps emit and listen to events for Subscriptions.
Which of these is NOT a typical use case for Subscriptions?
✗ Incorrect
Static page rendering does not require real-time updates.
In NestJS, what do you need to import to use Subscriptions with GraphQL?
✗ Incorrect
GraphQLModule must be configured to enable subscriptions.
Explain how Subscriptions work in NestJS GraphQL and why they are useful.
Think about how the server sends data without the client asking repeatedly.
You got /4 concepts.
Describe the steps to create a Subscription resolver in NestJS.
Focus on decorators, event publishing, and module setup.
You got /4 concepts.