class Graphql::Generators::EnumGenerator

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” “`

Private Instance Methods

graphql_type() click to toggle source
# File lib/generators/graphql/enum_generator.rb, line 18
def graphql_type
  "enum"
end
prepared_values() click to toggle source
# File lib/generators/graphql/enum_generator.rb, line 22
def prepared_values
  custom_fields.map { |v| v.split(":", 2) }
end