Class: Graphql::Generators::Install::MutationRootGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Core
Defined in:
lib/generators/graphql/install/mutation_root_generator.rb

Instance Method Summary collapse

Methods included from Core

#create_dir, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

Instance Method Details

#generateObject



25
26
27
28
29
30
# File 'lib/generators/graphql/install/mutation_root_generator.rb', line 25

def generate
  create_dir("#{options[:directory]}/mutations")
  template("base_mutation.erb", "#{options[:directory]}/mutations/base_mutation.rb", { skip: true })
  template("mutation_type.erb", "#{options[:directory]}/types/mutation_type.rb", { skip: true })
  insert_root_type('mutation', 'MutationType') 
end