Class: GraphqlAddFieldsGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- GraphqlAddFieldsGenerator
- Defined in:
- lib/generators/graphql_add_fields/graphql_add_fields_generator.rb
Constant Summary collapse
- TYPES_MAPPING =
{ 'id' => 'String', 'uuid' => 'String', 'boolean' => 'Boolean', 'float' => 'Float', 'decimal' => 'Float', 'integer' => 'Integer', 'bigint' => 'Integer' }.freeze
Instance Method Summary collapse
Instance Method Details
#create_graphql_files ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/generators/graphql_add_fields/graphql_add_fields_generator.rb', line 20 def create_graphql_files return if args.blank? parse_args # Generate migration generate_migration(@resource, @fields_to_migration) if .migration? complete_graphql_input_type if .graphql_input_type? # # Graphql Type complete_graphql_type(@resource) if .graphql_type? # # Propagation handle_many_to_many_fields(@resource) if .propagation? add_has_many_to_models(@resource) if .propagation? add_has_many_fields_to_types(@resource) if .propagation? # system('bundle exec rails db:migrate') if options.migrate? end |