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
{{ message }}
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
The behavior and usage of a terminating ApolloLink and the non-terminating variant is fundamentally different and there is no reason that they should be the same type.
You can combine two non-terminating links and get a non-terminating link
You can combine a non-terminating link with a terminating link and get a terminating link
All other combinations are forbidden/useless
Only terminating links can be executed
If the two kinds of links had separate types we could enforce correct usage (always ending the chain with a single terminating link) automatically for typescript users and have clearer documentation for everyone. The only question is if it can be done easily in a backwards-compatible way.
The type signature of concat could be something like this:
export class ApolloLinkMiddleware {
public concat(next: ApolloLinkMiddleware | NonTerminatingRequestHandler): ApolloLinkMiddleware;
public concat(next: ApolloLink | TerminatingRequestHandler): ApolloLink;
}
The behavior and usage of a terminating
ApolloLink
and the non-terminating variant is fundamentally different and there is no reason that they should be the same type.execute
dIf the two kinds of links had separate types we could enforce correct usage (always ending the chain with a single terminating link) automatically for typescript users and have clearer documentation for everyone. The only question is if it can be done easily in a backwards-compatible way.
The type signature of
concat
could be something like this:where
The text was updated successfully, but these errors were encountered: