Class: Graphql::Generators::EnumGenerator
- Inherits:
 - 
      TypeGeneratorBase
      
        
- Object
 - Rails::Generators::Base
 - TypeGeneratorBase
 - Graphql::Generators::EnumGenerator
 
 
- Defined in:
 - lib/generators/graphql/enum_generator.rb
 
Overview
Generate an enum type by name, with the given values.
To add a value: option, add another value after a :.
rails g graphql:enum ProgrammingLanguage RUBY PYTHON PERL PERL6:"PERL"
Instance Method Summary collapse
Methods inherited from TypeGeneratorBase
Methods included from Core
#create_dir, #create_mutation_root_type, #insert_root_type, #module_namespacing_when_supported, #schema_file_path
Instance Method Details
#create_type_file ⇒ Object
      22 23 24  | 
    
      # File 'lib/generators/graphql/enum_generator.rb', line 22 def create_type_file template "enum.erb", "#{[:directory]}/types/#{type_file_name}.rb" end  |