Welcome to mirror list, hosted at ThFree Co, Russian Federation.

graphql_known_operations.rb « webpack « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7945513667c4329c55aebdccce71cee39c82c006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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