HerbCaudill/jsonschema2graphql

"graphql" is listed as a dependency, not a peer-dependency

Opened this issue · 0 comments

  • I'm submitting a ...
    [X] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

I'm getting the following error on attempting to use the library:

[...]
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.
[...]

(My project graphql is v15, whereas this library is using v14.)

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

To fix, "graphql" should be listed as a peer-dependency rather than a dependency. I'd wager that almost all projects that will be using this library will already have graphql in their node_modules folder; making "graphql" a peer dependency will cause the library to use the version already available, avoiding the "two different versions" issue.