Skip to content

Instantly share code, notes, and snippets.

@ChristopherBiscardi
Created February 23, 2016 22:37
Show Gist options
  • Select an option

  • Save ChristopherBiscardi/d9402a50e033a60ac890 to your computer and use it in GitHub Desktop.

Select an option

Save ChristopherBiscardi/d9402a50e033a60ac890 to your computer and use it in GitHub Desktop.
npm dependencies

React-Relay depends on an exact-version of babel-relay-plugin as a peerDependency

babel-relay-plugin depends on an exact-version of graphql-js

Using npm3, you can do one of two things if you want to use graphql in your application.

  1. Keep an exact-match of the graphql dependency in babel-relay-plugin in your package.json
  2. Not include graphql as a dependency, which will cause babel-relay-plugin to cause the installation of graphql. This provides more flexibility to the application at the risk of no longer having explicit dependencies.
@ChristopherBiscardi
Copy link
Copy Markdown
Author

Keeping an inaccurate version of graphql (such as ^0.4.12) will cause two versions of graphql to be installed. One is used by the babel-relay-plugin and one by the application. This difference can cause incompatibilities which are hard to diagnose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment