Module: HQ::GraphQL::Ext::InputObjectExtensions::ClassMethods
- Defined in:
- lib/hq/graphql/ext/input_object_extensions.rb
Instance Method Summary collapse
- #nested_attributes ⇒ Object
-
#with_model(model_name, attributes: true, associations: false, enums: true, excluded_inputs: []) ⇒ Object
Class Methods ####.
Instance Method Details
#nested_attributes ⇒ Object
65 66 67 |
# File 'lib/hq/graphql/ext/input_object_extensions.rb', line 65 def nested_attributes @nested_attributes ||= Set.new end |
#with_model(model_name, attributes: true, associations: false, enums: true, excluded_inputs: []) ⇒ Object
Class Methods ####
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/hq/graphql/ext/input_object_extensions.rb', line 44 def with_model(model_name, attributes: true, associations: false, enums: true, excluded_inputs: []) self.model_name = model_name self.auto_load_attributes = attributes self.auto_load_associations = associations self.auto_load_enums = enums lazy_load do excluded_inputs += ::HQ::GraphQL.excluded_inputs model_columns.each do |column| argument_from_column(column) unless excluded_inputs.include?(column.name.to_sym) end model_associations.each do |association| argument_from_association(association) unless excluded_inputs.include?(association.name.to_sym) end argument :X, String, required: false end end |