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

startupjs_helper.rb « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: da95cfe03ee5c75696643d3966cca319fa976b9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module StartupjsHelper
  def page_startup_graphql_calls
    @graphql_startup_calls
  end

  def add_page_startup_graphql_call(query, variables = {})
    @graphql_startup_calls ||= []
    query_str = File.read(File.join(Rails.root, "app/assets/javascripts/#{query}.query.graphql"))
    @graphql_startup_calls << { query: query_str, variables: variables }
  end
end