Module: GraphQL::AssociationBatchResolver::MysqlColumnAggregator

Defined in:
lib/graphql/association_batch_resolver/column_aggregators/mysql_column_aggregator.rb

Class Method Summary collapse

Class Method Details

.aggregate(expression) ⇒ Object



6
7
8
# File 'lib/graphql/association_batch_resolver/column_aggregators/mysql_column_aggregator.rb', line 6

def self.aggregate(expression)
  Arel::Nodes::NamedFunction.new('GROUP_CONCAT', expression)
end

.deserialize(column, type) ⇒ Object



10
11
12
# File 'lib/graphql/association_batch_resolver/column_aggregators/mysql_column_aggregator.rb', line 10

def self.deserialize(column, type)
  column.split(',').map(&type.method(:deserialize))
end