Module: Graphiti::Resource::Configuration::Overrides
- Defined in:
- lib/graphiti/resource/configuration.rb
Instance Method Summary collapse
-
#adapter=(val) ⇒ Object
The .stat call stores a proc based on adapter So if we assign a new adapter, reconfigure.
- #graphql_entrypoint=(val) ⇒ Object
- #model ⇒ Object
- #polymorphic=(klasses) ⇒ Object
- #polymorphic? ⇒ Boolean
- #remote=(val) ⇒ Object
- #serializer=(val) ⇒ Object
- #type=(val) ⇒ Object
Instance Method Details
#adapter=(val) ⇒ Object
The .stat call stores a proc based on adapter So if we assign a new adapter, reconfigure
115 116 117 118 |
# File 'lib/graphiti/resource/configuration.rb', line 115 def adapter=(val) super stat total: [:count] end |
#graphql_entrypoint=(val) ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/graphiti/resource/configuration.rb', line 105 def graphql_entrypoint=(val) if val super(val.to_s.camelize(:lower).to_sym) else super end end |
#model ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/graphiti/resource/configuration.rb', line 132 def model klass = super unless klass || abstract_class? if (klass = infer_model) self.model = klass else raise Errors::ModelNotFound.new(self) end end klass end |
#polymorphic=(klasses) ⇒ Object
89 90 91 92 |
# File 'lib/graphiti/resource/configuration.rb', line 89 def polymorphic=(klasses) super send(:prepend, Polymorphism) end |
#polymorphic? ⇒ Boolean
94 95 96 |
# File 'lib/graphiti/resource/configuration.rb', line 94 def polymorphic? polymorphic.present? end |
#remote=(val) ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/graphiti/resource/configuration.rb', line 120 def remote=(val) super include ::Graphiti::Resource::Remote self.endpoint = { path: val, full_path: val, url: val, actions: [:index, :show] } end |
#serializer=(val) ⇒ Object
79 80 81 82 83 84 85 86 87 |
# File 'lib/graphiti/resource/configuration.rb', line 79 def serializer=(val) if val if super(Class.new(val)) apply_attributes_to_serializer end else super end end |
#type=(val) ⇒ Object
98 99 100 101 102 103 |
# File 'lib/graphiti/resource/configuration.rb', line 98 def type=(val) val = val&.to_sym if (val = super) serializer.type(val) end end |