Class: GraphqlMutationsGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- GraphqlMutationsGenerator
- Defined in:
- lib/generators/graphql_mutations/graphql_mutations_generator.rb
Instance Method Summary collapse
Instance Method Details
#generate ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/generators/graphql_mutations/graphql_mutations_generator.rb', line 2 def generate resource = file_name.underscore.singularize dir = "app/graphql/#{resource.pluralize}/mutations" FileUtils.mkdir_p(dir) unless File.directory?(dir) generate_create_mutation(dir, resource) generate_update_mutation(dir, resource) generate_destroy_mutation(dir, resource) end |