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

Filtering by Post ID #1

Open
Ririshi opened this issue Oct 13, 2020 · 0 comments
Open

Filtering by Post ID #1

Ririshi opened this issue Oct 13, 2020 · 0 comments

Comments

@Ririshi
Copy link

Ririshi commented Oct 13, 2020

Hi there,

I'm using your tutorial and code sample to implement subscriptions over WS using a very similar tech stack. I would like to be able to supply an ID for the specific Post (or in my own case, Story) for which I'd like to receive updates, instead of receiving updates for every post. I added the ID as a parameter to the subscription query, but I am quite lost as to how I should actually filter which events are emitted based on that ID. Should the ID be part of the Event trait? It seems like the general subscribe method of the PubSubServiceImpl you provided can only work with the event name, as that is the only field in the Event trait currently.

Perhaps I should implement a specific PubSubService for my StoryEvent, which also holds a Story, so it will be able to filter based on that story's ID?

Any help would be much appreciated!

P.S.: I realize the code in this repository is already quite old by now, but I did manage to reuse much of it without much hassle, for which I am very thankful! Perhaps I could update this repository with a more up-to-date version of this example, extended with ID-based filtering, once I got it working for myself.

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