1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.optimizeOperations = void 0;
|
4 | const relay_operation_optimizer_1 = require("@graphql-tools/relay-operation-optimizer");
|
5 | function optimizeOperations(schema, documents, options) {
|
6 | const newDocuments = (0, relay_operation_optimizer_1.optimizeDocuments)(schema, documents.map(s => s.document), options);
|
7 | return newDocuments.map((document, index) => {
|
8 | var _a;
|
9 | return ({
|
10 | location: ((_a = documents[index]) === null || _a === void 0 ? void 0 : _a.location) || 'optimized by relay',
|
11 | document,
|
12 | });
|
13 | });
|
14 | }
|
15 | exports.optimizeOperations = optimizeOperations;
|