debian-mirror-gitlab/lib/gitlab/webpack/graphql_known_operations.rb

26 lines
552 B
Ruby
Raw Normal View History

2021-12-11 22:18:48 +05:30
# frozen_string_literal: true
module Gitlab
module Webpack
class GraphqlKnownOperations
class << self
include Gitlab::Utils::StrongMemoize
def clear_memoization!
clear_memoization(:graphql_known_operations)
end
def load
strong_memoize(:graphql_known_operations) do
data = ::Gitlab::Webpack::FileLoader.load("graphql_known_operations.yml")
YAML.safe_load(data)
rescue StandardError
[]
end
end
end
end
end
end