Class: Graphql::Rails::Api::Config
- Inherits:
-
Object
- Object
- Graphql::Rails::Api::Config
- Includes:
- Singleton
- Defined in:
- lib/graphql/rails/api/config.rb
Instance Attribute Summary collapse
-
#basic_mutations ⇒ Object
Returns the value of attribute basic_mutations.
-
#id_type ⇒ Object
Returns the value of attribute id_type.
Class Method Summary collapse
Instance Attribute Details
#basic_mutations ⇒ Object
Returns the value of attribute basic_mutations.
7 8 9 |
# File 'lib/graphql/rails/api/config.rb', line 7 def basic_mutations @basic_mutations end |
#id_type ⇒ Object
Returns the value of attribute id_type.
7 8 9 |
# File 'lib/graphql/rails/api/config.rb', line 7 def id_type @id_type end |
Class Method Details
.mutation_resources ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/graphql/rails/api/config.rb', line 15 def self.mutation_resources mutations = Dir.glob("#{File.expand_path('.')}/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("#{File.expand_path('.')}/app/graphql/*/mutations/#{meth}.rb").map do |dir| dir.split('/').last(3).first end end end |
.query_resources ⇒ Object
9 10 11 12 13 |
# File 'lib/graphql/rails/api/config.rb', line 9 def self.query_resources Dir.glob("#{File.expand_path('.')}/app/graphql/*/type.rb").map do |dir| dir.split('/').last(2).first end end |