apollo-link-scalars icon indicating copy to clipboard operation
apollo-link-scalars copied to clipboard

Type Incompatibility in Apollo Client 3.8

Open tictaqqn opened this issue 1 year ago • 1 comments

  • I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project

  • Summary While working on a project with Apollo Client 3.8, I've encountered a type incompatibility issue between the type of ApolloLink and the return type of withScalars. Specifically, the types of the fields split, left, right in ApolloLink appear to be incorrect.

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

tictaqqn avatar Nov 03 '23 11:11 tictaqqn

the type returned by withScalars is an ApolloLink that comes from

import { ApolloLink, FetchResult, NextLink, Observable, Operation } from "@apollo/client/core";

@apollo/client is a Peer Dependency (marked as "@apollo/client": "3.x"), so it will use whatever version you have in your app.

I have checked in my app, and works fine for me. It uses:

  • in package.json
"@apollo/client": "~3.8.8",
  • in yarn.lock:
"@apollo/client@~3.8.8":
  version "3.8.8"

If you are able to provide a repo where I can replicate the error, I could investigate further.

Cheers!

eturino avatar Dec 12 '23 18:12 eturino