1

How can i set header_editor_enable as true in graphiql-rails gem? There is no graphiql config file in my project. So, I've created it in config/initializers/graphiql.rb but I don't know how to set it true.

How can I do it?

Procy
  • 49
  • 7

1 Answers1

3

The change with header_editor_enable is not released yet as of 02.12.2021. What you can do is change your Gemfile to point to the latest master of the gem

# Gemfile
gem "graphiql-rails", git: "https://github.com/rmosolgo/graphiql-rails.git", branch: "master"

Then in your initializer, add header_editor_enabled option as

# config/initializers/graphiql.rb
GraphiQL::Rails.config.header_editor_enabled = true

You are good to go

screen_shot_of_editor_with_header_section

Tony Vincent
  • 13,354
  • 7
  • 49
  • 68
  • Thanks for the answer! I've already do it earlier, but forgot to write here the answer. Hope it'll be useful for others. – Procy Jan 10 '22 at 16:11