Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proofreading fixes for realtime docs #9657

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions docs/docs/realtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ The answer is: **now**.

## What is Realtime?

RedwoodJS's initial real-time solution leverages on GraphQL and relies on a serverful deployment to maintain a long-running connection between the client and server.
RedwoodJS's initial real-time solution leverages GraphQL and relies on a serverful deployment to maintain a long-running connection between the client and server.

:::note
This means that your cannot currently use RedwoodJS when deployed to Netlify or Vercel.
This means that your cannot currently use RedwoodJS Realtime when deployed to Netlify or Vercel.

**More information about deploying a serverful RedwoodJS is forthcoming.**
**More information about deploying a serverful RedwoodJS application is forthcoming.**
:::

RedwoodJS's GraphQL Server uses [GraphQL over Server-Sent Events](https://github.com/enisdenjo/graphql-sse/blob/master/PROTOCOL.md#distinct-connections-mode) spec "distinct connections mode" for subscriptions.

Advantages of SSE over WebSockets include:

* Transported over simple HTTP instead of a custom protocol
* Built in support for re-connection and event-id Simpler protocol
* Built in support for re-connection and event-id
* Simpler protocol
* No trouble with corporate firewalls doing packet inspection

### Subscriptions and Live Queries
Expand Down Expand Up @@ -71,8 +72,8 @@ and have the latest data reflected in your app.
Lastly, the Redwood CLI has commands to

- generate a boilerplate implementation and sample code needed to create your custom
- subscriptions
- live Queries
- subscriptions
- live Queries

Regardless of the implementation chosen, **a stateful server and store are needed** to track changes, invalidation, or who wants to be informed about the change.

Expand Down Expand Up @@ -187,7 +188,6 @@ import subscriptions from 'src/subscriptions/**/*.{js,ts}'
* Redwood Realtime supports in-memory and Redis stores:
* - In-memory stores are useful for development and testing.
* - Redis stores are useful for production.
*
*/
export const realtime: RedwoodRealtimeOptions = {
subscriptions: {
Expand Down Expand Up @@ -256,7 +256,7 @@ Counts down from a starting values by an interval.

```graphql
subscription CountdownFromInterval {
countdown(from: 100, interval: 10)
countdown(from: 100, interval: 10)
}
```

Expand All @@ -279,15 +279,15 @@ The invalidation mechanism is based on GraphQL ID fields and schema coordinates.

```graphql
query GetCurrentAuctionBids @live {
auction(id: "1") {
bids {
amount
}
highestBid {
amount
}
id
title
auction(id: "1") {
bids {
amount
}
highestBid {
amount
}
id
title
}
}

Expand Down Expand Up @@ -596,7 +596,6 @@ Bid on a fancy pair of new sneaks!
When a bid is made, the auction updates via a Live Query due to the invalidation of the auction key.

```ts

const key = `Auction:${auctionId}`
context.liveQueryStore.invalidate(key)
```
Expand All @@ -616,7 +615,6 @@ Options:
#### Test

```ts

/**
* To test this live query, run the following in the GraphQL Playground:
*
Expand Down Expand Up @@ -706,4 +704,3 @@ Powered by OpenAI, this movie tagline and treatment updates on each stream conte
```ts
context.liveQueryStore.invalidate(`MovieMashup:${id}`)
```

Loading