1 | "use strict";
|
2 | var __assign = (this && this.__assign) || Object.assign || function(t) {
|
3 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4 | s = arguments[i];
|
5 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6 | t[p] = s[p];
|
7 | }
|
8 | return t;
|
9 | };
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | var prepare_documents_only_1 = require("./prepare-documents-only");
|
12 | var graphql_codegen_core_1 = require("graphql-codegen-core");
|
13 | var moment = require("moment");
|
14 | function generateSingleFile(compiledIndexTemplate, executionSettings, config, templateContext, documents) {
|
15 | graphql_codegen_core_1.debugLog("[generateSingleFile] Compiling single file to: " + config.outFile);
|
16 | return [
|
17 | {
|
18 | filename: config.outFile,
|
19 | content: compiledIndexTemplate(__assign({ config: config.config, primitivesMap: config.primitives, currentTime: moment().format() }, (!executionSettings.generateSchema ? prepare_documents_only_1.prepareSchemaForDocumentsOnly(templateContext) : templateContext), { operations: documents.operations, fragments: documents.fragments, hasFragments: documents.hasFragments, hasOperations: documents.hasOperations }))
|
20 | }
|
21 | ];
|
22 | }
|
23 | exports.generateSingleFile = generateSingleFile;
|
24 |
|
\ | No newline at end of file |