module ShopsResolver def self.call(obj, args, ctx) limit = args[:limit] order = args[:order] bookable = args[:bookable] shops = Shop.visible shops = shops.limit(limit) if limit.present? shops = shops.order('RAND()') if order == "TRENDING" # 仮実装 shops = shops.order('RAND()') if order == "RANKING" # 仮実装 shops = shops.where(bookable: bookable) if bookable.present? shops = shops.includes(:area) shops