Closed oyed closed 3 years ago
If I'm reading this correctly (https://github.com/andyrichardson/subscriptionless/blob/master/src/pubsub/publish.ts#L66), the filter object defined in withFilter
is stored against the subscription in DDB (To remain stateless), however using equals
would mean both payloads have to match in their entirety right?
E.g. a subscription payload of:
{
"user_id": 1,
"hello": "world"
}
Wouldn't match against a withFilter
definition of:
withFilter(subscribe('MY_TOPIC'), (root, args, context, info) => ({
user_id: args.user_id,
}));
Since withFilter
doesn't include a hello
key value pair?
My bad - re-read and noticed that it's creating those comparisons per key => value, not the overall object. My context generator wasn't working properly which was the issue.
Loving the library! I'm trying to add filters to my subscriptions, but can't seem to understand the format.
Would it be possible to have the example in the repo use it?
I also noticed that since it doesn't return an
AsyncIterator
, typings kinda fail for graphql-codegen generated types