rmosolgo / graphiql-rails

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

Prevent setting nil headers #109

Closed peterfication closed 7 months ago

peterfication commented 1 year ago

If the header lambda returns nil, the header is still set with a value of null.

This PR changes that and does not set headers that resolve to nil.

peterfication commented 1 year ago

@rmosolgo is this PR something you would consider useful? I need it in the project I'm currently working on.

rmosolgo commented 7 months ago

Hey, thanks for this improvement! Sorry it took me so long to review it.

I switched the check from present? to !...nil? in case people want to send blank strings as header values.