ashkan18 / graphlient

Ruby GraphQL Client
MIT License
251 stars 44 forks source link

Dynamically change headers #58

Open dfritsch86 opened 5 years ago

dfritsch86 commented 5 years ago

I need to dynamically change request headers, e.g. to switch bearer tokens when i reached the limit. How can i accomplish this?

dblock commented 5 years ago

I believe right now this would require you to create a new instance of a client. We should call it a bug. I'd like to be able to do:

client.options[:headers] = { new headers }

Maybe you can write a spec for this behavior and we can try and fix this?

ashkan18 commented 5 years ago

yes, this makes sense, a failing spec would be 👌