Adding content to 103-subscriptions

content/graphql
syedmouaazfarrukh 2 years ago
parent 4745811114
commit ac8711a0aa
  1. 11
      src/roadmaps/graphql/content/103-subscriptions/100-what-are-subscriptions.md
  2. 10
      src/roadmaps/graphql/content/103-subscriptions/101-event-based-subscriptions.md
  3. 11
      src/roadmaps/graphql/content/103-subscriptions/102-live-queries.md
  4. 11
      src/roadmaps/graphql/content/103-subscriptions/103-defer-stream-directives.md
  5. 11
      src/roadmaps/graphql/content/103-subscriptions/index.md

@ -1 +1,10 @@
# What are subscriptions
# 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/)

@ -1 +1,9 @@
# Event based subscriptions
# 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)

@ -1 +1,10 @@
# Live queries
# 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)

@ -1 +1,10 @@
# Defer stream directives
# 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)

@ -1 +1,10 @@
# Subscriptions
# 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/)
Loading…
Cancel
Save