Class: HQ::GraphQL::RootQuery

Inherits:
Object
  • Object
show all
Defined in:
lib/hq/graphql/root_query.rb

Constant Summary

Constants included from Scalars

Scalars::Object, Scalars::UUID

Class Method Summary collapse

Methods inherited from Object

authorize_action, authorized?, to_graphql, with_model

Methods included from ObjectAssociation

#belongs_to, #has_many, #reflect_on_association

Methods included from ActiveRecordExtensions

included

Class Method Details

.inherited(base) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/hq/graphql/root_query.rb', line 6

def self.inherited(base)
  super
  base.class_eval do
    lazy_load do
      ::HQ::GraphQL.root_queries.each do |field_name:, resolver:, model_name:|
        field field_name, resolver: resolver.call, klass: model_name
      end
    end
  end
end