-
Notifications
You must be signed in to change notification settings - Fork 969
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
feature: Support GraphQL Subscriptions on web side #8374
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dthyresson
changed the title
featureL DRAFT - Support GraphQL Subscriptions on web side
feature: DRAFT - Support GraphQL Subscriptions on web side
May 19, 2023
jtoar
approved these changes
May 22, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dthyresson looks good!
dthyresson
changed the title
feature: DRAFT - Support GraphQL Subscriptions on web side
feature: Support GraphQL Subscriptions on web side
May 23, 2023
jtoar
added a commit
that referenced
this pull request
May 24, 2023
* Codegen subscriptions * Add useSubscription graphql hook to web package * Adds test for useSubscription hook * Whitespace cleanup * Fixes useSubscriptionHook typo * Include subscriptions in codegen * chore: run lint fix --------- Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes changes needed to support use of GraphQL Subscriptions on the web side of a RedwoodJS project.
For example:
api/src/subscriptions/**
directory so they gen included in the generated GraphQL schemauseSubscription
from@redwoodjs/web
This allows Subscription to be used and live query to run on server, but there is one remaining issue in that the
@live
directive is not part of the GraphQL schema that is generated.While it would be easy to simply add this to the redwood root schema, I think it would be better to add the sdl types to create the directive use a
yarn rw exp setup realtime
cli command.In short, the current code gen and code file loader only extracts the gel pluck and string interpolation isn't supported, so the schema won't be loaded to generate. Thus a command will be able to output the live directive better (I think).
The PR lets you use subs and live queries from pages and cells, but linting will show a warning for anything that uses
@live
at the moment.