Apollo-client: react-apollo does not compile after apollo-client 2.3.3 release

Created on 13 Jun 2018  ·  9Comments  ·  Source: apollographql/apollo-client

Hi!
I've run npm i right now and got a new [email protected] as a dependency for react-apollo 2.1.4.

Intended outcome:
The code compiles (in Typescript)

Actual outcome:
It does not compile in Typescript because of an error because FetchMoreQueryOptions became generic:
.../node_modules/react-apollo/types.d.ts Error:(31, 35) TS2314: Generic type 'FetchMoreQueryOptions<TVariables, K>' requires 2 type argument(s). Error:(36, 62) TS2314: Generic type 'UpdateQueryOptions<TVariables>' requires 1 type argument(s).
How to reproduce the issue:
Run npm i for react-apollo

Versions
react-apollo: 2.1.4
apollo-client: 2.3.3

✔ confirmed 🐞 bug 🚨 high-priority

Most helpful comment

Similar error with apollo-angular:

ERROR in node_modules/@types/zen-observable/index.d.ts(8,9): error TS2687: All declarations of 'observable' must have identical modifiers.
node_modules/apollo-angular/QueryRef.d.ts(14,33): error TS2314: Generic type 'FetchMoreQueryOptions<TVariables, K>' requires 2 type argument(s).
node_modules/apollo-angular/QueryRef.d.ts(16,60): error TS2314: Generic type 'UpdateQueryOptions<TVariables>' requires 1 type argument(s).

All 9 comments

Similar error with apollo-angular:

ERROR in node_modules/@types/zen-observable/index.d.ts(8,9): error TS2687: All declarations of 'observable' must have identical modifiers.
node_modules/apollo-angular/QueryRef.d.ts(14,33): error TS2314: Generic type 'FetchMoreQueryOptions<TVariables, K>' requires 2 type argument(s).
node_modules/apollo-angular/QueryRef.d.ts(16,60): error TS2314: Generic type 'UpdateQueryOptions<TVariables>' requires 1 type argument(s).

Thanks for the heads up - I'm looking into this now. Until this is resolved, pinning apollo-client to 2.3.2 will address the issue. More details shortly - thanks!

Not only apollo-client to 2.3.2, but also apollo-cache to 1.1.8 :-(

works till it fix, by pinning all the dependancies of the apollo-client to the old version

        "apollo-client": "2.3.2",
        "graphql-anywhere": "4.1.11",
        "apollo-utilities": "1.0.13",
        "apollo-cache": "1.1.9",
        "apollo-cache-inmemory": "1.2.2",
        "apollo-boost": "0.1.7",

react-apollo 2.1.5 was just published, and should fix this. Let me know otherwise - thanks!

@hwillson thank you for your quick response to this issue

unfortunately, we angular users are experiencing the same issue with apollo-angular (as @nodehack mentioned above)

Thanks for the heads up @lucasmyers and @nodehack - I'm not that familiar with the apollo-angular project, but I'll take a quick look and see if I can help.

@lucasmyers @nodehack PR https://github.com/apollographql/apollo-angular/pull/660 should fix this issue. I won't be able to deploy this tonight, so unless someone else gets to it before me, you should see these changes first thing in the morning.

Version 1.1.1 of https://www.npmjs.com/package/apollo-angular is out now. Thanks!

Was this page helpful?
0 / 5 - 0 ratings