Skip to content

Followup - reuse instance of GraphQL client in as many places as possible during Bulk Import

Currently each BulkImport's pipeline that uses BulkImports::Common::Extractors::GraphqlExtractor instantiates new BulkImports::Clients::Graphql client https://gitlab.com/gitlab-org/gitlab/blob/master/lib/bulk_imports/common/extractors/graphql_extractor.rb#L28-27

As stated in https://github.com/ashkan18/graphlient#dynamic-vs-static-queries this has a toll on performance, as every time a new client is initialised it takes some time to initialize and later on re-parse and re-validate every GraphQL that is being used.

If possible we should reuse this client in as many places as possible per bulk import in order to save some time re-parsing and re-validating GraphQL queries.

Edited by George Koltsov