module GraphQL::Sugar::Function

Public Class Methods

included(base) click to toggle source
# File lib/graphql/sugar/function.rb, line 4
def self.included(base)
  base.extend ClassMethods
  base.class_eval do
    attr_reader :object
    attr_reader :params
    attr_reader :context
  end
end

Public Instance Methods

call(obj, args, ctx) click to toggle source
# File lib/graphql/sugar/function.rb, line 24
def call(obj, args, ctx)
  @object = obj
  @params = args.to_h.deep_symbolize_keys
  @context = ctx
end