Class: Stardust::GraphQL::Object
- Inherits:
-
GraphQL::Schema::Object
- Object
- GraphQL::Schema::Object
- Stardust::GraphQL::Object
- Defined in:
- lib/stardust/graphql/object.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.field(name, type, description = nil, **kwargs, &block) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/stardust/graphql/object.rb', line 7 def self.field(name, type, description = nil, **kwargs, &block) @__types_to_lookup__ ||= [] @__types_to_lookup__ << ->(klass) { actual_type = Collector.lookup_type(type) klass .method(:field) .super_method .call(name, actual_type, description, **kwargs, &block) } end |
.replace_types! ⇒ Object
20 21 22 23 |
# File 'lib/stardust/graphql/object.rb', line 20 def self.replace_types! return unless @__types_to_lookup__ @__types_to_lookup__.each {|lookup| lookup.(self)} end |
Instance Method Details
#current_user ⇒ Object
25 26 27 |
# File 'lib/stardust/graphql/object.rb', line 25 def current_user context[:current_user] end |