Initialy brought up in #204 (comment) .
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:
apollographql/apollo-client#4150
Apollo’s HttpLink documentation for the option fetchOptions doesn't mention that the standard signal fetch option should not be used:
https://www.apollographql.com/docs/link/links/http/#options
Although the HttpLink code defers to a user configured signal, 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.
Initialy brought up in #204 (comment) .
Apollo Client with
HttpLinkdoesn’t support aborting queries via standardfetchandAbortControlersignals. You're only supposed to somehow use the Apollo Client subscription system:apollographql/apollo-client#4150
Apollo’s
HttpLinkdocumentation for the optionfetchOptionsdoesn't mention that the standardsignalfetch option should not be used:https://www.apollographql.com/docs/link/links/http/#options
Although the
HttpLinkcode 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
returnis 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
HttpLinklogic for all this, but once we have tests we can fix this bug properly.There should be a distinction between an a fetch
AbortErrorbefore, 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.