apollo-angular
apollo-angular copied to clipboard
Incorrect @apollo/client package dependency
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 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 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.
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:

👆 Seems to be tracked here: https://github.com/kamilkisiela/apollo-angular/pull/1906
I'm getting the same error... how can I update the apollo client using npm?
Same issue here
Should be solved by #1910, released as 4.2.1.
Should be solved by #1910, released as 4.2.1.