debian-mirror-gitlab/lib/gitlab/graphql/lazy.rb
2020-08-09 17:44:08 +05:30

19 lines
367 B
Ruby

# frozen_string_literal: true
module Gitlab
module Graphql
class Lazy
# Force evaluation of a (possibly) lazy value
def self.force(value)
case value
when ::BatchLoader::GraphQL
value.sync
when ::Concurrent::Promise
value.execute.value
else
value
end
end
end
end
end