Can't import 'graphql' module in Snack

#1

Should it be possible to import graphql in Snack at the moment? I get the following:

Failed to install module 'graphql': Cannot use "__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.
 imported from null
#2

There’s a bad interaction with webpack in graphql@0.12 but there’s a fix on the way: https://github.com/graphql/graphql-js/pull/1174

1 Like
#3

Ah, sure enough! Thanks @thetc.

closed #4

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.