Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apollo-link dependency causing multiple versions of graphql under node_modules #424

Closed
dotansimha opened this issue Oct 10, 2017 · 11 comments

Comments

@dotansimha
Copy link
Collaborator

dotansimha commented Oct 10, 2017

Since this PR:
#409

My server is using graphql 0.11.7, and latest graphql-tools, and now it comes with a dependency for apollo-link, causing my node_modules have multiple copies for GraphQL:

./node_modules/apollo-server-core/node_modules/graphql
./node_modules/apollo-link/node_modules/graphql
./node_modules/graphql

Causing the server to throw:

Schema must be an instance of GraphQLSchema. Also ensure that there are not multiple versions of GraphQL installed in your node_modules directory.
@dotansimha dotansimha changed the title apollo-link dependency causing multiple version of graphql apollo-link dependency causing multiple versions of graphql under node_modules Oct 10, 2017
@zamiang
Copy link

zamiang commented Oct 10, 2017

I believe this would require changing apollo-link to list graphql as a peer dependency (may be in progress here: apollographql/apollo-link#78) and then updating to use the newer apollo-link. This is a similar problem to what react encountered early on, and now most react libraries list react as a peer dependency.

@freiksenet
Copy link
Contributor

Ping @jbaxleyiii @peggyrayzis

@alvis
Copy link
Contributor

alvis commented Oct 24, 2017

Also, as a note, the current declaration of apollo-link as a dev dependency cause the following typescript error since it is not installed by default. Changing it to a peer dependency would solve this problem as well.

node_modules/graphql-tools/dist/stitching/introspectSchema.d.ts(2,28): error TS2307: Cannot find module 'apollo-link'.
node_modules/graphql-tools/dist/stitching/makeRemoteExecutableSchema.d.ts(1,28): error TS2307: Cannot find module 'apollo-link'.

@hronro
Copy link

hronro commented Nov 1, 2017

Any updates ?

@freiksenet
Copy link
Contributor

Should be fixed in 2.7.0.

@mpicard
Copy link

mpicard commented Nov 2, 2017

Seems broken in 2.7.1

@ghost
Copy link

ghost commented Nov 2, 2017

I agree that it's broken in 2.7.1. In previous version (2.5.1) there was no problem with it:

node_modules/graphql-tools/dist/stitching/introspectSchema.d.ts(2,28): error TS2307: Cannot find module 'apollo-link'.
node_modules/graphql-tools/dist/stitching/makeRemoteExecutableSchema.d.ts(1,28): error TS2307: Cannot find module 'apollo-link'.

@freiksenet
Copy link
Contributor

We had to remove apollo-link from peer dependencies, because nested peer dependencies broke on some environments. graphql-tools only needs apollo-link types, so for typescript you can just install it as devDependency. I'm sorry for the inconvenience.

@freiksenet
Copy link
Contributor

I was referring to original issue when I said it was fixed. Sorry, I didn't read further messages :)

@alvis
Copy link
Contributor

alvis commented Nov 2, 2017

As the original issue is not fixed via the change of dependency, I have created a new issue (#472) for this particular problem.

@stubailo
Copy link
Contributor

The dependency is gone, but there is indeed a new issue with TypeScript. Thanks for opening a new issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants