Skip to content

Allow wider range of graphql package version #181

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

Closed
jonaskello opened this issue Feb 14, 2018 · 2 comments
Closed

Allow wider range of graphql package version #181

jonaskello opened this issue Feb 14, 2018 · 2 comments

Comments

@jonaskello
Copy link
Contributor

I am using graphql-tools which tells me this:

[email protected]" has incorrect peer dependency
"graphql@^0.11.0 || ^0.12.0 || ^0.13.0".

So I need at least 0.11.0 of graphql. However graphql-code-generator tells me this:

warning "graphql-code-generator > [email protected]" has incorrect peer dependency "graphql@^0.8.0 || ^0.9.0 || ^0.10.0".
warning "graphql-code-generator > graphql-codegen-core > [email protected]" has incorrect peer dependency "graphql@^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0".

There can be only one version of the graphql in total in the project or everything will break down becuase instanceof checks will not work. This is manifested by an error message like this during install:

 |   Error: Cannot use GraphQLSchema "[object Object]" from another module or realm.
 |
 |   Ensure that there is only one instance of "graphql" in the node_modules
 |   directory. If different versions of "graphql" are the dependencies of other
 |   relied on modules, use "resolutions" to ensure only one version is installed.
 |
 |   https://yarnpkg.com/en/docs/selective-version-resolutions
 |
 |   Duplicate "graphql" modules cannot be used at the same time since different
 |   versions may have different capabilities and behavior. The data from one
 |   version used in the function from another could produce confusing and
 |   spurious results.

Since each package cannot have their own version of the graphql package, they all have to agree on a single version. If graphql-code-generator could be updated to allow "graphql@^0.11.0 || ^0.12.0 || ^0.13.0" it would make it easier to use together with other packages.

@danielkcz
Copy link
Contributor

danielkcz commented Feb 24, 2018

Please note that with 0.13.0 comes a breaking change that directly influences this package ... graphql/graphql-js#1221

Relevant code:

import { OPERATION_DEFINITION, FRAGMENT_DEFINITION } from 'graphql/language/kinds';

@dotansimha
Copy link
Owner

Done!

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

3 participants