Class: HQ::GraphQL::RootMutation

Inherits:
GraphQL::Schema::Object
  • Object
show all
Defined in:
lib/hq/graphql/root_mutation.rb

Class Method Summary collapse

Class Method Details

.inherited(base) ⇒ Object



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

def self.inherited(base)
  super
  base.class_eval do
    lazy_load do
      ::HQ::GraphQL.resources.each do |type|
        type.mutation_klasses.each do |mutation_name, klass|
          field mutation_name, mutation: klass
        end
      end
    end
  end
end