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, #insert_root_type, #module_namespacing_when_supported, #schema_file_path

Instance Method Details

#create_loader_fileObject



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

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