-
-
Notifications
You must be signed in to change notification settings - Fork 458
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
implement conversion for useHTTPGetForQueries #519
Conversation
src/exchanges/fetch.ts
Outdated
@@ -29,7 +29,7 @@ export const fetchExchange: Exchange = ({ forward }) => { | |||
filter(op => op.operationName === 'teardown' && op.key === key) | |||
); | |||
|
|||
return pipe(createFetchSource(operation), takeUntil(teardown$)); | |||
return pipe(createFetchSource(operation, operation.operationName === 'query' && client.preferGetMethod), takeUntil(teardown$)); |
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.
We shouldn’t ever have to read from the client directly. Let’s move this to the operation context.
The reason for that has generally always been that the client’s option are opaque and separate from the operations and how they’re created and are dealt with in the exchange pipeline. So any option on the context can be seen, set, and manipulated by other exchanges. The same doesn’t go for the client.
To be fair, we should probably type the Client
on the exchange using an interface that only contains the method we’d like to be exposed on the exchanges.
The only uncertainty (no documentation anywhere) is how to use fragments for this.