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

Mapping Iterator results #659

Open
Vincz opened this issue Jan 14, 2025 · 0 comments
Open

Mapping Iterator results #659

Vincz opened this issue Jan 14, 2025 · 0 comments

Comments

@Vincz
Copy link

Vincz commented Jan 14, 2025

I'm trying to map the iterator results just before sending them to the subscribers.
I achieved this by using a custom deserializer.
It's the best place to do it as it is not executed if there is no subscriber and if there is, it is executed only once.
It works well except that sometimes, I need to discard the message.
Raising an exception, returning null or undefined send the message to the subscribers (raising an exception send the original message which seems weird to me).
Would you consider a PR either to add a messageTransformer option or simply a PR to ignore an undefined message.

Everything would take place here: https://github.com/davidyaha/graphql-redis-subscriptions/blob/2e3704655f48ebd1f3ffaefff721f155bb134fe3/src/redis-pubsub.ts#L214C1-L225C6

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant