Sha256: 84fc3a485e462924b243e3f27955b146686d1ed73d61c92757cee753c736c9cd

Contents?: true

Size: 566 Bytes

Versions: 19

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true
require 'rails/generators/named_base'

module Graphql
  module Generators
    # TODO: What other options should be supported?
    #
    # @example Generate a `Relay::Mutation` by name
    #     rails g graphql:mutation CreatePostMutation
    class MutationGenerator < Rails::Generators::NamedBase
      desc "Create a Relay mutation by name"
      source_root File.expand_path('../templates', __FILE__)

      def create_mutation_file
        template "mutation.erb", "app/graphql/mutations/#{file_name}.rb"
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
graphql-1.6.4 lib/generators/graphql/mutation_generator.rb
graphql-1.5.15 lib/generators/graphql/mutation_generator.rb
graphql-1.6.3 lib/generators/graphql/mutation_generator.rb
graphql-1.6.2 lib/generators/graphql/mutation_generator.rb
graphql-1.6.1 lib/generators/graphql/mutation_generator.rb
graphql-1.6.0 lib/generators/graphql/mutation_generator.rb
graphql-1.5.14 lib/generators/graphql/mutation_generator.rb
graphql-1.5.13 lib/generators/graphql/mutation_generator.rb
graphql-1.5.7.1 lib/generators/graphql/mutation_generator.rb
graphql-1.5.12 lib/generators/graphql/mutation_generator.rb
graphql-1.5.11 lib/generators/graphql/mutation_generator.rb
graphql-1.5.10 lib/generators/graphql/mutation_generator.rb
graphql-1.5.9 lib/generators/graphql/mutation_generator.rb
graphql-1.5.8 lib/generators/graphql/mutation_generator.rb
graphql-1.5.7 lib/generators/graphql/mutation_generator.rb
graphql-1.5.6 lib/generators/graphql/mutation_generator.rb
graphql-1.5.5 lib/generators/graphql/mutation_generator.rb
graphql-1.5.4 lib/generators/graphql/mutation_generator.rb
graphql-1.5.3 lib/generators/graphql/mutation_generator.rb