Class: GraphqlConnector::Formatters::BaseFormat
- Inherits:
-
Object
- Object
- GraphqlConnector::Formatters::BaseFormat
- Defined in:
- lib/graphql_connector/formatters/base_format.rb
Overview
Class that returns in query or mutation string format
Direct Known Subclasses
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(model, conditions, selected_fields) ⇒ BaseFormat
constructor
A new instance of BaseFormat.
Constructor Details
#initialize(model, conditions, selected_fields) ⇒ BaseFormat
Returns a new instance of BaseFormat.
7 8 9 10 11 |
# File 'lib/graphql_connector/formatters/base_format.rb', line 7 def initialize(model, conditions, selected_fields) @model = model @conditions = conditions @selected_fields = selected_fields end |
Instance Method Details
#create ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/graphql_connector/formatters/base_format.rb', line 13 def create <<-STRING #{query_type} { #{@model}#{arguments} { #{parse_fields(@selected_fields)} } } STRING end |