Class: GraphQL::Compatibility::LazyExecutionSpecification::LazySchema::LazyPush
- Inherits:
-
Object
- Object
- GraphQL::Compatibility::LazyExecutionSpecification::LazySchema::LazyPush
- Defined in:
- lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(ctx, value) ⇒ LazyPush
constructor
A new instance of LazyPush.
- #push ⇒ Object
Constructor Details
#initialize(ctx, value) ⇒ LazyPush
Returns a new instance of LazyPush.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb', line 8 def initialize(ctx, value) if value == 13 @value = nil elsif value == 14 @value = GraphQL::ExecutionError.new("oops!") else @value = value end @context = ctx pushes = @context[:lazy_pushes] ||= [] pushes << @value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb', line 7 def value @value end |
Instance Method Details
#push ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb', line 21 def push if @context[:lazy_pushes].include?(@value) @context[:lazy_instrumentation] && @context[:lazy_instrumentation] << "PUSH" @context[:pushes] << @context[:lazy_pushes] @context[:lazy_pushes] = [] end self end |