Class: GraphQL::Functions::Element

Inherits:
Base
  • Object
show all
Defined in:
lib/graphql/functions/element.rb

Instance Method Summary collapse

Methods inherited from Base

create, model

Instance Method Details

#call(_, args, _) ⇒ Object



8
9
10
# File 'lib/graphql/functions/element.rb', line 8

def call(_, args, _)
  @model_class.find(args[:id])
end

#typeObject



12
13
14
# File 'lib/graphql/functions/element.rb', line 12

def type
  @type ||= "Types::#{@model_class}Type".constantize
end