Graphiql Loading page

Asked

Viewed 43 times

0

I have Graphql in the dev Local machine along with a Gem Graphiql where I can do my queries, but on the test server I can’t access this page .../graphiql.

The white screen is written Loading... and never carries.

I’m using

Ruby 2.2.10
Rails 3.2.22

All Gems are installed in both environments;
Returns an error in the browser console:

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.

The following is an excerpt from the gemfile which refers to graphQL

group :Development, :test of the In 'Pry-byebug' end

group :staging, :Production do In 'Unicorn' end

Gem 'test-Unit' Gem 'graphql' group :Development, :master do Gem 'graphiql-Rails' end

  • Hello. Put your Gemfile here too.

  • This is the part that refers to Graph group :Development, :test of Gem 'Pry-byebug' end group :staging, :Production of Gem 'Unicorn' end Gem 'test-Unit' Gem 'graphql' group :Development, master of Gem 'graphiql-Rails' end

1 answer

0

I tried to format your Gemfile and got it:

group :development, :test do 
  gem 'pry-byebug' 
end 

group :staging, :production do 
  gem 'unicorn'  
  gem 'test-unit' 
  gem 'graphql'
end

group :development, :master do 
  gem 'graphiql-rails'
end

If so, the problem is why graphiql-rails is not in your test service group (which I imagine is the staging).

Advice:

1) Looking at this file I would remove the graphql group and would leave it at the root because regardless of the env you will need the graphql.

2) Here at work we only leave the graphiql for Developer (security). If we need access to Stages we use some graphql IDE:

  • Thanks for answering, Rafael Gomes! Okay, I’ve really reformatted this. As amazing as it sounds here the test server is the master. rsrss I would like to leave graphiql so that my partners can have access to queries, data structure, comments... That actually gives me an API documentation.

  • This graphql-ide IDE seemed very interesting, I’ll install it to see if it suits me. Thanks. abç!

  • I get it. A solution would be to make clients connect via the IDE as well. You provide the URL and the person turns around. But thinking and ease, really, Graphiql would kill. As I said: If you leave this Gem out of the groups and leaves it in the general scope may already solve for you. If it helped, please mark the answer as correct. Hugs!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.