1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.batchDelegateToSchema = void 0;
|
4 | const getLoader_js_1 = require("./getLoader.js");
|
5 | function batchDelegateToSchema(options) {
|
6 | const key = options.key;
|
7 | if (key == null) {
|
8 | return null;
|
9 | }
|
10 | else if (Array.isArray(key) && !key.length) {
|
11 | return [];
|
12 | }
|
13 | const loader = (0, getLoader_js_1.getLoader)(options);
|
14 | return Array.isArray(key) ? loader.loadMany(key) : loader.load(key);
|
15 | }
|
16 | exports.batchDelegateToSchema = batchDelegateToSchema;
|