Apollo-link: Update peer dependency of Graphql

Created on 1 Feb 2019  ยท  11Comments  ยท  Source: apollographql/apollo-link

Expected Behavior
Install latest version of GraphQL without warnings

Actual Behavior

npm WARN [email protected] requires a peer of graphql@^0.11.3 || ^0.12.3 || ^0.13.0 but none is installed. You must install peer dependencies yourself.

A _simple_ reproduction
npm i graphql@latest in a repo with apollo-link-context

bug confirmed

All 11 comments

@dauledk Which version of apollo-link-context are you using? The latest version (1.0.12) depends on apollo-link 1.2.6, which has been updated to accept a peer dep of graphql ^14.0.0.

@hwillson my package.json looks like this:

    "apollo-angular": "^1.5.0",
    "apollo-angular-link-http": "^1.4.0",
    "apollo-cache-inmemory": "^1.2.8",
    "apollo-client": "^2.4.0",
    "apollo-link-context": "^1.0.8",
    "apollo-link-error": "^1.1.5",
    "graphql": "^0.13.2",
    "graphql-tag": "^2.9.2",

Thanks - can you make sure the latest version of apollo-link-context is installed? You might have to npm update.

Sorry - I was being too fast ๐Ÿคช The previous package.json was not from the correct branch. It looks like this:

    "apollo-angular": "^1.5.0",
    "apollo-angular-link-http": "^1.4.0",
    "apollo-cache-inmemory": "^1.4.2",
    "apollo-client": "^2.4.12",
    "apollo-link-context": "^1.0.12",
    "apollo-link-error": "^1.1.5",
    "graphql": "^14.1.1",
    "graphql-tag": "^2.10.1",

This actually generates two warnings:

npm WARN [email protected] requires a peer of graphql@^0.11.3 || ^0.12.3 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] - 0.13.x but none is installed. You must install peer dependencies yourself.

So I already have the latest version of apollo-link-context.

No problem - okay, I bet something else is pulling in the older apollo-link version then. Would you mind posting the output of npm ls apollo-link?

Yeah:

<full-path-to-my-project>
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]
โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚   โ”œโ”€โ”€ [email protected]
โ”‚   โ””โ”€โ”ฌ [email protected]
โ”‚     โ””โ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ”œโ”€โ”€ [email protected]  deduped
โ”‚ โ””โ”€โ”ฌ [email protected]
โ”‚   โ””โ”€โ”€ [email protected]
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ””โ”€โ”ฌ [email protected]
  โ”œโ”€โ”€ [email protected]
  โ””โ”€โ”ฌ [email protected]
    โ””โ”€โ”€ [email protected]  deduped

Okay - apollo-client has been updated to use the latest version, but those changes aren't being pushed out until apollo-client 2.5.0 is released next week. I'll ping the apollo tooling team about updating the link version that project is using. Thanks for reporting this!

Is it safe to update GraphQl and ignore the warning - or should the warning be taken seriously ๐Ÿ˜„ ?

Totally safe to ignore - all of the apollo- projects listed in that dep tree will work with graphql 14.

It looks like the latest version of apollo has dropped the dependency on apollo-link, so if you update to apollo 2.4.1 that should help with this (but you'll still see the warning until apollo-client 2.5.0 is released next week).

Is it safe to say the dependency for graphql is no concern?

It is supported in apollo-link: https://github.com/apollographql/apollo-link/blob/master/packages/apollo-link/package.json#L44

Was this page helpful?
0 / 5 - 0 ratings