You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# app/controllers/application_controller.rb
# omitting the rest of the file...
def graphql
puts "*"*50
puts request.headers["Authorization"]
puts "*"*50
end
Server log when sending the request via GraphiQL:
Started POST "/graphql" for ::1 at 2020-03-31 15:46:13 -0700
Processing by ApplicationController#graphql as */*
Parameters: {"query"=>"", "variables"=>"null", "operationName"=>nil, "application"=>{"query"=>"", "variables"=>"null", "operationName"=>nil}}
**************************************************
**************************************************
No template found for ApplicationController#graphql, rendering head :no_content
Do I need to invoke the config? Something else? The header is nil. This is a new Rails app with the following versions:
Rails: 6.0.2.2
Ruby: 2.7.0
graphiql-rails: 1.7
The text was updated successfully, but these errors were encountered:
mattduboismatt
changed the title
Quesiton about request header configuration with initializer
Question about request header configuration with initializer
Mar 31, 2020
Hey, sorry you ran into trouble with this! I hope you found something that works for you. I just tried it out again on the latest graphiql-rails and rails and it seemed to work properly.
One thing to remember is that you have to restart your server if you modify initializers.
If anyone runs into this again, please open a new issue.
Hello! I've attempted to set a header with the initializer:
My graphql endpoint looks like this:
Server log when sending the request via GraphiQL:
Do I need to invoke the config? Something else? The header is
nil
. This is a new Rails app with the following versions:Rails: 6.0.2.2
Ruby: 2.7.0
graphiql-rails: 1.7
The text was updated successfully, but these errors were encountered: