Class: ActiveGraphql::Client::Actions::QueryAction

Inherits:
Action
  • Object
show all
Defined in:
lib/active_graphql/client/actions/query_action.rb

Overview

handles all action details which are specific for query type request

Instance Attribute Summary

Attributes inherited from Action

#client, #input_attributes, #meta_attributes, #name, #output_values

Instance Method Summary collapse

Methods inherited from Action

#graphql_variables, #initialize, #inspect, #meta, #reselect, #response, #rewhere, #select, #to_graphql, #where

Methods included from VariableDetectable

#variable_attributes, #variable_value?

Constructor Details

This class inherits a constructor from ActiveGraphql::Client::Actions::Action

Instance Method Details

#find_by(inputs) ⇒ Object



12
13
14
# File 'lib/active_graphql/client/actions/query_action.rb', line 12

def find_by(inputs)
  where(inputs).result
end

#select_paginated(*array_outputs, **hash_outputs) ⇒ Object



16
17
18
19
# File 'lib/active_graphql/client/actions/query_action.rb', line 16

def select_paginated(*array_outputs, **hash_outputs)
  outputs = join_array_and_hash(*array_outputs, **hash_outputs)
  select(edges: { node: outputs })
end

#typeObject



8
9
10
# File 'lib/active_graphql/client/actions/query_action.rb', line 8

def type
  :query
end