lib/graphql/groups/has_groups.rb
# TODO: Error if there are no groupings defined
Error if there are no groupings defined
Error if there are no groupings defined
def by(name, **options, &block)
          query_method = options[:query_method] || name
          resolver_method = "resolve_#{query_method}".to_sym
          group_field name, [own_result_type],
                      null: false,
                      resolver_method: resolver_method,
                      query_method: query_method,
                      **options, &block
          define_method query_method do |**kwargs|
            kwargs[:scope].group(name)
          end
          define_method resolver_method do |**_|
            group[name]
          end
        end
def by ( name , ** options , & block ) query_method = options [ :query_method ] || name resolver_method = "resolve_#{query_method}" . to_sym group_field name , [ own_result_type ] , null : false , resolver_method : resolver_method , query_method : query_method , ** options , & block define_method query_method do | ** kwargs | kwargs [ :scope ] . group ( name ) end define_method resolver_method do | ** _ | group [ name ] end end
TODO: Error if there are no groupings defined
TODO : Error if there are no groupings defined
# TODO: Warn / Disallow overwriting these resolver methods
name
<not_specific>
options
<not_specific>
block
<not_specific>