-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hi there,
we just migrated to Apollo 4.x. Our TypeScript complained about the possible undefined forward in request. Our temporary fix is this:
I am not sure when forward is really undefined? Would you be willing to make this link Apollo 4.x ready? Happy to give a helping hand!
Cheers
Thomas
// Wraps apollo-link-serialize package (version 4.0.0) which uses @apollo/client 3.3.20 to work with @apollo/client 3.4.x
export class SerializingLinkWrapper extends ApolloLink {
private serializingLink: SerializingLink;
constructor() {
super();
this.serializingLink = new SerializingLink();
}
request(operation: Operation, forward?: NextLink): Observable<FetchResult> | null {
if (forward) {
return this.serializingLink.request(operation, forward);
} else {
throw new Error('Missing NextLink');
}
}
}
Metadata
Metadata
Assignees
Labels
No labels