Open xEcEz opened 4 years ago
@xEcEz I'm having the same issue. Stuck with this. Did you get any workaround for this?
No, I am still using another ApolloClient
on the side that declares a WebSocketLink
which uses the target URI.
@xEcEz I don't understand why the team still hasn't given any attention to this issue :(
We can use a very unreliable crutch for now: add a comment to the query string. For instance:
#QUERY_TYPE=${type}#
subscription f( ...
And check in the split method:
split(
(op) => {
const sourceQuery = op.query.loc.source.body;
return sourceQuery.search(new RegExp('#QUERY_TYPE=${type}#')) !== -1;
},
link1,
link2
)
Would it be possible to expose
context
inuseSubscription
options?I have a use case where I need to set the URI dynamically for a given subscription. Currently, I am stuck with having to declare another client that uses it by default, where in a similar scenario but when using
useQuery
, I can simply set the context's URI on the fly.