Update GraphQL to 14
See original GitHub issueIs 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 becauseaws-amplify-react
has a peer dependency withaws-amplify
and even if I get around that, it uses@aws-amplify/api
which is the part that includesgraphql
. - 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:
- Created 4 years ago
- Reactions:6
- Comments:8 (2 by maintainers)
Top GitHub Comments
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
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.