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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Configure In-Memory or Redis-backed GraphQL Live Query and Subscriptions #8791

Merged
merged 15 commits into from
Jul 3, 2023

Conversation

dthyresson
Copy link
Contributor

@dthyresson dthyresson commented Jun 30, 2023

This PR refactors the Live Query and Subscription configuration for Redwood Realtime to move more boilerplate setup to manage the stores and behavior into the framework rather than in the app.

Redis or in-memory stores can be setup. One might use in memory for dev, and then Redis for prod, etc.

See: https://the-guild.dev/graphql/yoga-server/docs/features/subscriptions#distributed-pubsub-for-production

Redis and IORedis clients have been tested; Upstash Redis doesn't seem to work as it can publish but not subscribe? Have to confirm.

@dthyresson dthyresson added this to the v6.0.0 milestone Jun 30, 2023
@dthyresson dthyresson self-assigned this Jun 30, 2023
@dthyresson dthyresson added the release:feature This PR introduces a new feature label Jun 30, 2023
yarn.lock Show resolved Hide resolved
@dthyresson dthyresson marked this pull request as ready for review June 30, 2023 17:13
@dthyresson
Copy link
Contributor Author

I also have to completely redo docs and community post now as lots of setup has been simplified.

@dthyresson dthyresson changed the title WIP: Configure In-Memory or Redis-backed GraphQL Live Query and Subscriptions feat: Configure In-Memory or Redis-backed GraphQL Live Query and Subscriptions Jun 30, 2023
@dthyresson
Copy link
Contributor Author

I need to remove that es lint and just realized I should add a few more uaeRedwoodRealtime tests for the pubSub and new config

@dthyresson
Copy link
Contributor Author

I had a new idea. May I use the real-time to define the config and import that in the server.

In long run that may be easier to manage and codemod updates.

@dthyresson dthyresson marked this pull request as draft June 30, 2023 18:57
@dthyresson
Copy link
Contributor Author

I had a new idea. May I use the real-time to define the config and import that in the server.

In long run that may be easier to manage and codemod updates.

I have moved redwood Realtime config into the lib and import that now in server file so it is cleaner.

Tests added to confirm that the store is created for LQ and pubSub for Subs.

@dthyresson dthyresson marked this pull request as ready for review July 1, 2023 12:23
@dthyresson dthyresson merged commit be08e83 into redwoodjs:main Jul 3, 2023
29 checks passed
jtoar pushed a commit that referenced this pull request Jul 4, 2023
…criptions (#8791)

This PR refactors the Live Query and Subscription configuration for
Redwood Realtime to move more boilerplate setup to manage the stores and
behavior into the framework rather than in the app.

Redis or in-memory stores can be setup. One might use in memory for dev,
and then Redis for prod, etc.

See:
https://the-guild.dev/graphql/yoga-server/docs/features/subscriptions#distributed-pubsub-for-production

Redis and IORedis clients have been tested; Upstash Redis doesn't seem
to work as it can publish but not subscribe? Have to confirm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants