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 'spec/contracts/consumer/helpers/graphql_query_extractor.js')
-rw-r--r--spec/contracts/consumer/helpers/graphql_query_extractor.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/contracts/consumer/helpers/graphql_query_extractor.js b/spec/contracts/consumer/helpers/graphql_query_extractor.js
new file mode 100644
index 00000000000..884fa2cf528
--- /dev/null
+++ b/spec/contracts/consumer/helpers/graphql_query_extractor.js
@@ -0,0 +1,8 @@
+import { readFile } from 'fs/promises';
+import path from 'path';
+
+export async function extractGraphQLQuery(fileLocation) {
+ const file = path.resolve(__dirname, '..', '..', '..', '..', fileLocation);
+
+ return readFile(file, { encoding: 'UTF-8' });
+}