Class: Binda::Api::Resolvers::RepeatersResolver

Inherits:
Object
  • Object
show all
Defined in:
app/graphql/binda/api/resolvers/repeaters_resolver.rb

Instance Method Summary collapse

Instance Method Details

#call(obj, args, ctx = {}) ⇒ Object



2
3
4
5
# File 'app/graphql/binda/api/resolvers/repeaters_resolver.rb', line 2

def call(obj, args, ctx = {})
  repeaters = Binda::Repeater.includes(:field_setting).where(binda_field_settings: { slug: args[:slug] }).order(:position)
  repeaters.select{|r| r.fieldable.slug == args[:fieldable_slug] }
end