Hello! We're adding Apollo to two projects that use Angular 6 created with the latest Angular CLI. We got the setup done like in the documentation but when we run the project we get these errors:
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).
And when we go to compile, the build fails completely. Is there anything we can do here to fix it?
skipLibCheck: true in your tsconfig will get around this in the meantime
v1.1.1 contains a fix
This issue came up in latest apollo-client, they changed interfaces a bit...
A little summary because I guess it will make a lot of noise in near future.
[email protected] introduced a breaking change (for typescript users, so for pretty much all of you, angular folks). They changed the way Interfaces behave, now few of them has different generic types which breaks the build.
To support that we released [email protected], that was a rush decision because everyone wanted to have a fix immediately.
[email protected]apollo-client 2.3.3 or greater.apollo-client,[email protected].Neither one of that upgrades works for us, because we are using Ionic, which depends on RxJs 5, whereas the updates of Apollo Client require RxJs 6.
@cbyte ApolloClient introduced that issue so there's nothing I can do about it.
You can still use apollo-client v2.3.2 or less with apollo-angular v1.0.1 or less and it should work. It's also possible to use latest apollo-client with apollo-angular <= 1.0.1, but you have to set skipLibCheck: true in tsconfig's compilerOptions.
You can use Rxjs 6 with Ionic by adding rxjs-compat and doing a bit of tidying
Most helpful comment
Neither one of that upgrades works for us, because we are using Ionic, which depends on RxJs 5, whereas the updates of Apollo Client require RxJs 6.