Open jedwards1211 opened 6 years ago
Any progress on this?
I can work on a PR if it is not already being worked on. Someone ack please.
So I said I was planning to do this but...haven't had time 😆
An opt-in {subscriptions: true}
option for this would be fantastic. I need this for mocking subscriptions during development.
Until then, I'm looking into using the PR @fubhy submitted for support: https://github.com/apollographql/apollo-link/pull/916
I'm planning to do this if no one else is already working on it.
Why support subscriptions in
SchemaLink
?SchemaLink
seems primarily intended for SSR, so it doesn't support subscriptions, because SSR doesn't need them (and should not subscribe to anything anyway).But
SchemaLink
is also useful for lightweight integration testing. Right now, to perform end-to-end tests on an Apollo view container component that uses subscriptions, there are two options:subscriptions-transport-ws
in test code useenzyme
to mount an individual view container inside an<ApolloProvider>
connected viaWebSocketLink
If
SchemaLink
supports subscriptions it would provide a third option:enzyme
to mount an individual view container inside an<ApolloProvider>
connected viaSchemaLink
But wouldn't this cause problems with SSR?
It's probably best if
SchemaLink
subscriptions aren't enabled by default, to ensure thatsubscribeToMore
is a no-op during SSR. Integration tests could simply pass something like a{subscriptions: true}
option to turn them on.