You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apollo Client with HttpLink doesn’t support aborting queries via standard fetch and AbortControler signals. You're only supposed to somehow use the Apollo Client subscription system:
In that situation, if you did await apolloClient.query( it would never resolve; Node.js detects the promise is stuck in a pending status and skips the rest of your code without an error.
Previously we closely replicated the HttpLink logic for all this, but once we have tests we can fix this bug properly.
There should be a distinction between an a fetch AbortError before, vs after, the observer cleanup. Such an error before the cleanup function runs should be treated like any other fetch error. After cleanup begins, it will be ignored because there is nothing subscribed to errors anymore anyway.
The text was updated successfully, but these errors were encountered:
Initialy brought up in #204 (comment) .
Apollo Client with
HttpLink
doesn’t support aborting queries via standardfetch
andAbortControler
signals. You're only supposed to somehow use the Apollo Client subscription system:apollographql/apollo-client#4150
Apollo’s
HttpLink
documentation for the optionfetchOptions
doesn't mention that the standardsignal
fetch option should not be used:https://www.apollographql.com/docs/link/links/http/#options
Although the
HttpLink
code defers to a user configuredsignal
, it will conflict with the way Apollo Client works:https://github.com/apollographql/apollo-client/blob/3c56a1d7a696ed63b2d3681aab0c23b8ea0831db/src/link/http/createHttpLink.ts#L89
If the user supplies a signal that aborts the fetch, a
return
is used that causes the observable to never progress:https://github.com/apollographql/apollo-client/blob/3c56a1d7a696ed63b2d3681aab0c23b8ea0831db/src/link/http/createHttpLink.ts#L134-L135
In that situation, if you did
await apolloClient.query(
it would never resolve; Node.js detects the promise is stuck in a pending status and skips the rest of your code without an error.Previously we closely replicated the
HttpLink
logic for all this, but once we have tests we can fix this bug properly.There should be a distinction between an a fetch
AbortError
before, vs after, the observer cleanup. Such an error before the cleanup function runs should be treated like any other fetch error. After cleanup begins, it will be ignored because there is nothing subscribed to errors anymore anyway.The text was updated successfully, but these errors were encountered: