Problem of package development using GraphQL
See original GitHub issueI develop a package that uses graphql. It has peerDeps:
"peerDependencies": {
"@types/graphql": "~0.10.4 || ~0.11.0 || ~0.12.0 || ~0.13.0",
"graphql": "~0.10.4 || ~0.11.0 || ~0.12.0 || ~0.13.0"
}
Using standart package development flow, I make a repo of this package, link it with yarn link, then go to test project and add it via yarn link package/name.
And on printSchema in the package I get:
Error: Cannot use GraphQLObjectType "__Directive" 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.
resolutions in both packages don’t work.
And I see no options to suppress this behavior.
I think that there should be such option, to suppress this check on such cases (maybe via env variable or something else), in other case I don’t understand, how to develop and check packages locally
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Five Common Problems in GraphQL Apps (And How to Fix ...
Schema duplication; Server/client data mismatch; Superfluous database calls; Poor performance; Boilerplate overdose. I'm willing to bet your app ...
Read more >GraphQL performance explained - Medium
Performance problems are often one of the reasons why developers avoid adopting GraphQL API. First Google search results that will appear ...
Read more >GraphQL vs. REST APIs: Why you shouldn't use GraphQL
We'll discuss the drawbacks of using GraphQL, including performance issues, problems with GraphQL schemas, and complex queries.
Read more >Full Stack Error Handling with GraphQL and Apollo
As a front-end developer, I would like to display rich error feedback in the UI to empower my users to fix their own...
Read more >GraphQL Advantages and Disadvantages - Javatpoint
It unifies them and hides their complexity. The GraphQL server is also used to fetch data from the existing systems and package it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@terion-name I see. I can’t think of any good solution to this problem that we could implement inside
graphql-js😞 Possible workaround: copynode_modules/graphqlsomewhere and runyarn linkin it and also link it in two projects you mentioned.@leebyron resolutions doesn’t work. because, as I’ve written, I am linking a package that is in develop to project it is developed for via yarn link. So they, are in different places and have different node_modules