jaydenseric / apollo-upload-client

A terminating Apollo Link for Apollo Client that fetches a GraphQL multipart request if the GraphQL variables contain files (by default FileList, File, or Blob instances), or else fetches a regular GraphQL POST or GET request (depending on the config and GraphQL operation).
https://npm.im/apollo-upload-client
1.53k stars 156 forks source link

Type Incompatibility in Apollo Client 3.8 #324

Closed tictaqqn closed 12 months ago

tictaqqn commented 1 year ago

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 createUploadLink. Specifically, the types of the fields split, left, right in ApolloLink appear to be incorrect.

iM-GeeKy commented 1 year ago

This is a duplicate of https://github.com/DefinitelyTyped/DefinitelyTyped/issues/47369. Deleting your lock file and reinstalling the modules should resolve this.

jaydenseric commented 12 months ago

Closing because a possible solution has been suggested, and I'm relatively confident that there isn't a problem with the types because the example app uses Apollo Client v3.8 and the TypeScript check script works ok:

https://github.com/jaydenseric/apollo-upload-examples/blob/1ed805d97907c5de6bb13a6abfb52377ab0177ff/app/package.json#L59

Be sure to configure TypeScript according to the documented requirements:

https://github.com/jaydenseric/apollo-upload-client/tree/v18.0.1#requirements

Also, be sure to uninstall @types/apollo-upload-client as the package apollo-upload-client contains its own types now. you can use the command npm ls @types/apollo-upload-client to be sure it's not installed by anything in node_modules.

If you are able to narrow down something that is reproducibly wrong with this package, we can reopen this issue.