rmosolgo / graphiql-rails

Mount the GraphiQL query editor in a Rails app
MIT License
447 stars 135 forks source link

Add support for the header editor #95

Closed gingermusketeer closed 2 years ago

gingermusketeer commented 2 years ago

Why: so that headers can be modified for the GraphQL requests. This is handy with custom authentication approaches.

rmosolgo commented 2 years ago

Awesome, thanks for the improvement!

zavan commented 2 years ago

Great job @gingermusketeer!

@rmosolgo I'm using the master branch just for this feature now. Can we get a release please? Thanks!

gaotongfei commented 2 years ago

+1 I'm also waiting for a new release. thanks! 🙏🏼

bragamat commented 2 years ago

For those still waiting for the release here is a quick workaround:

Update your gemfile with:

gem 'graphiql-rails', git: 'https://github.com/rmosolgo/graphiql-rails', branch: 'master'

run:

$ bundle

and then in your config/initializers/graphiql.rb add the line:

GraphiQL::Rails.config.header_editor_enabled = true

After that you're good to go! 🚀

Screen Shot 2022-07-05 at 10 01 52
letiesperon commented 1 year ago

@bragamat sorry to bother you and thanks for this feature! I followed your instructions but it's still not showing for me. Is there anything else I need to do to get the headers button?