Class: GraphqlDevise::GraphqlController
- Inherits:
-
ApplicationController
- Object
- DeviseTokenAuth::ApplicationController
- ApplicationController
- GraphqlDevise::GraphqlController
- Defined in:
- app/controllers/graphql_devise/graphql_controller.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
Instance Attribute Details
#client_id ⇒ Object
Returns the value of attribute client_id.
19 20 21 |
# File 'app/controllers/graphql_devise/graphql_controller.rb', line 19 def client_id @client_id end |
#resource ⇒ Object
Returns the value of attribute resource.
19 20 21 |
# File 'app/controllers/graphql_devise/graphql_controller.rb', line 19 def resource @resource end |
#token ⇒ Object
Returns the value of attribute token.
19 20 21 |
# File 'app/controllers/graphql_devise/graphql_controller.rb', line 19 def token @token end |
Instance Method Details
#auth ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/graphql_devise/graphql_controller.rb', line 5 def auth result = if params[:_json] GraphqlDevise::Schema.multiplex( params[:_json].map do |param| { query: param[:query] }.merge(execute_params(param)) end ) else GraphqlDevise::Schema.execute(params[:query], execute_params(params)) end render json: result unless performed? end |