Class: GraphitiGql::Schema::ListArguments

Inherits:
Object
  • Object
show all
Defined in:
lib/graphiti_gql/schema/list_arguments.rb

Defined Under Namespace

Classes: SortDirType

Instance Method Summary collapse

Constructor Details

#initialize(resource, sideload = nil) ⇒ ListArguments

Returns a new instance of ListArguments.



10
11
12
13
# File 'lib/graphiti_gql/schema/list_arguments.rb', line 10

def initialize(resource, sideload = nil)
  @resource = resource
  @sideload = sideload
end

Instance Method Details

#apply(field) ⇒ Object



15
16
17
18
# File 'lib/graphiti_gql/schema/list_arguments.rb', line 15

def apply(field)
  define_filters(field) unless @resource.filters.empty?
  define_sorts(field) unless sorts.empty?
end