-
Notifications
You must be signed in to change notification settings - Fork 565
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
Example Request: Subscriptions with RedisPubSub #1340
Comments
Hey @JoJ123, PubSub works with the import {PubSub} from "graphql-subscriptions"
import {filter, pipe} from "@graphql-yoga/common"
const pubSub = new PubSub()
pipe(
pubSub.asyncIterator("foo"),
filter(value => value.id === "3")
) However, the TypeScript typings within the We recommend using the You can subscribe this issue and pull request for updates: |
Hi @n1ru4l In this case would it not already work to just add
Otherwise, I will keep the WithFilter from Apollo until we can migrate to the EventTarger Implementation in July. |
This would definitely work (with the drawback of a degraded TypeScript developer experience). |
Yeah, but it could solve the next 2-3 weeks :) |
We now have an example on https://github.com/dotansimha/graphql-yoga/tree/master/examples/redis-pub-sub |
How can I filter the subscription with the example above? I have a chat app and I want the message (payload) to be sent only to the matching |
@inc16sec filtering events is described in the advanced section in the Subscription documentation: https://www.the-guild.dev/graphql/yoga-server/v3/features/subscriptions#advanced |
I see. Thank you @n1ru4l for your response. |
Hey,
I would like to request an example of GraphQL Yoga Subscriptions with RedisPubSub and asynchronous filtering.
We managed to migrate from ApolloServer to Yoga, but we still have to rely on the
withFilter
Function from apollo. This is working fine, but it would be easier / cleaner if we could directly make usefilter
function from GraphQL Yoga. Like described here: https://www.graphql-yoga.com/docs/features/subscriptions#filter-and-map-valuesThe text was updated successfully, but these errors were encountered: