From ac8711a0aa985913248a35721f38f7c3c385ae15 Mon Sep 17 00:00:00 2001 From: syedmouaazfarrukh Date: Thu, 19 Jan 2023 09:38:34 -0800 Subject: [PATCH] Adding content to 103-subscriptions --- .../103-subscriptions/100-what-are-subscriptions.md | 11 ++++++++++- .../101-event-based-subscriptions.md | 10 +++++++++- .../content/103-subscriptions/102-live-queries.md | 11 ++++++++++- .../103-subscriptions/103-defer-stream-directives.md | 11 ++++++++++- .../graphql/content/103-subscriptions/index.md | 11 ++++++++++- 5 files changed, 49 insertions(+), 5 deletions(-) diff --git a/src/roadmaps/graphql/content/103-subscriptions/100-what-are-subscriptions.md b/src/roadmaps/graphql/content/103-subscriptions/100-what-are-subscriptions.md index 842bb0275..63e3a76b0 100644 --- a/src/roadmaps/graphql/content/103-subscriptions/100-what-are-subscriptions.md +++ b/src/roadmaps/graphql/content/103-subscriptions/100-what-are-subscriptions.md @@ -1 +1,10 @@ -# What are subscriptions \ No newline at end of file +# What are Subscriptions + +In GraphQL, subscriptions are a way to push real-time updates to the client. They allow a client to subscribe to a specific event or data change on the server, and receive updates in real-time as soon as the event occurs or the data changes. + +Subscriptions are defined on the server and are structured similar to queries and mutations. They have a "subscription" field at the top level, followed by the fields that define the event or data change to be subscribed to. + +To learn more, visit the following links: + +- [How GraphQL Subscriptions Work](https://www.youtube.com/watch?v=_r2ooFgBdoc) +- [Realtime Updates with GraphQL Subscriptions](https://www.howtographql.com/vue-apollo/8-subscriptions/) \ No newline at end of file diff --git a/src/roadmaps/graphql/content/103-subscriptions/101-event-based-subscriptions.md b/src/roadmaps/graphql/content/103-subscriptions/101-event-based-subscriptions.md index 861aae1b4..3344fc294 100644 --- a/src/roadmaps/graphql/content/103-subscriptions/101-event-based-subscriptions.md +++ b/src/roadmaps/graphql/content/103-subscriptions/101-event-based-subscriptions.md @@ -1 +1,9 @@ -# Event based subscriptions \ No newline at end of file +# Event Based Subscriptions + +Event-based subscriptions in GraphQL are a way to push real-time updates to the client based on specific events that occur on the server. These events can be triggered by external sources such as user actions, sensor data, or other systems, or by internal actions such as database updates. + +With event-based subscriptions, the client can subscribe to a specific event or set of events and receive updates in real-time as soon as the event occurs. This allows the client to receive notifications about important changes in the system without the need to constantly poll the server for updates. + +Learn more from the following links: + +- [Event-stream based GraphQL Subscriptions](https://gist.github.com/OlegIlyenko/a5a9ab1b000ba0b5b1ad) \ No newline at end of file diff --git a/src/roadmaps/graphql/content/103-subscriptions/102-live-queries.md b/src/roadmaps/graphql/content/103-subscriptions/102-live-queries.md index 425267a90..b70d41e54 100644 --- a/src/roadmaps/graphql/content/103-subscriptions/102-live-queries.md +++ b/src/roadmaps/graphql/content/103-subscriptions/102-live-queries.md @@ -1 +1,10 @@ -# Live queries \ No newline at end of file +# Live Queries + +In GraphQL, live queries, also known as "real-time queries" or "subscriptions to queries", is a way to push real-time updates to the client, when the data that is being queried changes on the server. It allows the client to subscribe to a specific query and receive updates in real-time as soon as the data changes. + +With live queries, the client can subscribe to a specific query and receive updates when the data that is being queried changes on the server. The client can also specify the fields and arguments of the query, and the server will only send updates for the fields that the client has requested. + +Learn more from the following links: + +- [GraphQL Live Queries](https://graphql.wtf/episodes/54-graphql-live-queries) +- [Tutorial - GraphQL Live Queries](https://www.youtube.com/watch?v=iamn8fZSEXc) \ No newline at end of file diff --git a/src/roadmaps/graphql/content/103-subscriptions/103-defer-stream-directives.md b/src/roadmaps/graphql/content/103-subscriptions/103-defer-stream-directives.md index f367ca34e..d5c745d28 100644 --- a/src/roadmaps/graphql/content/103-subscriptions/103-defer-stream-directives.md +++ b/src/roadmaps/graphql/content/103-subscriptions/103-defer-stream-directives.md @@ -1 +1,10 @@ -# Defer stream directives \ No newline at end of file +# Defer Stream Directives + +In GraphQL, the "defer" and "stream" directives are used to control the handling of fields and their associated data. These directives allow developers to control how data is fetched and sent over the network, and can be used to optimize the performance of a GraphQL API. + +The "defer" directive is used to delay the fetching of a field's data until the data is actually needed by the client. This can be useful for improving the performance of an API by reducing the amount of data that needs to be fetched upfront. + +Learn more from the following links: + +- [Defer and Stream in GraphQL](https://the-guild.dev/graphql/yoga-server/docs/features/defer-stream) +- [Tutorial - Defer and Stream Directives in GraphQL](https://www.youtube.com/watch?v=icv_Pq06aOY) \ No newline at end of file diff --git a/src/roadmaps/graphql/content/103-subscriptions/index.md b/src/roadmaps/graphql/content/103-subscriptions/index.md index bef80be2a..85f6898eb 100644 --- a/src/roadmaps/graphql/content/103-subscriptions/index.md +++ b/src/roadmaps/graphql/content/103-subscriptions/index.md @@ -1 +1,10 @@ -# Subscriptions \ No newline at end of file +# Subscriptions + +In GraphQL, subscriptions are a way to push real-time updates to the client. They allow a client to subscribe to specific events or data changes on the server, and receive updates in real-time as soon as the event occurs or the data changes. Subscriptions are defined on the server and are structured similarly to queries and mutations. + +A subscription includes a "subscription" field at the top level, followed by the fields that define the event or data change to be subscribed to. The client can initiate the subscription by sending the subscription query to the server, and the server will keep the connection open, listening for new events or data changes. Once the event occurs, or the data changes, the server will send the updated data to the client through the open connection. + +Learn more from following links: + +- [Subscriptions and Live Queries - Real Time with GraphQL](https://the-guild.dev/blog/subscriptions-and-live-queries-real-time-with-graphql) +- [Realtime GraphQL Subscriptions](https://www.howtographql.com/graphql-js/7-subscriptions/) \ No newline at end of file