Hola actualmente tengo una app en rails con graphql que funciona bien (solo tiene una vista) hasta que intento acceder a la ruta para graphiql en produccion (ya que esta en heroku), cada vez que intento acceder a la ruta en cuestion url/graphiql
, si bien en un principio hace como que me toma la ruta esta se queda en loading, pero cuando reviso que error me muestra por consola aparece lo siguiente:
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.
Buscando el error(no me aparecio mucho para rails) pero estos aconsejaban que agregara a package.json un script de resolutions
y le pusiese la version para graphql.
Mi configuracion en routes para graph es: (actualmente volvi a hacer deploy quitando env)
Rails.application.routes.draw do
#if Rails.env.development?
#mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
#end
mount GraphiQL::Rails::Engine, at: '/graphiql', graphql_path: '/graphql'
post "/graphql", to: "graphql#execute"
mount ActionCable.server, at: '/cable'
root 'static_pages#home'
end
y mi gemfile es:
gem 'graphql', '1.9.17'
gem 'graphiql-rails', '1.7.0', group: [:development, :production]
gem 'bcrypt', '~> 3.1.13'
Hasta ahora no he podido encontrar un error parecido al mio con heroku en una app con rails y graphql.