Class: Rails::GraphQL::Helpers::WithSchemaFields::ScopedConfig
- Inherits:
-
Struct
- Object
- Struct
- Rails::GraphQL::Helpers::WithSchemaFields::ScopedConfig
- Defined in:
- lib/rails/graphql/helpers/with_schema_fields.rb
Overview
Helper class to be used as the self
in configuration blocks
Instance Attribute Summary collapse
-
#source ⇒ Object
Returns the value of attribute source.
-
#type ⇒ Object
(also: #kind)
Returns the value of attribute type.
Instance Method Summary collapse
- #argument(*args, **xargs, &block) ⇒ Object (also: #arg)
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, **xargs, &block) ⇒ Object (private)
45 46 47 48 49 |
# File 'lib/rails/graphql/helpers/with_schema_fields.rb', line 45 def method_missing(method_name, *args, **xargs, &block) schema_method = schema_methods[method_name] args.unshift(type) unless schema_method.nil? source.send(schema_method || method_name, *args, **xargs, &block) end |
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source
29 30 31 |
# File 'lib/rails/graphql/helpers/with_schema_fields.rb', line 29 def source @source end |
#type ⇒ Object Also known as: kind
Returns the value of attribute type
29 30 31 |
# File 'lib/rails/graphql/helpers/with_schema_fields.rb', line 29 def type @type end |
Instance Method Details
#argument(*args, **xargs, &block) ⇒ Object Also known as: arg
30 31 32 33 |
# File 'lib/rails/graphql/helpers/with_schema_fields.rb', line 30 def argument(*args, **xargs, &block) xargs[:owner] ||= source GraphQL::Argument.new(*args, **xargs, &block) end |