rmosolgo / graphiql-rails

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

support for passing headers #57

Closed chevinbrown closed 5 years ago

chevinbrown commented 5 years ago

There is currently no ability to pass headers--since bearer token/JWT is fairly common this makes using this library pretty difficult.

I'm going to fool around with merging this library into this one because it's a joy to use:

https://github.com/OlegIlyenko/graphiql-workspace

Would you be open to something like that, or at a minimum adding header support?

chevinbrown commented 5 years ago

After playing with this for just a few minutes, the react project above has a lot of niceties that this project could benefit from.

How would you feel about wrapping that library?

rmosolgo commented 5 years ago

Hi, I think it's be a great idea to have a Ruby-ready wrapper of that project! I think it would be possible to make an event better library, too, making a Rack app instead of a Rails engine, so that even non-Rails (and non-Sprockets) apps could use it. Let me know how it goes!

chevinbrown commented 5 years ago

@rmosolgo Do you think header-passing is out of scope for this library? Or are you too busy to propose this as a feature?

Or do you prefer no issues and PRs only?

rmosolgo commented 5 years ago

It's probably out-of-scope. I mean, you're talking about accepting user input then sending that along with requests, right? So it would need a UI and glue code? My impression is that time would be better spent wrapping graphql-workspace, since it has so many other good features!

chevinbrown commented 5 years ago

Correct--with this library, there's no way to pass a JWT/Bearer token as a header.

It's really sad about OSS...so little time and so much that the community needs.