Sha256: c4eb9b3eb676788378339e68dbb26c4db03de810314367f0fdace4b55c1f9d48

Contents?: true

Size: 768 Bytes

Versions: 6

Compression:

Stored size: 768 Bytes

Contents

module Graphql
  class SugarGenerator < Rails::Generators::Base
    source_root File.expand_path('../templates', __FILE__)

    def add_paths
      application { 'config.eager_load_paths += Dir["#{config.root}/app/graphql/functions/**/"]' }
      application { 'config.eager_load_paths += Dir["#{config.root}/app/graphql/mutators/**/"]' }
      application { 'config.eager_load_paths += Dir["#{config.root}/app/graphql/resolvers/**/"]' }
    end

    def create_application_files
      template 'application_function.erb', 'app/graphql/functions/application_function.rb'
      template 'application_resolver.erb', 'app/graphql/resolvers/application_resolver.rb'
      template 'application_mutator.erb', 'app/graphql/mutators/application_mutator.rb'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
graphql-sugar-0.1.6 lib/generators/graphql/sugar/sugar_generator.rb
graphql-sugar-0.1.5 lib/generators/graphql/sugar/sugar_generator.rb
graphql-sugar-0.1.4 lib/generators/graphql/sugar/sugar_generator.rb
graphql-sugar-0.1.3 lib/generators/graphql/sugar/sugar_generator.rb
graphql-sugar-0.1.2 lib/generators/graphql/sugar/sugar_generator.rb
graphql-sugar-0.1.1 lib/generators/graphql/sugar/sugar_generator.rb