Class: Graphql::Generators::LoaderGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
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

Instance Method Details

#create_loader_fileObject



12
13
14
# File 'lib/generators/graphql/loader_generator.rb', line 12

def create_loader_file
  template "loader.erb", "app/graphql/loaders/#{file_name}.rb"
end