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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bulk_imports/common/extractors/graphql_extractor.rb')
-rw-r--r--lib/bulk_imports/common/extractors/graphql_extractor.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/bulk_imports/common/extractors/graphql_extractor.rb b/lib/bulk_imports/common/extractors/graphql_extractor.rb
index cde3d1cad5b..bfdc0b13603 100644
--- a/lib/bulk_imports/common/extractors/graphql_extractor.rb
+++ b/lib/bulk_imports/common/extractors/graphql_extractor.rb
@@ -5,15 +5,16 @@ module BulkImports
module Extractors
class GraphqlExtractor
def initialize(options = {})
- @query = options[:query]
+ @query_klass = options[:query]
end
def extract(context)
client = graphql_client(context)
+ query = query_klass.new(context: context)
response = client.execute(
client.parse(query.to_s),
- query.variables(context)
+ query.variables
).original_hash.deep_dup
BulkImports::Pipeline::ExtractedData.new(
@@ -24,7 +25,7 @@ module BulkImports
private
- attr_reader :query
+ attr_reader :query_klass
def graphql_client(context)
@graphql_client ||= BulkImports::Clients::Graphql.new(