-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Add option to let subscriptionExchange handle all operations #544
Conversation
🦋 Changeset is good to goLatest commit: 73bdd69 We got this. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
const isSubscriptionOperation = (operation: Operation) => | ||
operation.operationName === 'subscription'; | ||
/** This flag may be turned on to allow your subscriptions-transport to handle all operation types */ | ||
enableAllOperations?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use filter function instead? There might be cases (I cannot think of any) where someone wants to pass only subscriptions and mutation via subscription exchange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it makes sense to anticipate use-cases that we can't imagine. To a certain extent we tell people that "forking" our exchanges or making more specific ones is fine.
So overall we only implement what we can see as a use-case right now, instead of bloating our API surface 👍 Hope that makes sense to you though
Also it would be nice if we could pass fetchOptions as well. Right now i am using it to pass an authentication header |
@zenios Kind of unrelated, but I think that's already possible. You receive |
Not if fetchOptions is a function |
@zenios Like in |
If i use this subsciption exchange and fetchOptions is a function on my server fetchOptions will arrive as [object] |
@zenios That sounds like a different problem. You just need to call the function. If you're talking about serialisation, we don't plan or account for Either way, if you need an answer to this feel free to open an issue, where we can discuss this separately. 👍 |
This adds an option to the
subscriptionExchange
to let it handlequery
andmutation
operations as well.Resolve #543