Sha256: a7dc886deb7d0927a28add24f2828d3a8694c9c7d128612da20d03dbd285499e
Contents?: true
Size: 590 Bytes
Versions: 8
Compression:
Stored size: 590 Bytes
Contents
# frozen_string_literal: true require 'graphql' module GraphQL module Groups module Schema class AggregateType < GraphQL::Schema::Object alias aggregate object class << self def add_fields(fields) fields.each do |attribute| resolve_method = "resolve_#{attribute}".to_sym field attribute, Float, null: false, resolver_method: resolve_method define_method resolve_method do object[attribute] end end end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems