apollo-angular icon indicating copy to clipboard operation
apollo-angular copied to clipboard

Incorrect @apollo/client package dependency

Open mpo-dev opened this issue 3 years ago • 2 comments

Describe the bug

Using the library [email protected] causes the following build error when using a @apollo/client package version below v3.4.0, despite the apollo-client library requiring the "@apollo/client": "^3.0.0".

node_modules/apollo-angular/query-ref.d.ts:19:65 - error TS2344: Type 'T' does not satisfy the constraint 'keyof K'.
19     fetchMore<K = V>(fetchMoreOptions: FetchMoreQueryOptions<K, T>): Promise<ApolloQueryResult<T>>;

To Reproduce

Try to build a project with package versions as in my environment.

Expected behavior

The project to build correcty.

Environment:

- @angular/[email protected]
- @angular/[email protected]
- @apollo/[email protected]
- [email protected]
- [email protected]
- [email protected]

mpo-dev avatar Aug 30 '22 13:08 mpo-dev

@mpo-dev I am using [email protected] and able to build successfully, my versions are as follows:

├── @angular/[email protected]
├── @angular/[email protected]
├── @angular/[email protected]
├── @apollo/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]

I would maybe try upgrading your @apollo/client to the latest version 3.6.9 and trying again.

Destreyf avatar Sep 06 '22 16:09 Destreyf

@Destreyf That's the point, I figured [email protected] needs at least "@apollo/client": "^3.4.0" by trail and error, despite the library dependency specifying "@apollo/client": "^3.0.0". Any @apollo/client version below 3.4.0 results in build errors.

mpo-dev avatar Sep 07 '22 06:09 mpo-dev

I can observe similar (same?) error when using apollo-angular 4.2.0 with @apollo/client 3.7.6. Note: it works fine with 3.7.5.

typescript 4.8.4

Working:

"@angular/core": "^15.1.2", ... "@apollo/client": "^3.7.5", "apollo-angular": "^4.2.0",

Not Working:

"@angular/core": "^15.1.2", ... "@apollo/client": "^3.7.6", "apollo-angular": "^4.2.0",

Error: Screenshot 2023-02-01 at 10 51 36

pawelpiotrowski avatar Feb 01 '23 10:02 pawelpiotrowski

👆 Seems to be tracked here: https://github.com/kamilkisiela/apollo-angular/pull/1906

pawelpiotrowski avatar Feb 01 '23 10:02 pawelpiotrowski

I'm getting the same error... how can I update the apollo client using npm?

ArtistaDu avatar Feb 03 '23 20:02 ArtistaDu

Same issue here

etsraphael avatar Feb 04 '23 07:02 etsraphael

Should be solved by #1910, released as 4.2.1.

PowerKiKi avatar Feb 13 '23 11:02 PowerKiKi

Should be solved by #1910, released as 4.2.1.

PowerKiKi avatar Feb 13 '23 11:02 PowerKiKi