Class: GraphqlRails::Model::CallGraphqlModelMethod

Inherits:
Object
  • Object
show all
Includes:
Service
Defined in:
lib/graphql_rails/model/call_graphql_model_method.rb

Overview

Executes model method and adds additional meta data if needed

Constant Summary collapse

PAGINATION_KEYS =
%i[before after first last].freeze

Instance Method Summary collapse

Constructor Details

#initialize(model:, method_keyword_arguments:, graphql_context:, attribute_config:) ⇒ CallGraphqlModelMethod

Returns a new instance of CallGraphqlModelMethod.



13
14
15
16
17
18
# File 'lib/graphql_rails/model/call_graphql_model_method.rb', line 13

def initialize(model:, method_keyword_arguments:, graphql_context:, attribute_config:)
  @model = model
  @method_keyword_arguments = method_keyword_arguments
  @graphql_context = graphql_context
  @attribute_config = attribute_config
end

Instance Method Details

#callObject



20
21
22
23
24
# File 'lib/graphql_rails/model/call_graphql_model_method.rb', line 20

def call
  with_graphql_context do
    run_method
  end
end