Class: Graphql::Generators::LoaderGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Core
Defined in:
lib/generators/graphql/loader_generator.rb

Overview

Examples:

Generate a GraphQL::Batch loader by name.

rails g graphql:loader RecordLoader

Instance Method Summary collapse

Methods included from Core

#create_dir, #create_mutation_root_type, #insert_root_type, #schema_file_path

Instance Method Details

#create_loader_fileObject



15
16
17
# File 'lib/generators/graphql/loader_generator.rb', line 15

def create_loader_file
  template "loader.erb", "#{options[:directory]}/loaders/#{file_path}.rb"
end