mercurius icon indicating copy to clipboard operation
mercurius copied to clipboard

Question: Subscription Gateway caching?

Open darrenfurr opened this issue 3 years ago • 6 comments

Does the federation gateway cache subscriptions? I'm seeing issues where if I add a new field to a schema & deploy that graphql instance. The gateway doesn't appear to return the result. It just returns null.

I have to restart the gateway. Am I missing a setting somewhere to disable this?

Thanks! -Darren

darrenfurr avatar May 12 '21 13:05 darrenfurr

It should update automatically. Could you upload a full example?

mcollina avatar May 12 '21 14:05 mcollina

@mcollina - working on getting you an example. Sorry for the delay

darrenfurr avatar May 14 '21 18:05 darrenfurr

@mcollina - After some research...I tracked this issue down. It is not the gateway.

I migrated our Apollo server(s) with subscriptions to mercurius with federation, so the issue is with the withFilter implementation in mercurius.

The Apollo implementation returns an asyncIterator which we use with KafkaPubSub

I pulled in the graphql-subscription package from Apollo & used their withFilter implementation & it works correctly.

Maybe this is a known issue? If you would like - I can setup a demo repo with examples

darrenfurr avatar May 19 '21 22:05 darrenfurr

The best approach would be to send a PR to fix our implementation!

mcollina avatar May 20 '21 00:05 mcollina

hey @darrenfurr could you create a demo repo with some examples?

ramonmulia avatar Jan 11 '22 11:01 ramonmulia

@ramonmulia - We ran into a number of issues using the subscription gateway + load balancing. We've moved away from using the subscription gateway & just have our clients connect directly to the subscription service.

darrenfurr avatar Jan 11 '22 18:01 darrenfurr