Class: Graphql::Rails::Api::Config
- Inherits:
-
Object
- Object
- Graphql::Rails::Api::Config
- Includes:
- Singleton
- Defined in:
- lib/graphql/rails/api/config.rb
Class Method Summary collapse
Class Method Details
.mutation_resources ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/graphql/rails/api/config.rb', line 14 def self.mutation_resources mutations = Dir.glob("#{::Rails.root}/app/graphql/*/mutations/*.rb").reject do |e| e.end_with?('type.rb', 'types.rb') end mutations = mutations.map { |e| e.split('/').last.gsub('.rb', '') }.uniq mutations.each_with_object({}) do |meth, h| h[meth] = Dir.glob("#{::Rails.root}/app/graphql/*/mutations/#{meth}.rb").map do |dir| dir.split('/').last(3).first end end end |
.query_resources ⇒ Object
8 9 10 11 12 |
# File 'lib/graphql/rails/api/config.rb', line 8 def self.query_resources Dir.glob("#{::Rails.root}/app/graphql/*/type.rb").map do |dir| dir.split('/').last(2).first end end |