question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update GraphQL to 14

See original GitHub issue

Is your feature request related to a problem? Please describe. I have conflicting GraphQL versions which results in this error in production (not local dev):

Uncaught Error: Cannot use e "__Schema" 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.

This is because I am using aws-amplify-react which has aws-amplify as a peer-dependency. aws-amplify pulls in @aws-amplify/api which has a graphql dependency locked in to 0.13.0. This release is over a year old, and 14.0 was in Aug '18, over 6 months ago. I’m also using Apollo which requires 14.

Describe the solution you’d like I would like for @aws-amplify/api to update its graphQL dependency version.

Describe alternatives you’ve considered

  • I’ve tried using yarn’s resolutions: 14.0.0 - this appears to work locally but not when it’s deployed.
  • Not using aws-amplify and instead pulling in the module we need: @aws-amplify/core, @aws-amplify/auth & @aws-amplify/ui (https://github.com/aws-amplify/amplify-js/wiki/Amplify-modularization) but this doesn’t work because aws-amplify-react has a peer dependency with aws-amplify and even if I get around that, it uses @aws-amplify/api which is the part that includes graphql.
  • I can’t revert to using graphQL 0.13 because we already have a system in place built on Apollo and reverting that would be far too much work.

Additional context The only thing I can think of doing now is removing our dependency on aws-amplify-react, and then using our own UI for the sign in. That then I can go the modular AWS approach and avoid @aws-amplify/api.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
stanislav-sidorovcommented, Sep 10, 2019

same problem aws-amplify-react-native@2.1.19 requires a peer of graphql@0.13.0 @apollo/react-hooks@3.1.0 requires a peer of graphql@^14.3.1 @apollo/react-common@3.1.0 requires a peer of graphql@^14.3.1

0reactions
github-actions[bot]commented, Jun 12, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

graphql - npm
The JavaScript reference implementation for GraphQL, a query language for APIs created by Facebook. ... See more complete documentation at https ...
Read more >
Upgrade to graphql-js 14.0 · Issue #140 - GitHub
I'm in a kind of a deadlock where some of my dependencies require graphql 14.x.x but I can't upgrade because type-graphql doesn't work...
Read more >
Mutations in Apollo Client - Apollo GraphQL Docs
This article demonstrates how to send updates to your GraphQL server with the useMutation hook. You'll also learn how to update the Apollo...
Read more >
GraphQL.js: Preparing for v14.0.0
Other than this versioning change, there will be few if any breaking changes in this next release. Moving from v0.13 to v14.0 will...
Read more >
GraphQL | A query language for your API
Add new fields and types to your GraphQL API without impacting existing queries. Aging fields can be deprecated and hidden from tools. By...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found