Apollo-angular: Argument of type '{ link: ApolloLink; cache: InMemoryCache; defaultOptions: ...' is not assignable to parameter of type 'ApolloClientOptions<NormalizedCacheObject>'.

Created on 13 Jun 2018  Â·  4Comments  Â·  Source: kamilkisiela/apollo-angular

I updated all dependencies to latest and have the following component:

    apollo.create({
      link: newLink,
      cache: new InMemoryCache(),
      defaultOptions: {
        mutate: {
          errorPolicy: 'all'
        },
        query: {
          errorPolicy: 'all'
        },
        watchQuery: {
          errorPolicy: 'all'
        }
      }
    });

which now gives the following error:

ERROR in src/app/core/graphql/core.graphql.module.ts(46,19): error TS2345: Argument of type '{ link: ApolloLink; cache: InMemoryCache; defaultOptions: { mutate: { errorPolicy: "all"; }; quer...' is not assignable to parameter of type 'ApolloClientOptions<NormalizedCacheObject>'. Types of property 'defaultOptions' are incompatible. Type '{ mutate: { errorPolicy: "all"; }; query: { errorPolicy: "all"; }; watchQuery: { errorPolicy: "al...' is not assignable to type 'DefaultOptions'. Types of property 'query' are incompatible. Type '{ errorPolicy: "all"; }' is not assignable to type 'QueryOptions<OperationVariables>'. Property 'query' is missing in type '{ errorPolicy: "all"; }'.

which i bypassed using:

    apollo.create({
      link: newLink,
      cache: new InMemoryCache(),
      defaultOptions: {
        mutate: {
          errorPolicy: 'all'
        },
        query: {
          errorPolicy: 'all'
        },
        watchQuery: {
          errorPolicy: 'all'
        }
      } as any
    });

But maybe you are able to solve the real error :)

using:

    "apollo-angular": "1.1.0",
    "apollo-angular-link-http": "1.1.0",
    "apollo-cache-inmemory": "1.2.3",
    "apollo-client": "2.3.3",
    "apollo-link": "1.2.2",
    "apollo-link-error": "1.1.0",
    "apollo-link-http": "1.5.4",
    "rxjs": "6.2.1",

    "@types/node": "10.0.4",
bug in progress

Most helpful comment

Released v1.1.1 with a fix

All 4 comments

PR #660 should help with this - thanks!

tried it and works correctly with it, thanks and i will wait for the release. Apollo client is not really following semver rules.

superfast! thank you!!!

On 14 Jun 2018, at 12:06, Hugh Willson notifications@github.com wrote:

Closed #659 via #660.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Released v1.1.1 with a fix

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kobojsaren picture kobojsaren  Â·  6Comments

MaximS picture MaximS  Â·  7Comments

bkinsey808 picture bkinsey808  Â·  3Comments

miquelferrerllompart picture miquelferrerllompart  Â·  7Comments

chihab picture chihab  Â·  4Comments