class GraphQL::Compatibility::LazyExecutionSpecification::LazySchema::LazyPush

def initialize(ctx, value)

def initialize(ctx, value)
  if value == 13
    @value = nil
  elsif value == 14
    @value = GraphQL::ExecutionError.new("oops!")
  elsif value == 15
    @skipped = true
    @value = ctx.skip
  else
    @value = value
  end
  @context = ctx
  pushes = @context[:lazy_pushes] ||= []
  if !@skipped
    pushes << @value
  end
end

def push

def push
  if @skipped
    @value
  else
    if @context[:lazy_pushes].include?(@value)
      @context[:lazy_instrumentation] && @context[:lazy_instrumentation] << "PUSH"
      @context[:pushes] << @context[:lazy_pushes]
      @context[:lazy_pushes] = []
    end
    # Something that _behaves_ like this object, but isn't registered lazy
    OpenStruct.new(value: @value)
  end
end