class Gql::MutationGenerator

Public Instance Methods

mutation() click to toggle source
# File lib/generators/gql/mutation_generator.rb, line 18
def mutation
  file_name = "#{mutation_prefix}_#{singular_name}"
  template('model_mutation.rb', "app/graphql/mutations/#{class_path.join('/')}/#{file_name.underscore}.rb")
  insert_into_file("app/graphql/types/mutation_type.rb", after: "  class MutationType < Types::BaseObject\n") do
    "\t\tfield :#{file_name.camelcase(:lower)}, mutation: Mutations::#{prefixed_class_name(mutation_prefix)}\n"
  end
end
name() click to toggle source

hack to keep NamedBase helpers working

# File lib/generators/gql/mutation_generator.rb, line 14
def name
  model_name
end