Class: Recline::Model
- Inherits:
-
GraphQL::Rails::ActiveReflection::Model
- Object
- GraphQL::Rails::ActiveReflection::Model
- Recline::Model
- Defined in:
- lib/recline/model.rb
Class Method Summary collapse
Class Method Details
.field(**kwargs, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/recline/model.rb', line 15 def self.field(**kwargs, &block) # We have to define it fresh each time because # its name will be modified and its description # _may_ be modified. field = GraphQL::Field.define do type(Recline::Model.interface) description('Fetch the content model for the given object.') resolve(Recline::ModelReflection) end if kwargs.any? || block field = field.redefine(kwargs, &block) end field end |
.interface ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/recline/model.rb', line 5 def self.interface @interface ||= GraphQL::InterfaceType.define do name "ReclineInterface" field('_model', Recline::Types::ModelReflectionType, 'Model of attributes for field.') do description('Fetch the content model for the given object.') resolve(Recline::ModelReflection) end end end |