Module: GraphqlDevise::AuthControllerMethods

Extended by:
ActiveSupport::Concern
Included in:
GraphqlController
Defined in:
lib/graphql_devise/concerns/auth_controller_methods.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#client_idObject

Returns the value of attribute client_id.



21
22
23
# File 'lib/graphql_devise/concerns/auth_controller_methods.rb', line 21

def client_id
  @client_id
end

#resourceObject

Returns the value of attribute resource.



21
22
23
# File 'lib/graphql_devise/concerns/auth_controller_methods.rb', line 21

def resource
  @resource
end

#tokenObject

Returns the value of attribute token.



21
22
23
# File 'lib/graphql_devise/concerns/auth_controller_methods.rb', line 21

def token
  @token
end

Instance Method Details

#authObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/graphql_devise/concerns/auth_controller_methods.rb', line 7

def auth
  result = if params[:_json]
    Schema.multiplex(
      params[:_json].map do |param|
        { query: param[:query] }.merge(execute_params(param))
      end
    )
  else
    Schema.execute(params[:query], **execute_params(params))
  end

  render json: result unless performed?
end