@settlemint/sdk-mcp 2.6.1 → 2.6.2-main05babdc6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp.js +448 -413
- package/dist/mcp.js.map +9 -10
- package/package.json +5 -5
package/dist/mcp.js
CHANGED
|
@@ -48436,7 +48436,7 @@ var coerce = {
|
|
|
48436
48436
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
48437
48437
|
};
|
|
48438
48438
|
var NEVER = INVALID;
|
|
48439
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.
|
|
48439
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.5/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
48440
48440
|
var LATEST_PROTOCOL_VERSION = "2025-06-18";
|
|
48441
48441
|
var SUPPORTED_PROTOCOL_VERSIONS = [
|
|
48442
48442
|
LATEST_PROTOCOL_VERSION,
|
|
@@ -48986,7 +48986,7 @@ class McpError extends Error {
|
|
|
48986
48986
|
}
|
|
48987
48987
|
}
|
|
48988
48988
|
|
|
48989
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.
|
|
48989
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.5/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
48990
48990
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
48991
48991
|
|
|
48992
48992
|
class Protocol {
|
|
@@ -49326,7 +49326,7 @@ function mergeCapabilities(base, additional) {
|
|
|
49326
49326
|
}, { ...base });
|
|
49327
49327
|
}
|
|
49328
49328
|
|
|
49329
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.
|
|
49329
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
49330
49330
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
49331
49331
|
|
|
49332
49332
|
class Server extends Protocol {
|
|
@@ -49334,6 +49334,12 @@ class Server extends Protocol {
|
|
|
49334
49334
|
var _a;
|
|
49335
49335
|
super(options);
|
|
49336
49336
|
this._serverInfo = _serverInfo;
|
|
49337
|
+
this._loggingLevels = new Map;
|
|
49338
|
+
this.LOG_LEVEL_SEVERITY = new Map(LoggingLevelSchema.options.map((level, index) => [level, index]));
|
|
49339
|
+
this.isMessageIgnored = (level, sessionId) => {
|
|
49340
|
+
const currentLevel = this._loggingLevels.get(sessionId);
|
|
49341
|
+
return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
|
|
49342
|
+
};
|
|
49337
49343
|
this._capabilities = (_a = options === null || options === undefined ? undefined : options.capabilities) !== null && _a !== undefined ? _a : {};
|
|
49338
49344
|
this._instructions = options === null || options === undefined ? undefined : options.instructions;
|
|
49339
49345
|
this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request));
|
|
@@ -49341,6 +49347,18 @@ class Server extends Protocol {
|
|
|
49341
49347
|
var _a2;
|
|
49342
49348
|
return (_a2 = this.oninitialized) === null || _a2 === undefined ? undefined : _a2.call(this);
|
|
49343
49349
|
});
|
|
49350
|
+
if (this._capabilities.logging) {
|
|
49351
|
+
this.setRequestHandler(SetLevelRequestSchema, async (request, extra) => {
|
|
49352
|
+
var _a2;
|
|
49353
|
+
const transportSessionId = extra.sessionId || ((_a2 = extra.requestInfo) === null || _a2 === undefined ? undefined : _a2.headers["mcp-session-id"]) || undefined;
|
|
49354
|
+
const { level } = request.params;
|
|
49355
|
+
const parseResult = LoggingLevelSchema.safeParse(level);
|
|
49356
|
+
if (transportSessionId && parseResult.success) {
|
|
49357
|
+
this._loggingLevels.set(transportSessionId, parseResult.data);
|
|
49358
|
+
}
|
|
49359
|
+
return {};
|
|
49360
|
+
});
|
|
49361
|
+
}
|
|
49344
49362
|
}
|
|
49345
49363
|
registerCapabilities(capabilities) {
|
|
49346
49364
|
if (this.transport) {
|
|
@@ -49484,8 +49502,12 @@ class Server extends Protocol {
|
|
|
49484
49502
|
async listRoots(params, options) {
|
|
49485
49503
|
return this.request({ method: "roots/list", params }, ListRootsResultSchema, options);
|
|
49486
49504
|
}
|
|
49487
|
-
async sendLoggingMessage(params) {
|
|
49488
|
-
|
|
49505
|
+
async sendLoggingMessage(params, sessionId) {
|
|
49506
|
+
if (this._capabilities.logging) {
|
|
49507
|
+
if (!sessionId || !this.isMessageIgnored(params.level, sessionId)) {
|
|
49508
|
+
return this.notification({ method: "notifications/message", params });
|
|
49509
|
+
}
|
|
49510
|
+
}
|
|
49489
49511
|
}
|
|
49490
49512
|
async sendResourceUpdated(params) {
|
|
49491
49513
|
return this.notification({
|
|
@@ -50742,7 +50764,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
50742
50764
|
}
|
|
50743
50765
|
return combined;
|
|
50744
50766
|
};
|
|
50745
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.
|
|
50767
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
50746
50768
|
var McpZodTypeKind;
|
|
50747
50769
|
(function(McpZodTypeKind2) {
|
|
50748
50770
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
@@ -50795,7 +50817,7 @@ function processCreateParams2(params) {
|
|
|
50795
50817
|
return { errorMap: customMap, description };
|
|
50796
50818
|
}
|
|
50797
50819
|
|
|
50798
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.
|
|
50820
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
50799
50821
|
class McpServer {
|
|
50800
50822
|
constructor(serverInfo, options) {
|
|
50801
50823
|
this._registeredResources = {};
|
|
@@ -51300,6 +51322,9 @@ class McpServer {
|
|
|
51300
51322
|
isConnected() {
|
|
51301
51323
|
return this.server.transport !== undefined;
|
|
51302
51324
|
}
|
|
51325
|
+
async sendLoggingMessage(params, sessionId) {
|
|
51326
|
+
return this.server.sendLoggingMessage(params, sessionId);
|
|
51327
|
+
}
|
|
51303
51328
|
sendResourceListChanged() {
|
|
51304
51329
|
if (this.isConnected()) {
|
|
51305
51330
|
this.server.sendResourceListChanged();
|
|
@@ -51352,10 +51377,10 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
51352
51377
|
}
|
|
51353
51378
|
};
|
|
51354
51379
|
|
|
51355
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.
|
|
51380
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
51356
51381
|
import process2 from "node:process";
|
|
51357
51382
|
|
|
51358
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.
|
|
51383
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.5/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
|
|
51359
51384
|
class ReadBuffer {
|
|
51360
51385
|
append(chunk) {
|
|
51361
51386
|
this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
|
|
@@ -51385,7 +51410,7 @@ function serializeMessage(message) {
|
|
|
51385
51410
|
`;
|
|
51386
51411
|
}
|
|
51387
51412
|
|
|
51388
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.
|
|
51413
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.17.5/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
51389
51414
|
class StdioServerTransport {
|
|
51390
51415
|
constructor(_stdin = process2.stdin, _stdout = process2.stdout) {
|
|
51391
51416
|
this._stdin = _stdin;
|
|
@@ -74095,8 +74120,8 @@ function collectSchemaParts(sources) {
|
|
|
74095
74120
|
};
|
|
74096
74121
|
}
|
|
74097
74122
|
|
|
74098
|
-
// ../../node_modules/.bun/@graphql-tools+url-loader@
|
|
74099
|
-
var
|
|
74123
|
+
// ../../node_modules/.bun/@graphql-tools+url-loader@9.0.0+ded46c799560c44e/node_modules/@graphql-tools/url-loader/esm/index.js
|
|
74124
|
+
var import_graphql54 = __toESM(require_graphql2(), 1);
|
|
74100
74125
|
var import_isomorphic_ws3 = __toESM(require_ws(), 1);
|
|
74101
74126
|
// ../../node_modules/.bun/@envelop+core@5.3.0/node_modules/@envelop/core/esm/document-string-map.js
|
|
74102
74127
|
var documentStringMap = new WeakMap;
|
|
@@ -74108,7 +74133,7 @@ function getDocumentString(document, print5) {
|
|
|
74108
74133
|
}
|
|
74109
74134
|
return documentSource;
|
|
74110
74135
|
}
|
|
74111
|
-
// ../../node_modules/.bun/@graphql-tools+executor-common@0.0
|
|
74136
|
+
// ../../node_modules/.bun/@graphql-tools+executor-common@1.0.0+ded46c799560c44e/node_modules/@graphql-tools/executor-common/dist/index.js
|
|
74112
74137
|
var import_graphql45 = __toESM(require_graphql2(), 1);
|
|
74113
74138
|
var defaultPrintFn = memoize1(function defaultPrintFn2(document) {
|
|
74114
74139
|
return import_graphql45.stripIgnoredCharacters(getDocumentString(document, import_graphql45.print));
|
|
@@ -74697,7 +74722,7 @@ function isFatalInternalCloseCode(code) {
|
|
|
74697
74722
|
function isWebSocket(val) {
|
|
74698
74723
|
return typeof val === "function" && "constructor" in val && "CLOSED" in val && "CLOSING" in val && "CONNECTING" in val && "OPEN" in val;
|
|
74699
74724
|
}
|
|
74700
|
-
// ../../node_modules/.bun/@graphql-tools+executor-graphql-ws@
|
|
74725
|
+
// ../../node_modules/.bun/@graphql-tools+executor-graphql-ws@3.0.0+ded46c799560c44e/node_modules/@graphql-tools/executor-graphql-ws/dist/index.js
|
|
74701
74726
|
var import_isomorphic_ws = __toESM(require_ws(), 1);
|
|
74702
74727
|
function isClient(client) {
|
|
74703
74728
|
return "subscribe" in client;
|
|
@@ -74762,7 +74787,7 @@ function buildGraphQLWSExecutor(clientOptionsOrClient) {
|
|
|
74762
74787
|
return executor2;
|
|
74763
74788
|
}
|
|
74764
74789
|
|
|
74765
|
-
// ../../node_modules/.bun/@graphql-hive+signal@
|
|
74790
|
+
// ../../node_modules/.bun/@graphql-hive+signal@2.0.0/node_modules/@graphql-hive/signal/dist/index.js
|
|
74766
74791
|
var isNode = !globalThis.Bun && globalThis.process?.release?.name === "node";
|
|
74767
74792
|
var anySignalRegistry = isNode ? new FinalizationRegistry((cb) => cb()) : null;
|
|
74768
74793
|
var controllerInSignalSy = Symbol("CONTROLLER_IN_SIGNAL");
|
|
@@ -74814,24 +74839,6 @@ function abortSignalAny(signals) {
|
|
|
74814
74839
|
return ctrl.signal;
|
|
74815
74840
|
}
|
|
74816
74841
|
|
|
74817
|
-
// ../../node_modules/.bun/@graphql-tools+executor-common@0.0.4+ded46c799560c44e/node_modules/@graphql-tools/executor-common/dist/index.js
|
|
74818
|
-
var import_graphql46 = __toESM(require_graphql2(), 1);
|
|
74819
|
-
var defaultPrintFn3 = memoize1(function defaultPrintFn22(document) {
|
|
74820
|
-
return import_graphql46.stripIgnoredCharacters(getDocumentString(document, import_graphql46.print));
|
|
74821
|
-
});
|
|
74822
|
-
function serializeExecutionRequest2({
|
|
74823
|
-
executionRequest,
|
|
74824
|
-
excludeQuery,
|
|
74825
|
-
printFn = defaultPrintFn3
|
|
74826
|
-
}) {
|
|
74827
|
-
return {
|
|
74828
|
-
query: excludeQuery ? undefined : printFn(executionRequest.document),
|
|
74829
|
-
variables: (executionRequest.variables && Object.keys(executionRequest.variables).length) > 0 ? executionRequest.variables : undefined,
|
|
74830
|
-
operationName: executionRequest.operationName ? executionRequest.operationName : undefined,
|
|
74831
|
-
extensions: executionRequest.extensions && Object.keys(executionRequest.extensions).length > 0 ? executionRequest.extensions : undefined
|
|
74832
|
-
};
|
|
74833
|
-
}
|
|
74834
|
-
|
|
74835
74842
|
// ../../node_modules/.bun/@whatwg-node+fetch@0.10.10/node_modules/@whatwg-node/fetch/dist/node-ponyfill.js
|
|
74836
74843
|
var createNodePonyfill = require_create_node_ponyfill();
|
|
74837
74844
|
var shouldSkipPonyfill = require_shouldSkipPonyfill();
|
|
@@ -75919,8 +75926,8 @@ function latest(contenders) {
|
|
|
75919
75926
|
});
|
|
75920
75927
|
}
|
|
75921
75928
|
|
|
75922
|
-
// ../../node_modules/.bun/@graphql-tools+executor-http@
|
|
75923
|
-
var
|
|
75929
|
+
// ../../node_modules/.bun/@graphql-tools+executor-http@3.0.0+ded46c799560c44e/node_modules/@graphql-tools/executor-http/dist/index.js
|
|
75930
|
+
var import_graphql46 = __toESM(require_graphql2(), 1);
|
|
75924
75931
|
|
|
75925
75932
|
// ../../node_modules/.bun/meros@1.3.1/node_modules/meros/browser/index.mjs
|
|
75926
75933
|
async function e(e2, t) {
|
|
@@ -76015,7 +76022,7 @@ async function e2(e3, t) {
|
|
|
76015
76022
|
}(e3, `--${i}`, t);
|
|
76016
76023
|
}
|
|
76017
76024
|
|
|
76018
|
-
// ../../node_modules/.bun/@graphql-tools+executor-http@
|
|
76025
|
+
// ../../node_modules/.bun/@graphql-tools+executor-http@3.0.0+ded46c799560c44e/node_modules/@graphql-tools/executor-http/dist/index.js
|
|
76019
76026
|
function isPlainObject2(value) {
|
|
76020
76027
|
if (typeof value !== "object" || value === null) {
|
|
76021
76028
|
return false;
|
|
@@ -76161,7 +76168,7 @@ function isBlob(obj) {
|
|
|
76161
76168
|
return typeof obj.arrayBuffer === "function";
|
|
76162
76169
|
}
|
|
76163
76170
|
function createGraphQLErrorForAbort(reason, extensions) {
|
|
76164
|
-
if (reason instanceof
|
|
76171
|
+
if (reason instanceof import_graphql46.GraphQLError) {
|
|
76165
76172
|
return reason;
|
|
76166
76173
|
}
|
|
76167
76174
|
if (reason?.name === "TimeoutError") {
|
|
@@ -76212,7 +76219,8 @@ function handleEventStreamResponse(response, subscriptionCtrl, signal) {
|
|
|
76212
76219
|
return new Repeater((push2, stop2) => {
|
|
76213
76220
|
const decoder = new $TextDecoder;
|
|
76214
76221
|
const reader = body.getReader();
|
|
76215
|
-
|
|
76222
|
+
let closed = false;
|
|
76223
|
+
reader.closed.then(() => closed = true).catch((reason) => closed = reason);
|
|
76216
76224
|
stop2.then(() => {
|
|
76217
76225
|
subscriptionCtrl?.abort();
|
|
76218
76226
|
if (body.locked) {
|
|
@@ -76230,7 +76238,24 @@ function handleEventStreamResponse(response, subscriptionCtrl, signal) {
|
|
|
76230
76238
|
if (!body?.locked) {
|
|
76231
76239
|
return stop2();
|
|
76232
76240
|
}
|
|
76233
|
-
|
|
76241
|
+
let done, chunk;
|
|
76242
|
+
try {
|
|
76243
|
+
const result = await reader.read();
|
|
76244
|
+
done = result.done;
|
|
76245
|
+
chunk = result.value;
|
|
76246
|
+
} catch (err) {
|
|
76247
|
+
if (signal?.aborted) {
|
|
76248
|
+
await push2(createResultForAbort(signal.reason));
|
|
76249
|
+
return stop2();
|
|
76250
|
+
}
|
|
76251
|
+
const errErr = err instanceof Error ? err : new Error(String(err));
|
|
76252
|
+
await push2({
|
|
76253
|
+
errors: [
|
|
76254
|
+
createGraphQLError(errErr.message, { originalError: errErr })
|
|
76255
|
+
]
|
|
76256
|
+
});
|
|
76257
|
+
return stop2();
|
|
76258
|
+
}
|
|
76234
76259
|
if (done) {
|
|
76235
76260
|
return stop2();
|
|
76236
76261
|
}
|
|
@@ -76247,11 +76272,15 @@ function handleEventStreamResponse(response, subscriptionCtrl, signal) {
|
|
|
76247
76272
|
const data = JSON.parse(dataStr);
|
|
76248
76273
|
await push2(data.payload || data);
|
|
76249
76274
|
}
|
|
76250
|
-
const event = msg.split("event:")[1]?.trim()
|
|
76275
|
+
const event = msg.split("event:")[1]?.trim().split(`
|
|
76276
|
+
`)[0]?.trim();
|
|
76251
76277
|
if (event === "complete") {
|
|
76252
76278
|
return stop2();
|
|
76253
76279
|
}
|
|
76254
76280
|
}
|
|
76281
|
+
if (closed) {
|
|
76282
|
+
return stop2();
|
|
76283
|
+
}
|
|
76255
76284
|
return pump();
|
|
76256
76285
|
}
|
|
76257
76286
|
return pump();
|
|
@@ -76319,10 +76348,10 @@ function prepareGETUrl({
|
|
|
76319
76348
|
const finalUrl = urlObj.toString().replace(dummyHostname, "");
|
|
76320
76349
|
return finalUrl;
|
|
76321
76350
|
}
|
|
76351
|
+
var inflightRequests = /* @__PURE__ */ new Map;
|
|
76322
76352
|
function buildHTTPExecutor(options) {
|
|
76323
|
-
const printFn = options?.print ??
|
|
76353
|
+
const printFn = options?.print ?? defaultPrintFn;
|
|
76324
76354
|
let disposeCtrl;
|
|
76325
|
-
const serviceName = options?.serviceName;
|
|
76326
76355
|
const baseExecutor = (request, excludeQuery) => {
|
|
76327
76356
|
disposeCtrl ||= new AbortController;
|
|
76328
76357
|
if (disposeCtrl.signal.aborted) {
|
|
@@ -76344,12 +76373,34 @@ function buildHTTPExecutor(options) {
|
|
|
76344
76373
|
} else {
|
|
76345
76374
|
method ||= "POST";
|
|
76346
76375
|
}
|
|
76347
|
-
|
|
76376
|
+
let endpoint;
|
|
76377
|
+
if (request.extensions?.endpoint) {
|
|
76378
|
+
if (typeof request.extensions.endpoint === "string") {
|
|
76379
|
+
endpoint = request.extensions.endpoint;
|
|
76380
|
+
}
|
|
76381
|
+
if (typeof request.extensions.endpoint === "function") {
|
|
76382
|
+
endpoint = request.extensions.endpoint(request);
|
|
76383
|
+
}
|
|
76384
|
+
}
|
|
76385
|
+
if (!endpoint) {
|
|
76386
|
+
if (typeof options?.endpoint === "string") {
|
|
76387
|
+
endpoint = options.endpoint;
|
|
76388
|
+
}
|
|
76389
|
+
if (typeof options?.endpoint === "function") {
|
|
76390
|
+
endpoint = options.endpoint(request);
|
|
76391
|
+
}
|
|
76392
|
+
}
|
|
76393
|
+
if (!endpoint) {
|
|
76394
|
+
endpoint = "/graphql";
|
|
76395
|
+
}
|
|
76396
|
+
let isCustomHeader = false;
|
|
76348
76397
|
const headers = { accept };
|
|
76349
76398
|
if (options?.headers) {
|
|
76399
|
+
isCustomHeader = true;
|
|
76350
76400
|
Object.assign(headers, typeof options?.headers === "function" ? options.headers(request) : options?.headers);
|
|
76351
76401
|
}
|
|
76352
76402
|
if (request.extensions?.headers) {
|
|
76403
|
+
isCustomHeader = true;
|
|
76353
76404
|
const { headers: headersFromExtensions, ...restExtensions } = request.extensions;
|
|
76354
76405
|
Object.assign(headers, headersFromExtensions);
|
|
76355
76406
|
request.extensions = restExtensions;
|
|
@@ -76370,15 +76421,13 @@ function buildHTTPExecutor(options) {
|
|
|
76370
76421
|
}
|
|
76371
76422
|
const signal = abortSignalAny(signals);
|
|
76372
76423
|
const upstreamErrorExtensions = {
|
|
76373
|
-
code: "DOWNSTREAM_SERVICE_ERROR",
|
|
76374
|
-
serviceName,
|
|
76375
76424
|
request: {
|
|
76376
76425
|
method
|
|
76377
76426
|
}
|
|
76378
76427
|
};
|
|
76379
76428
|
const query = printFn(request.document);
|
|
76380
76429
|
let serializeFn = function serialize() {
|
|
76381
|
-
return
|
|
76430
|
+
return serializeExecutionRequest({
|
|
76382
76431
|
executionRequest: request,
|
|
76383
76432
|
excludeQuery,
|
|
76384
76433
|
printFn
|
|
@@ -76392,7 +76441,7 @@ function buildHTTPExecutor(options) {
|
|
|
76392
76441
|
version: 1,
|
|
76393
76442
|
sha256Hash
|
|
76394
76443
|
};
|
|
76395
|
-
return
|
|
76444
|
+
return serializeExecutionRequest({
|
|
76396
76445
|
executionRequest: {
|
|
76397
76446
|
...request,
|
|
76398
76447
|
extensions
|
|
@@ -76423,23 +76472,129 @@ function buildHTTPExecutor(options) {
|
|
|
76423
76472
|
]
|
|
76424
76473
|
};
|
|
76425
76474
|
}
|
|
76426
|
-
|
|
76475
|
+
function handleInflightRequest(inflightRequestOptions, context, info) {
|
|
76476
|
+
if (options?.deduplicateInflightRequests === false) {
|
|
76477
|
+
return runInflightRequest();
|
|
76478
|
+
}
|
|
76479
|
+
function runInflightRequest() {
|
|
76480
|
+
return handleMaybePromise(() => fetchFn(inflightRequestOptions.url, {
|
|
76481
|
+
method: inflightRequestOptions.method,
|
|
76482
|
+
headers: inflightRequestOptions.headers,
|
|
76483
|
+
body: inflightRequestOptions.body,
|
|
76484
|
+
credentials: inflightRequestOptions.credentials,
|
|
76485
|
+
signal: inflightRequestOptions.signal
|
|
76486
|
+
}, context, info), (fetchResult) => handleMaybePromise(() => {
|
|
76487
|
+
upstreamErrorExtensions.response ||= {};
|
|
76488
|
+
upstreamErrorExtensions.response.status = fetchResult.status;
|
|
76489
|
+
upstreamErrorExtensions.response.statusText = fetchResult.statusText;
|
|
76490
|
+
Object.defineProperty(upstreamErrorExtensions.response, "headers", {
|
|
76491
|
+
get() {
|
|
76492
|
+
return Object.fromEntries(fetchResult.headers.entries());
|
|
76493
|
+
}
|
|
76494
|
+
});
|
|
76495
|
+
if (options?.retry != null && !fetchResult.status.toString().startsWith("2")) {
|
|
76496
|
+
throw new Error(fetchResult.statusText || `Upstream HTTP Error: ${fetchResult.status}`);
|
|
76497
|
+
}
|
|
76498
|
+
const contentType = fetchResult.headers.get("content-type");
|
|
76499
|
+
if (contentType?.includes("text/event-stream")) {
|
|
76500
|
+
return handleEventStreamResponse(fetchResult, subscriptionCtrl, signal);
|
|
76501
|
+
} else if (contentType?.includes("multipart/mixed")) {
|
|
76502
|
+
return handleMultipartMixedResponse(fetchResult);
|
|
76503
|
+
}
|
|
76504
|
+
return fetchResult.text();
|
|
76505
|
+
}, (result) => {
|
|
76506
|
+
if (typeof result === "string") {
|
|
76507
|
+
upstreamErrorExtensions.response ||= {};
|
|
76508
|
+
upstreamErrorExtensions.response.body = result;
|
|
76509
|
+
if (result) {
|
|
76510
|
+
try {
|
|
76511
|
+
const parsedResult = JSON.parse(result);
|
|
76512
|
+
upstreamErrorExtensions.response.body = parsedResult;
|
|
76513
|
+
if (parsedResult.data == null && (parsedResult.errors == null || parsedResult.errors.length === 0)) {
|
|
76514
|
+
const message = `Unexpected empty "data" and "errors" fields in result: ${result}`;
|
|
76515
|
+
return {
|
|
76516
|
+
errors: [
|
|
76517
|
+
createGraphQLError(message, {
|
|
76518
|
+
originalError: new Error(message),
|
|
76519
|
+
extensions: upstreamErrorExtensions
|
|
76520
|
+
})
|
|
76521
|
+
]
|
|
76522
|
+
};
|
|
76523
|
+
}
|
|
76524
|
+
if (Array.isArray(parsedResult.errors)) {
|
|
76525
|
+
return {
|
|
76526
|
+
...parsedResult,
|
|
76527
|
+
errors: parsedResult.errors.map(({
|
|
76528
|
+
message,
|
|
76529
|
+
...options2
|
|
76530
|
+
}) => createGraphQLError(message, options2))
|
|
76531
|
+
};
|
|
76532
|
+
}
|
|
76533
|
+
return parsedResult;
|
|
76534
|
+
} catch (e3) {
|
|
76535
|
+
return {
|
|
76536
|
+
errors: [
|
|
76537
|
+
createGraphQLError(`Unexpected response: ${JSON.stringify(result)}`, {
|
|
76538
|
+
extensions: upstreamErrorExtensions,
|
|
76539
|
+
originalError: e3
|
|
76540
|
+
})
|
|
76541
|
+
]
|
|
76542
|
+
};
|
|
76543
|
+
}
|
|
76544
|
+
} else {
|
|
76545
|
+
const message = "No response returned";
|
|
76546
|
+
return {
|
|
76547
|
+
errors: [
|
|
76548
|
+
createGraphQLError(message, {
|
|
76549
|
+
extensions: upstreamErrorExtensions,
|
|
76550
|
+
originalError: new Error(message)
|
|
76551
|
+
})
|
|
76552
|
+
]
|
|
76553
|
+
};
|
|
76554
|
+
}
|
|
76555
|
+
} else {
|
|
76556
|
+
return result;
|
|
76557
|
+
}
|
|
76558
|
+
}, handleError), handleError);
|
|
76559
|
+
}
|
|
76560
|
+
if (typeof inflightRequestOptions.body === "object") {
|
|
76561
|
+
return runInflightRequest();
|
|
76562
|
+
}
|
|
76563
|
+
let inflightRequestId = `${inflightRequestOptions.url}|${inflightRequestOptions.method}`;
|
|
76564
|
+
if (inflightRequestOptions.body) {
|
|
76565
|
+
inflightRequestId += `|${inflightRequestOptions.body}`;
|
|
76566
|
+
}
|
|
76567
|
+
if (isCustomHeader) {
|
|
76568
|
+
inflightRequestId += `|${JSON.stringify(inflightRequestOptions.headers)}`;
|
|
76569
|
+
}
|
|
76570
|
+
let inflightRequest = inflightRequests.get(inflightRequestId);
|
|
76571
|
+
if (!inflightRequest) {
|
|
76572
|
+
inflightRequest = runInflightRequest();
|
|
76573
|
+
if (isPromise(inflightRequest)) {
|
|
76574
|
+
inflightRequests.set(inflightRequestId, inflightRequest);
|
|
76575
|
+
inflightRequest.finally(() => {
|
|
76576
|
+
inflightRequests.delete(inflightRequestId);
|
|
76577
|
+
});
|
|
76578
|
+
}
|
|
76579
|
+
}
|
|
76580
|
+
return inflightRequest;
|
|
76581
|
+
}
|
|
76582
|
+
return handleMaybePromise(() => serializeFn(), (body) => {
|
|
76427
76583
|
switch (method) {
|
|
76428
76584
|
case "GET": {
|
|
76429
76585
|
const finalUrl = prepareGETUrl({
|
|
76430
76586
|
baseUrl: endpoint,
|
|
76431
76587
|
body
|
|
76432
76588
|
});
|
|
76433
|
-
const
|
|
76589
|
+
const inflightRequestOptions = {
|
|
76590
|
+
url: finalUrl,
|
|
76434
76591
|
method: "GET",
|
|
76435
76592
|
headers,
|
|
76436
|
-
signal
|
|
76593
|
+
signal,
|
|
76594
|
+
credentials: options?.credentials
|
|
76437
76595
|
};
|
|
76438
|
-
if (options?.credentials != null) {
|
|
76439
|
-
fetchOptions.credentials = options.credentials;
|
|
76440
|
-
}
|
|
76441
76596
|
upstreamErrorExtensions.request.url = finalUrl;
|
|
76442
|
-
return
|
|
76597
|
+
return handleInflightRequest(inflightRequestOptions, request.context, request.info);
|
|
76443
76598
|
}
|
|
76444
76599
|
case "POST": {
|
|
76445
76600
|
upstreamErrorExtensions.request.body = body;
|
|
@@ -76451,95 +76606,19 @@ function buildHTTPExecutor(options) {
|
|
|
76451
76606
|
upstreamErrorExtensions.request.body = body2;
|
|
76452
76607
|
headers["content-type"] = "application/json";
|
|
76453
76608
|
}
|
|
76454
|
-
const
|
|
76609
|
+
const inflightRequestOptions = {
|
|
76610
|
+
url: endpoint,
|
|
76455
76611
|
method: "POST",
|
|
76456
76612
|
body: body2,
|
|
76457
76613
|
headers,
|
|
76614
|
+
credentials: options?.credentials,
|
|
76458
76615
|
signal
|
|
76459
76616
|
};
|
|
76460
|
-
|
|
76461
|
-
fetchOptions.credentials = options.credentials;
|
|
76462
|
-
}
|
|
76463
|
-
return fetchFn(endpoint, fetchOptions, request.context, request.info);
|
|
76617
|
+
return handleInflightRequest(inflightRequestOptions, request.context, request.info);
|
|
76464
76618
|
}, handleError);
|
|
76465
76619
|
}
|
|
76466
76620
|
}
|
|
76467
|
-
},
|
|
76468
|
-
upstreamErrorExtensions.response ||= {};
|
|
76469
|
-
upstreamErrorExtensions.response.status = fetchResult.status;
|
|
76470
|
-
upstreamErrorExtensions.response.statusText = fetchResult.statusText;
|
|
76471
|
-
Object.defineProperty(upstreamErrorExtensions.response, "headers", {
|
|
76472
|
-
get() {
|
|
76473
|
-
return Object.fromEntries(fetchResult.headers.entries());
|
|
76474
|
-
}
|
|
76475
|
-
});
|
|
76476
|
-
if (options?.retry != null && !fetchResult.status.toString().startsWith("2")) {
|
|
76477
|
-
throw new Error(fetchResult.statusText || `Upstream HTTP Error: ${fetchResult.status}`);
|
|
76478
|
-
}
|
|
76479
|
-
const contentType = fetchResult.headers.get("content-type");
|
|
76480
|
-
if (contentType?.includes("text/event-stream")) {
|
|
76481
|
-
return handleEventStreamResponse(fetchResult, subscriptionCtrl, signal);
|
|
76482
|
-
} else if (contentType?.includes("multipart/mixed")) {
|
|
76483
|
-
return handleMultipartMixedResponse(fetchResult);
|
|
76484
|
-
}
|
|
76485
|
-
return fetchResult.text();
|
|
76486
|
-
}, (result) => {
|
|
76487
|
-
if (typeof result === "string") {
|
|
76488
|
-
upstreamErrorExtensions.response ||= {};
|
|
76489
|
-
upstreamErrorExtensions.response.body = result;
|
|
76490
|
-
if (result) {
|
|
76491
|
-
try {
|
|
76492
|
-
const parsedResult = JSON.parse(result);
|
|
76493
|
-
upstreamErrorExtensions.response.body = parsedResult;
|
|
76494
|
-
if (parsedResult.data == null && (parsedResult.errors == null || parsedResult.errors.length === 0)) {
|
|
76495
|
-
return {
|
|
76496
|
-
errors: [
|
|
76497
|
-
createGraphQLError('Unexpected empty "data" and "errors" fields in result: ' + result, {
|
|
76498
|
-
extensions: upstreamErrorExtensions
|
|
76499
|
-
})
|
|
76500
|
-
]
|
|
76501
|
-
};
|
|
76502
|
-
}
|
|
76503
|
-
if (Array.isArray(parsedResult.errors)) {
|
|
76504
|
-
return {
|
|
76505
|
-
...parsedResult,
|
|
76506
|
-
errors: parsedResult.errors.map(({
|
|
76507
|
-
message,
|
|
76508
|
-
...options2
|
|
76509
|
-
}) => createGraphQLError(message, {
|
|
76510
|
-
...options2,
|
|
76511
|
-
extensions: {
|
|
76512
|
-
code: "DOWNSTREAM_SERVICE_ERROR",
|
|
76513
|
-
serviceName,
|
|
76514
|
-
...options2.extensions || {}
|
|
76515
|
-
}
|
|
76516
|
-
}))
|
|
76517
|
-
};
|
|
76518
|
-
}
|
|
76519
|
-
return parsedResult;
|
|
76520
|
-
} catch (e3) {
|
|
76521
|
-
return {
|
|
76522
|
-
errors: [
|
|
76523
|
-
createGraphQLError(`Unexpected response: ${JSON.stringify(result)}`, {
|
|
76524
|
-
extensions: upstreamErrorExtensions,
|
|
76525
|
-
originalError: e3
|
|
76526
|
-
})
|
|
76527
|
-
]
|
|
76528
|
-
};
|
|
76529
|
-
}
|
|
76530
|
-
} else {
|
|
76531
|
-
return {
|
|
76532
|
-
errors: [
|
|
76533
|
-
createGraphQLError("No response returned", {
|
|
76534
|
-
extensions: upstreamErrorExtensions
|
|
76535
|
-
})
|
|
76536
|
-
]
|
|
76537
|
-
};
|
|
76538
|
-
}
|
|
76539
|
-
} else {
|
|
76540
|
-
return result;
|
|
76541
|
-
}
|
|
76542
|
-
}, handleError), handleError), handleError);
|
|
76621
|
+
}, handleError);
|
|
76543
76622
|
};
|
|
76544
76623
|
let executor2 = baseExecutor;
|
|
76545
76624
|
if (options?.apq != null) {
|
|
@@ -76633,7 +76712,7 @@ function coerceFetchError(e3, {
|
|
|
76633
76712
|
}
|
|
76634
76713
|
|
|
76635
76714
|
// ../../node_modules/.bun/@graphql-tools+executor-legacy-ws@1.1.19+ded46c799560c44e/node_modules/@graphql-tools/executor-legacy-ws/esm/index.js
|
|
76636
|
-
var
|
|
76715
|
+
var import_graphql47 = __toESM(require_graphql2(), 1);
|
|
76637
76716
|
var import_isomorphic_ws2 = __toESM(require_ws(), 1);
|
|
76638
76717
|
var LEGACY_WS;
|
|
76639
76718
|
(function(LEGACY_WS2) {
|
|
@@ -76721,7 +76800,7 @@ function buildWSLegacyExecutor(subscriptionsEndpoint, WebSocketImpl, options) {
|
|
|
76721
76800
|
type: LEGACY_WS.START,
|
|
76722
76801
|
id,
|
|
76723
76802
|
payload: {
|
|
76724
|
-
query:
|
|
76803
|
+
query: import_graphql47.print(request.document),
|
|
76725
76804
|
variables: request.variables,
|
|
76726
76805
|
operationName: request.operationName
|
|
76727
76806
|
}
|
|
@@ -76777,11 +76856,11 @@ function buildWSLegacyExecutor(subscriptionsEndpoint, WebSocketImpl, options) {
|
|
|
76777
76856
|
return executor2;
|
|
76778
76857
|
}
|
|
76779
76858
|
|
|
76780
|
-
// ../../node_modules/.bun/@graphql-tools+delegate@
|
|
76781
|
-
var
|
|
76859
|
+
// ../../node_modules/.bun/@graphql-tools+delegate@11.0.0+ded46c799560c44e/node_modules/@graphql-tools/delegate/dist/index.js
|
|
76860
|
+
var import_graphql52 = __toESM(require_graphql2(), 1);
|
|
76782
76861
|
|
|
76783
76862
|
// ../../node_modules/.bun/@graphql-tools+executor@1.4.9+ded46c799560c44e/node_modules/@graphql-tools/executor/esm/execution/execute.js
|
|
76784
|
-
var
|
|
76863
|
+
var import_graphql49 = __toESM(require_graphql2(), 1);
|
|
76785
76864
|
|
|
76786
76865
|
// ../../node_modules/.bun/@graphql-tools+executor@1.4.9+ded46c799560c44e/node_modules/@graphql-tools/executor/esm/execution/coerceError.js
|
|
76787
76866
|
function coerceError(error43) {
|
|
@@ -76907,7 +76986,7 @@ function promiseForObject(object3, signal, signalPromise) {
|
|
|
76907
76986
|
}
|
|
76908
76987
|
|
|
76909
76988
|
// ../../node_modules/.bun/@graphql-tools+executor@1.4.9+ded46c799560c44e/node_modules/@graphql-tools/executor/esm/execution/values.js
|
|
76910
|
-
var
|
|
76989
|
+
var import_graphql48 = __toESM(require_graphql2(), 1);
|
|
76911
76990
|
function getVariableValues(schema, varDefNodes, inputs, options) {
|
|
76912
76991
|
const errors5 = [];
|
|
76913
76992
|
const maxErrors = options?.maxErrors;
|
|
@@ -76930,16 +77009,16 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
76930
77009
|
const coercedValues = {};
|
|
76931
77010
|
for (const varDefNode of varDefNodes) {
|
|
76932
77011
|
const varName = varDefNode.variable.name.value;
|
|
76933
|
-
const varType =
|
|
76934
|
-
if (!
|
|
76935
|
-
const varTypeStr =
|
|
77012
|
+
const varType = import_graphql48.typeFromAST(schema, varDefNode.type);
|
|
77013
|
+
if (!import_graphql48.isInputType(varType)) {
|
|
77014
|
+
const varTypeStr = import_graphql48.print(varDefNode.type);
|
|
76936
77015
|
onError(createGraphQLError(`Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, { nodes: varDefNode.type }));
|
|
76937
77016
|
continue;
|
|
76938
77017
|
}
|
|
76939
77018
|
if (!hasOwnProperty(inputs, varName)) {
|
|
76940
77019
|
if (varDefNode.defaultValue) {
|
|
76941
|
-
coercedValues[varName] =
|
|
76942
|
-
} else if (
|
|
77020
|
+
coercedValues[varName] = import_graphql48.valueFromAST(varDefNode.defaultValue, varType);
|
|
77021
|
+
} else if (import_graphql48.isNonNullType(varType)) {
|
|
76943
77022
|
const varTypeStr = inspect(varType);
|
|
76944
77023
|
onError(createGraphQLError(`Variable "$${varName}" of required type "${varTypeStr}" was not provided.`, {
|
|
76945
77024
|
nodes: varDefNode
|
|
@@ -76948,14 +77027,14 @@ function coerceVariableValues(schema, varDefNodes, inputs, onError) {
|
|
|
76948
77027
|
continue;
|
|
76949
77028
|
}
|
|
76950
77029
|
const value = inputs[varName];
|
|
76951
|
-
if (value === null &&
|
|
77030
|
+
if (value === null && import_graphql48.isNonNullType(varType)) {
|
|
76952
77031
|
const varTypeStr = inspect(varType);
|
|
76953
77032
|
onError(createGraphQLError(`Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`, {
|
|
76954
77033
|
nodes: varDefNode
|
|
76955
77034
|
}));
|
|
76956
77035
|
continue;
|
|
76957
77036
|
}
|
|
76958
|
-
coercedValues[varName] =
|
|
77037
|
+
coercedValues[varName] = import_graphql48.coerceInputValue(value, varType, (path2, invalidValue, error43) => {
|
|
76959
77038
|
let prefix = `Variable "$${varName}" got invalid value ` + inspect(invalidValue);
|
|
76960
77039
|
if (path2.length > 0) {
|
|
76961
77040
|
prefix += ` at "${varName}${printPathArray(path2)}"`;
|
|
@@ -77021,7 +77100,7 @@ function buildResponse(data, errors5) {
|
|
|
77021
77100
|
var getFragmentsFromDocument = memoize1(function getFragmentsFromDocument2(document) {
|
|
77022
77101
|
const fragments = Object.create(null);
|
|
77023
77102
|
for (const definition of document.definitions) {
|
|
77024
|
-
if (definition.kind ===
|
|
77103
|
+
if (definition.kind === import_graphql49.Kind.FRAGMENT_DEFINITION) {
|
|
77025
77104
|
fragments[definition.name.value] = definition;
|
|
77026
77105
|
}
|
|
77027
77106
|
}
|
|
@@ -77030,12 +77109,12 @@ var getFragmentsFromDocument = memoize1(function getFragmentsFromDocument2(docum
|
|
|
77030
77109
|
function buildExecutionContext(args) {
|
|
77031
77110
|
const { schema, document, rootValue, contextValue, variableValues: rawVariableValues, operationName, fieldResolver, typeResolver, subscribeFieldResolver, signal } = args;
|
|
77032
77111
|
signal?.throwIfAborted();
|
|
77033
|
-
|
|
77112
|
+
import_graphql49.assertValidSchema(schema);
|
|
77034
77113
|
const fragments = getFragmentsFromDocument(document);
|
|
77035
77114
|
let operation;
|
|
77036
77115
|
for (const definition of document.definitions) {
|
|
77037
77116
|
switch (definition.kind) {
|
|
77038
|
-
case
|
|
77117
|
+
case import_graphql49.Kind.OPERATION_DEFINITION:
|
|
77039
77118
|
if (operationName == null) {
|
|
77040
77119
|
if (operation !== undefined) {
|
|
77041
77120
|
return [
|
|
@@ -77217,14 +77296,14 @@ function executeField(exeContext, parentType, source, fieldNodes, path2, asyncPa
|
|
|
77217
77296
|
let result2;
|
|
77218
77297
|
for (let rawErrorItem of rawError.errors) {
|
|
77219
77298
|
rawErrorItem = coerceError(rawErrorItem);
|
|
77220
|
-
const error44 =
|
|
77299
|
+
const error44 = import_graphql49.locatedError(rawErrorItem, fieldNodes, pathToArray(path2));
|
|
77221
77300
|
result2 = handleFieldError(error44, returnType, errors5);
|
|
77222
77301
|
filterSubsequentPayloads(exeContext, path2, asyncPayloadRecord);
|
|
77223
77302
|
}
|
|
77224
77303
|
return result2;
|
|
77225
77304
|
}
|
|
77226
77305
|
rawError = coerceError(rawError);
|
|
77227
|
-
const error43 =
|
|
77306
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(path2));
|
|
77228
77307
|
const handledError = handleFieldError(error43, returnType, errors5);
|
|
77229
77308
|
filterSubsequentPayloads(exeContext, path2, asyncPayloadRecord);
|
|
77230
77309
|
return handledError;
|
|
@@ -77236,14 +77315,14 @@ function executeField(exeContext, parentType, source, fieldNodes, path2, asyncPa
|
|
|
77236
77315
|
let result;
|
|
77237
77316
|
for (let rawErrorItem of rawError.errors) {
|
|
77238
77317
|
rawErrorItem = coerceError(rawErrorItem);
|
|
77239
|
-
const error44 =
|
|
77318
|
+
const error44 = import_graphql49.locatedError(rawErrorItem, fieldNodes, pathToArray(path2));
|
|
77240
77319
|
result = handleFieldError(error44, returnType, errors5);
|
|
77241
77320
|
filterSubsequentPayloads(exeContext, path2, asyncPayloadRecord);
|
|
77242
77321
|
}
|
|
77243
77322
|
return result;
|
|
77244
77323
|
}
|
|
77245
77324
|
const coercedError = coerceError(rawError);
|
|
77246
|
-
const error43 =
|
|
77325
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(path2));
|
|
77247
77326
|
const handledError = handleFieldError(error43, returnType, errors5);
|
|
77248
77327
|
filterSubsequentPayloads(exeContext, path2, asyncPayloadRecord);
|
|
77249
77328
|
return handledError;
|
|
@@ -77266,7 +77345,7 @@ function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path2) {
|
|
|
77266
77345
|
}
|
|
77267
77346
|
var CRITICAL_ERROR = "CRITICAL_ERROR";
|
|
77268
77347
|
function handleFieldError(error43, returnType, errors5) {
|
|
77269
|
-
if (
|
|
77348
|
+
if (import_graphql49.isNonNullType(returnType)) {
|
|
77270
77349
|
throw error43;
|
|
77271
77350
|
}
|
|
77272
77351
|
if (error43.extensions?.[CRITICAL_ERROR]) {
|
|
@@ -77279,7 +77358,7 @@ function completeValue(exeContext, returnType, fieldNodes, info, path2, result,
|
|
|
77279
77358
|
if (result instanceof Error) {
|
|
77280
77359
|
throw result;
|
|
77281
77360
|
}
|
|
77282
|
-
if (
|
|
77361
|
+
if (import_graphql49.isNonNullType(returnType)) {
|
|
77283
77362
|
const completed = completeValue(exeContext, returnType.ofType, fieldNodes, info, path2, result, asyncPayloadRecord);
|
|
77284
77363
|
if (completed === null) {
|
|
77285
77364
|
throw new Error(`Cannot return null for non-nullable field ${info.parentType.name}.${info.fieldName}.`);
|
|
@@ -77289,16 +77368,16 @@ function completeValue(exeContext, returnType, fieldNodes, info, path2, result,
|
|
|
77289
77368
|
if (result == null) {
|
|
77290
77369
|
return null;
|
|
77291
77370
|
}
|
|
77292
|
-
if (
|
|
77371
|
+
if (import_graphql49.isListType(returnType)) {
|
|
77293
77372
|
return completeListValue(exeContext, returnType, fieldNodes, info, path2, result, asyncPayloadRecord);
|
|
77294
77373
|
}
|
|
77295
|
-
if (
|
|
77374
|
+
if (import_graphql49.isLeafType(returnType)) {
|
|
77296
77375
|
return completeLeafValue(returnType, result);
|
|
77297
77376
|
}
|
|
77298
|
-
if (
|
|
77377
|
+
if (import_graphql49.isAbstractType(returnType)) {
|
|
77299
77378
|
return completeAbstractValue(exeContext, returnType, fieldNodes, info, path2, result, asyncPayloadRecord);
|
|
77300
77379
|
}
|
|
77301
|
-
if (
|
|
77380
|
+
if (import_graphql49.isObjectType(returnType)) {
|
|
77302
77381
|
return completeObjectValue(exeContext, returnType, fieldNodes, info, path2, result, asyncPayloadRecord);
|
|
77303
77382
|
}
|
|
77304
77383
|
console.assert(false, "Cannot complete value of unexpected output type: " + inspect(returnType));
|
|
@@ -77307,7 +77386,7 @@ function getStreamValues(exeContext, fieldNodes, path2) {
|
|
|
77307
77386
|
if (typeof path2.key === "number") {
|
|
77308
77387
|
return;
|
|
77309
77388
|
}
|
|
77310
|
-
const stream2 =
|
|
77389
|
+
const stream2 = import_graphql49.getDirectiveValues(GraphQLStreamDirective, fieldNodes[0], exeContext.variableValues);
|
|
77311
77390
|
if (!stream2) {
|
|
77312
77391
|
return;
|
|
77313
77392
|
}
|
|
@@ -77347,7 +77426,7 @@ async function completeAsyncIteratorValue(exeContext, itemType, fieldNodes, info
|
|
|
77347
77426
|
}
|
|
77348
77427
|
} catch (rawError) {
|
|
77349
77428
|
const coercedError = coerceError(rawError);
|
|
77350
|
-
const error43 =
|
|
77429
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(itemPath));
|
|
77351
77430
|
completedResults.push(handleFieldError(error43, itemType, errors5));
|
|
77352
77431
|
break;
|
|
77353
77432
|
}
|
|
@@ -77398,7 +77477,7 @@ function completeListItemValue(item, completedResults, errors5, exeContext, item
|
|
|
77398
77477
|
if (isPromise(completedItem)) {
|
|
77399
77478
|
completedResults.push(completedItem.then(undefined, (rawError) => {
|
|
77400
77479
|
rawError = coerceError(rawError);
|
|
77401
|
-
const error43 =
|
|
77480
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
77402
77481
|
const handledError = handleFieldError(error43, itemType, errors5);
|
|
77403
77482
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77404
77483
|
return handledError;
|
|
@@ -77408,7 +77487,7 @@ function completeListItemValue(item, completedResults, errors5, exeContext, item
|
|
|
77408
77487
|
completedResults.push(completedItem);
|
|
77409
77488
|
} catch (rawError) {
|
|
77410
77489
|
const coercedError = coerceError(rawError);
|
|
77411
|
-
const error43 =
|
|
77490
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(itemPath));
|
|
77412
77491
|
const handledError = handleFieldError(error43, itemType, errors5);
|
|
77413
77492
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77414
77493
|
completedResults.push(handledError);
|
|
@@ -77420,7 +77499,7 @@ function completeLeafValue(returnType, result) {
|
|
|
77420
77499
|
try {
|
|
77421
77500
|
serializedResult = returnType.serialize(result);
|
|
77422
77501
|
} catch (err) {
|
|
77423
|
-
if (err instanceof
|
|
77502
|
+
if (err instanceof import_graphql49.GraphQLError) {
|
|
77424
77503
|
throw new Error(err.message);
|
|
77425
77504
|
}
|
|
77426
77505
|
throw err;
|
|
@@ -77443,8 +77522,8 @@ function ensureValidRuntimeType(runtimeTypeName, exeContext, returnType, fieldNo
|
|
|
77443
77522
|
if (runtimeTypeName == null) {
|
|
77444
77523
|
throw createGraphQLError(`Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}". Either the "${returnType.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, { nodes: fieldNodes });
|
|
77445
77524
|
}
|
|
77446
|
-
if (
|
|
77447
|
-
if (
|
|
77525
|
+
if (import_graphql49.isObjectType(runtimeTypeName)) {
|
|
77526
|
+
if (import_graphql49.versionInfo.major >= 16) {
|
|
77448
77527
|
throw createGraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");
|
|
77449
77528
|
}
|
|
77450
77529
|
runtimeTypeName = runtimeTypeName.name;
|
|
@@ -77456,7 +77535,7 @@ function ensureValidRuntimeType(runtimeTypeName, exeContext, returnType, fieldNo
|
|
|
77456
77535
|
if (runtimeType == null) {
|
|
77457
77536
|
throw createGraphQLError(`Abstract type "${returnType.name}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, { nodes: fieldNodes });
|
|
77458
77537
|
}
|
|
77459
|
-
if (!
|
|
77538
|
+
if (!import_graphql49.isObjectType(runtimeType)) {
|
|
77460
77539
|
throw createGraphQLError(`Abstract type "${returnType.name}" was resolved to a non-object type "${runtimeTypeName}".`, { nodes: fieldNodes });
|
|
77461
77540
|
}
|
|
77462
77541
|
if (!exeContext.schema.isSubType(returnType, runtimeType)) {
|
|
@@ -77649,12 +77728,12 @@ function executeSubscription(exeContext) {
|
|
|
77649
77728
|
const result = resolveFn(rootValue, args, contextValue, info);
|
|
77650
77729
|
if (isPromise(result)) {
|
|
77651
77730
|
return result.then((result2) => assertEventStream(result2, exeContext.signal, exeContext.onSignalAbort)).then(undefined, (error43) => {
|
|
77652
|
-
throw
|
|
77731
|
+
throw import_graphql49.locatedError(error43, fieldNodes, pathToArray(path2));
|
|
77653
77732
|
});
|
|
77654
77733
|
}
|
|
77655
77734
|
return assertEventStream(result, exeContext.signal, exeContext.onSignalAbort);
|
|
77656
77735
|
} catch (error43) {
|
|
77657
|
-
throw
|
|
77736
|
+
throw import_graphql49.locatedError(error43, fieldNodes, pathToArray(path2));
|
|
77658
77737
|
}
|
|
77659
77738
|
}
|
|
77660
77739
|
function assertEventStream(result, signal, onSignalAbort) {
|
|
@@ -77720,7 +77799,7 @@ function executeStreamField(path2, itemPath, item, exeContext, fieldNodes, info,
|
|
|
77720
77799
|
if (isPromise(completedItem)) {
|
|
77721
77800
|
completedItem = completedItem.then(undefined, (rawError) => {
|
|
77722
77801
|
rawError = coerceError(rawError);
|
|
77723
|
-
const error43 =
|
|
77802
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
77724
77803
|
const handledError = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77725
77804
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77726
77805
|
return handledError;
|
|
@@ -77728,7 +77807,7 @@ function executeStreamField(path2, itemPath, item, exeContext, fieldNodes, info,
|
|
|
77728
77807
|
}
|
|
77729
77808
|
} catch (rawError) {
|
|
77730
77809
|
const coercedError = coerceError(rawError);
|
|
77731
|
-
const error43 =
|
|
77810
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(itemPath));
|
|
77732
77811
|
completedItem = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77733
77812
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77734
77813
|
}
|
|
@@ -77762,7 +77841,7 @@ async function executeStreamIteratorItem(iterator, exeContext, fieldNodes, info,
|
|
|
77762
77841
|
item = value;
|
|
77763
77842
|
} catch (rawError) {
|
|
77764
77843
|
const coercedError = coerceError(rawError);
|
|
77765
|
-
const error43 =
|
|
77844
|
+
const error43 = import_graphql49.locatedError(coercedError, fieldNodes, pathToArray(itemPath));
|
|
77766
77845
|
const value = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77767
77846
|
return { done: true, value };
|
|
77768
77847
|
}
|
|
@@ -77771,7 +77850,7 @@ async function executeStreamIteratorItem(iterator, exeContext, fieldNodes, info,
|
|
|
77771
77850
|
completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item, asyncPayloadRecord);
|
|
77772
77851
|
if (isPromise(completedItem)) {
|
|
77773
77852
|
completedItem = completedItem.then(undefined, (rawError) => {
|
|
77774
|
-
const error43 =
|
|
77853
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
77775
77854
|
const handledError = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77776
77855
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77777
77856
|
return handledError;
|
|
@@ -77779,7 +77858,7 @@ async function executeStreamIteratorItem(iterator, exeContext, fieldNodes, info,
|
|
|
77779
77858
|
}
|
|
77780
77859
|
return { done: false, value: completedItem };
|
|
77781
77860
|
} catch (rawError) {
|
|
77782
|
-
const error43 =
|
|
77861
|
+
const error43 = import_graphql49.locatedError(rawError, fieldNodes, pathToArray(itemPath));
|
|
77783
77862
|
const value = handleFieldError(error43, itemType, asyncPayloadRecord.errors);
|
|
77784
77863
|
filterSubsequentPayloads(exeContext, itemPath, asyncPayloadRecord);
|
|
77785
77864
|
return { done: false, value };
|
|
@@ -78024,20 +78103,20 @@ function isStreamPayload(asyncPayload) {
|
|
|
78024
78103
|
}
|
|
78025
78104
|
function getFieldDef(schema, parentType, fieldNode) {
|
|
78026
78105
|
const fieldName = fieldNode.name.value;
|
|
78027
|
-
if (fieldName ===
|
|
78028
|
-
return
|
|
78029
|
-
} else if (fieldName ===
|
|
78030
|
-
return
|
|
78031
|
-
} else if (fieldName ===
|
|
78032
|
-
return
|
|
78106
|
+
if (fieldName === import_graphql49.SchemaMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
78107
|
+
return import_graphql49.SchemaMetaFieldDef;
|
|
78108
|
+
} else if (fieldName === import_graphql49.TypeMetaFieldDef.name && schema.getQueryType() === parentType) {
|
|
78109
|
+
return import_graphql49.TypeMetaFieldDef;
|
|
78110
|
+
} else if (fieldName === import_graphql49.TypeNameMetaFieldDef.name) {
|
|
78111
|
+
return import_graphql49.TypeNameMetaFieldDef;
|
|
78033
78112
|
}
|
|
78034
78113
|
return parentType.getFields()[fieldName];
|
|
78035
78114
|
}
|
|
78036
78115
|
|
|
78037
78116
|
// ../../node_modules/.bun/@graphql-tools+executor@1.4.9+ded46c799560c44e/node_modules/@graphql-tools/executor/esm/execution/normalizedExecutor.js
|
|
78038
|
-
var
|
|
78117
|
+
var import_graphql50 = __toESM(require_graphql2(), 1);
|
|
78039
78118
|
function normalizedExecutor(args) {
|
|
78040
|
-
const operationAST =
|
|
78119
|
+
const operationAST = import_graphql50.getOperationAST(args.document, args.operationName);
|
|
78041
78120
|
if (operationAST == null) {
|
|
78042
78121
|
throw new Error("Must provide an operation.");
|
|
78043
78122
|
}
|
|
@@ -78065,9 +78144,9 @@ var executorFromSchema = memoize1(function executorFromSchema2(schema) {
|
|
|
78065
78144
|
};
|
|
78066
78145
|
});
|
|
78067
78146
|
|
|
78068
|
-
// ../../node_modules/.bun/@graphql-tools+batch-execute@
|
|
78147
|
+
// ../../node_modules/.bun/@graphql-tools+batch-execute@10.0.0+ded46c799560c44e/node_modules/@graphql-tools/batch-execute/dist/index.js
|
|
78069
78148
|
var import_dataloader = __toESM(require_dataloader(), 1);
|
|
78070
|
-
var
|
|
78149
|
+
var import_graphql51 = __toESM(require_graphql2(), 1);
|
|
78071
78150
|
function createPrefix(index) {
|
|
78072
78151
|
return `_v${index}_`;
|
|
78073
78152
|
}
|
|
@@ -78103,6 +78182,10 @@ function parseKeyFromPath(path2) {
|
|
|
78103
78182
|
};
|
|
78104
78183
|
}
|
|
78105
78184
|
function mergeRequests(requests, extensionsReducer) {
|
|
78185
|
+
if (requests.length === 1) {
|
|
78186
|
+
return requests[0];
|
|
78187
|
+
}
|
|
78188
|
+
const subgraphName = requests[0].subgraphName;
|
|
78106
78189
|
const mergedVariables = /* @__PURE__ */ Object.create(null);
|
|
78107
78190
|
const mergedVariableDefinitions = [];
|
|
78108
78191
|
const mergedSelections = [];
|
|
@@ -78133,24 +78216,25 @@ function mergeRequests(requests, extensionsReducer) {
|
|
|
78133
78216
|
}
|
|
78134
78217
|
const operationType = firstRequest.operationType ?? getOperationASTFromRequest(firstRequest).operation;
|
|
78135
78218
|
const mergedOperationDefinition = {
|
|
78136
|
-
kind:
|
|
78219
|
+
kind: import_graphql51.Kind.OPERATION_DEFINITION,
|
|
78137
78220
|
operation: operationType,
|
|
78138
78221
|
variableDefinitions: mergedVariableDefinitions,
|
|
78139
78222
|
selectionSet: {
|
|
78140
|
-
kind:
|
|
78223
|
+
kind: import_graphql51.Kind.SELECTION_SET,
|
|
78141
78224
|
selections: mergedSelections
|
|
78142
78225
|
}
|
|
78143
78226
|
};
|
|
78144
78227
|
const operationName = firstRequest.operationName ?? firstRequest.info?.operation?.name?.value;
|
|
78145
78228
|
if (operationName) {
|
|
78146
78229
|
mergedOperationDefinition.name = {
|
|
78147
|
-
kind:
|
|
78230
|
+
kind: import_graphql51.Kind.NAME,
|
|
78148
78231
|
value: operationName
|
|
78149
78232
|
};
|
|
78150
78233
|
}
|
|
78151
78234
|
return {
|
|
78235
|
+
subgraphName,
|
|
78152
78236
|
document: {
|
|
78153
|
-
kind:
|
|
78237
|
+
kind: import_graphql51.Kind.DOCUMENT,
|
|
78154
78238
|
definitions: [mergedOperationDefinition, ...mergedFragmentDefinitions]
|
|
78155
78239
|
},
|
|
78156
78240
|
variables: mergedVariables,
|
|
@@ -78176,13 +78260,13 @@ function prefixRequest(prefix, request) {
|
|
|
78176
78260
|
const fragmentSpreadImpl = {};
|
|
78177
78261
|
let hasFragments = false;
|
|
78178
78262
|
if (hasFragmentDefinitionsOrVariables) {
|
|
78179
|
-
prefixedDocument =
|
|
78180
|
-
[
|
|
78181
|
-
[
|
|
78263
|
+
prefixedDocument = import_graphql51.visit(prefixedDocument, {
|
|
78264
|
+
[import_graphql51.Kind.VARIABLE]: prefixNode,
|
|
78265
|
+
[import_graphql51.Kind.FRAGMENT_DEFINITION](node) {
|
|
78182
78266
|
hasFragments = true;
|
|
78183
78267
|
return prefixNode(node);
|
|
78184
78268
|
},
|
|
78185
|
-
[
|
|
78269
|
+
[import_graphql51.Kind.FRAGMENT_SPREAD]: (node) => {
|
|
78186
78270
|
node = prefixNodeName(node, prefix);
|
|
78187
78271
|
fragmentSpreadImpl[node.name.value] = true;
|
|
78188
78272
|
return node;
|
|
@@ -78210,7 +78294,7 @@ function prefixRequest(prefix, request) {
|
|
|
78210
78294
|
}
|
|
78211
78295
|
function aliasTopLevelFields(prefix, document) {
|
|
78212
78296
|
const transformer = {
|
|
78213
|
-
[
|
|
78297
|
+
[import_graphql51.Kind.OPERATION_DEFINITION]: (def) => {
|
|
78214
78298
|
const { selections } = def.selectionSet;
|
|
78215
78299
|
return {
|
|
78216
78300
|
...def,
|
|
@@ -78221,20 +78305,20 @@ function aliasTopLevelFields(prefix, document) {
|
|
|
78221
78305
|
};
|
|
78222
78306
|
}
|
|
78223
78307
|
};
|
|
78224
|
-
return
|
|
78225
|
-
[
|
|
78308
|
+
return import_graphql51.visit(document, transformer, {
|
|
78309
|
+
[import_graphql51.Kind.DOCUMENT]: [`definitions`]
|
|
78226
78310
|
});
|
|
78227
78311
|
}
|
|
78228
78312
|
function aliasFieldsInSelection(prefix, selections, document) {
|
|
78229
78313
|
return selections.map((selection) => {
|
|
78230
78314
|
switch (selection.kind) {
|
|
78231
|
-
case
|
|
78315
|
+
case import_graphql51.Kind.INLINE_FRAGMENT:
|
|
78232
78316
|
return aliasFieldsInInlineFragment(prefix, selection, document);
|
|
78233
|
-
case
|
|
78317
|
+
case import_graphql51.Kind.FRAGMENT_SPREAD: {
|
|
78234
78318
|
const inlineFragment = inlineFragmentSpread(selection, document);
|
|
78235
78319
|
return aliasFieldsInInlineFragment(prefix, inlineFragment, document);
|
|
78236
78320
|
}
|
|
78237
|
-
case
|
|
78321
|
+
case import_graphql51.Kind.FIELD:
|
|
78238
78322
|
default:
|
|
78239
78323
|
return aliasField(selection, prefix);
|
|
78240
78324
|
}
|
|
@@ -78257,7 +78341,7 @@ function inlineFragmentSpread(spread, document) {
|
|
|
78257
78341
|
}
|
|
78258
78342
|
const { typeCondition, selectionSet } = fragment;
|
|
78259
78343
|
return {
|
|
78260
|
-
kind:
|
|
78344
|
+
kind: import_graphql51.Kind.INLINE_FRAGMENT,
|
|
78261
78345
|
typeCondition,
|
|
78262
78346
|
selectionSet,
|
|
78263
78347
|
directives: spread.directives
|
|
@@ -78283,10 +78367,10 @@ function aliasField(field, aliasPrefix) {
|
|
|
78283
78367
|
};
|
|
78284
78368
|
}
|
|
78285
78369
|
function isOperationDefinition(def) {
|
|
78286
|
-
return def.kind ===
|
|
78370
|
+
return def.kind === import_graphql51.Kind.OPERATION_DEFINITION;
|
|
78287
78371
|
}
|
|
78288
78372
|
function isFragmentDefinition(def) {
|
|
78289
|
-
return def.kind ===
|
|
78373
|
+
return def.kind === import_graphql51.Kind.FRAGMENT_DEFINITION;
|
|
78290
78374
|
}
|
|
78291
78375
|
function splitResult({ data, errors: errors5 }, numResults) {
|
|
78292
78376
|
const splitResults = new Array(numResults);
|
|
@@ -78382,7 +78466,7 @@ var getBatchingExecutor = memoize2of4(function getBatchingExecutor2(_context, ex
|
|
|
78382
78466
|
return createBatchingExecutor(executor2, dataLoaderOptions, extensionsReducer);
|
|
78383
78467
|
});
|
|
78384
78468
|
|
|
78385
|
-
// ../../node_modules/.bun/@graphql-tools+delegate@
|
|
78469
|
+
// ../../node_modules/.bun/@graphql-tools+delegate@11.0.0+ded46c799560c44e/node_modules/@graphql-tools/delegate/dist/index.js
|
|
78386
78470
|
var applySchemaTransforms = memoize2(function applySchemaTransforms2(originalWrappingSchema, subschemaConfig) {
|
|
78387
78471
|
const schemaTransforms = subschemaConfig.transforms;
|
|
78388
78472
|
if (schemaTransforms == null) {
|
|
@@ -78480,14 +78564,14 @@ function handleResolverResult(resolverResult, subschema, selectionSet, object3,
|
|
|
78480
78564
|
const nullResult = {};
|
|
78481
78565
|
for (const [responseKey, fieldNodes] of fields2) {
|
|
78482
78566
|
const combinedPath = [...path2, responseKey];
|
|
78483
|
-
if (resolverResult instanceof
|
|
78567
|
+
if (resolverResult instanceof import_graphql52.GraphQLError) {
|
|
78484
78568
|
if (resolverResult.message.includes("Cannot return null for non-nullable field")) {
|
|
78485
78569
|
nullResult[responseKey] = null;
|
|
78486
78570
|
} else {
|
|
78487
78571
|
nullResult[responseKey] = relocatedError(resolverResult, combinedPath);
|
|
78488
78572
|
}
|
|
78489
78573
|
} else if (resolverResult instanceof Error) {
|
|
78490
|
-
nullResult[responseKey] =
|
|
78574
|
+
nullResult[responseKey] = import_graphql52.locatedError(resolverResult, fieldNodes, combinedPath);
|
|
78491
78575
|
} else {
|
|
78492
78576
|
nullResult[responseKey] = null;
|
|
78493
78577
|
}
|
|
@@ -78506,7 +78590,7 @@ function handleResolverResult(resolverResult, subschema, selectionSet, object3,
|
|
|
78506
78590
|
}
|
|
78507
78591
|
const existingPropValue = object3[responseKey];
|
|
78508
78592
|
const sourcePropValue = resolverResult[responseKey];
|
|
78509
|
-
if (responseKey === "__typename" && existingPropValue !== sourcePropValue &&
|
|
78593
|
+
if (responseKey === "__typename" && existingPropValue !== sourcePropValue && import_graphql52.isAbstractType(subschema.transformedSchema.getType(sourcePropValue))) {
|
|
78510
78594
|
continue;
|
|
78511
78595
|
}
|
|
78512
78596
|
if (sourcePropValue != null || existingPropValue == null) {
|
|
@@ -78553,22 +78637,22 @@ function executeDelegationStage(mergedTypeInfo, delegationMap, object3, context,
|
|
|
78553
78637
|
}
|
|
78554
78638
|
}
|
|
78555
78639
|
function resolveExternalValue(result, unpathedErrors, subschema, context, info, returnType = getReturnType$1(info), skipTypeMerging) {
|
|
78556
|
-
const type =
|
|
78640
|
+
const type = import_graphql52.getNullableType(returnType);
|
|
78557
78641
|
if (result instanceof Error) {
|
|
78558
78642
|
return result;
|
|
78559
78643
|
}
|
|
78560
78644
|
if (result == null) {
|
|
78561
78645
|
return reportUnpathedErrorsViaNull(unpathedErrors);
|
|
78562
78646
|
}
|
|
78563
|
-
if (
|
|
78647
|
+
if (import_graphql52.isLeafType(type)) {
|
|
78564
78648
|
try {
|
|
78565
78649
|
return type.parseValue(result);
|
|
78566
78650
|
} catch {
|
|
78567
78651
|
return null;
|
|
78568
78652
|
}
|
|
78569
|
-
} else if (
|
|
78653
|
+
} else if (import_graphql52.isCompositeType(type)) {
|
|
78570
78654
|
return handleMaybePromise(() => resolveExternalObject(type, result, unpathedErrors, subschema, context, info, skipTypeMerging), (result2) => {
|
|
78571
|
-
if (info &&
|
|
78655
|
+
if (info && import_graphql52.isAbstractType(type)) {
|
|
78572
78656
|
if (result2.__typename != null) {
|
|
78573
78657
|
const resolvedType = info.schema.getType(result2.__typename);
|
|
78574
78658
|
if (!resolvedType) {
|
|
@@ -78579,7 +78663,7 @@ function resolveExternalValue(result, unpathedErrors, subschema, context, info,
|
|
|
78579
78663
|
}
|
|
78580
78664
|
return result2;
|
|
78581
78665
|
});
|
|
78582
|
-
} else if (
|
|
78666
|
+
} else if (import_graphql52.isListType(type)) {
|
|
78583
78667
|
if (Array.isArray(result)) {
|
|
78584
78668
|
return resolveExternalList(type, result, unpathedErrors, subschema, context, info, skipTypeMerging);
|
|
78585
78669
|
}
|
|
@@ -78626,9 +78710,9 @@ function reportUnpathedErrorsViaNull(unpathedErrors) {
|
|
|
78626
78710
|
if (unreportedErrors.length) {
|
|
78627
78711
|
const unreportedError = unreportedErrors[0];
|
|
78628
78712
|
if (unreportedErrors.length === 1 && unreportedError) {
|
|
78629
|
-
return
|
|
78713
|
+
return import_graphql52.locatedError(unreportedError, undefined, unreportedError.path);
|
|
78630
78714
|
}
|
|
78631
|
-
return new AggregateError(unreportedErrors.map((e3) =>
|
|
78715
|
+
return new AggregateError(unreportedErrors.map((e3) => import_graphql52.locatedError(e3, undefined, unreportedError?.path)), unreportedErrors.map((error43) => error43.message).join(`,
|
|
78632
78716
|
`));
|
|
78633
78717
|
}
|
|
78634
78718
|
}
|
|
@@ -78653,7 +78737,7 @@ function checkResultAndHandleErrors(result = {
|
|
|
78653
78737
|
skipTypeMerging,
|
|
78654
78738
|
onLocatedError
|
|
78655
78739
|
} = delegationContext;
|
|
78656
|
-
const { data, unpathedErrors } = mergeDataAndErrors(result.data == null ? undefined : result.data[responseKey], result.errors == null ? [] : result.errors, info != null && info.path ?
|
|
78740
|
+
const { data, unpathedErrors } = mergeDataAndErrors(result.data == null ? undefined : result.data[responseKey], result.errors == null ? [] : result.errors, info != null && info.path ? import_graphql52.responsePathAsArray(info.path) : undefined, onLocatedError);
|
|
78657
78741
|
return resolveExternalValue(data, unpathedErrors, subschema, context, info, returnType, skipTypeMerging);
|
|
78658
78742
|
}
|
|
78659
78743
|
function mergeDataAndErrors(data, errors5, path2, onLocatedError, index = 1) {
|
|
@@ -78722,10 +78806,10 @@ function getDocumentMetadata(document) {
|
|
|
78722
78806
|
const fragmentNames = /* @__PURE__ */ new Set;
|
|
78723
78807
|
for (let i = 0;i < document.definitions.length; i++) {
|
|
78724
78808
|
const def = document.definitions[i];
|
|
78725
|
-
if (def?.kind ===
|
|
78809
|
+
if (def?.kind === import_graphql52.Kind.FRAGMENT_DEFINITION) {
|
|
78726
78810
|
fragments.push(def);
|
|
78727
78811
|
fragmentNames.add(def.name.value);
|
|
78728
|
-
} else if (def?.kind ===
|
|
78812
|
+
} else if (def?.kind === import_graphql52.Kind.OPERATION_DEFINITION) {
|
|
78729
78813
|
operations.push(def);
|
|
78730
78814
|
}
|
|
78731
78815
|
}
|
|
@@ -78736,32 +78820,32 @@ function getDocumentMetadata(document) {
|
|
|
78736
78820
|
};
|
|
78737
78821
|
}
|
|
78738
78822
|
var getTypeInfo = memoize1(function getTypeInfo2(schema) {
|
|
78739
|
-
return new
|
|
78823
|
+
return new import_graphql52.TypeInfo(schema);
|
|
78740
78824
|
});
|
|
78741
78825
|
var getTypeInfoWithType = memoize2(function getTypeInfoWithType2(schema, type) {
|
|
78742
|
-
return
|
|
78826
|
+
return import_graphql52.versionInfo.major < 16 ? new import_graphql52.TypeInfo(schema, undefined, type) : new import_graphql52.TypeInfo(schema, type);
|
|
78743
78827
|
});
|
|
78744
78828
|
function updateArgument2(argumentNodes, variableDefinitionsMap, variableValues, argName, varName, type, value) {
|
|
78745
78829
|
argumentNodes[argName] = {
|
|
78746
|
-
kind:
|
|
78830
|
+
kind: import_graphql52.Kind.ARGUMENT,
|
|
78747
78831
|
name: {
|
|
78748
|
-
kind:
|
|
78832
|
+
kind: import_graphql52.Kind.NAME,
|
|
78749
78833
|
value: argName
|
|
78750
78834
|
},
|
|
78751
78835
|
value: {
|
|
78752
|
-
kind:
|
|
78836
|
+
kind: import_graphql52.Kind.VARIABLE,
|
|
78753
78837
|
name: {
|
|
78754
|
-
kind:
|
|
78838
|
+
kind: import_graphql52.Kind.NAME,
|
|
78755
78839
|
value: varName
|
|
78756
78840
|
}
|
|
78757
78841
|
}
|
|
78758
78842
|
};
|
|
78759
78843
|
variableDefinitionsMap[varName] = {
|
|
78760
|
-
kind:
|
|
78844
|
+
kind: import_graphql52.Kind.VARIABLE_DEFINITION,
|
|
78761
78845
|
variable: {
|
|
78762
|
-
kind:
|
|
78846
|
+
kind: import_graphql52.Kind.VARIABLE,
|
|
78763
78847
|
name: {
|
|
78764
|
-
kind:
|
|
78848
|
+
kind: import_graphql52.Kind.NAME,
|
|
78765
78849
|
value: varName
|
|
78766
78850
|
}
|
|
78767
78851
|
},
|
|
@@ -78821,13 +78905,13 @@ function finalizeGatewayDocument(targetSchema, fragments, operations, onOverlapp
|
|
|
78821
78905
|
fragmentSet = collectedFragmentSet;
|
|
78822
78906
|
const variableDefinitions = (operation.variableDefinitions ?? []).filter((variable) => operationOrFragmentVariables.indexOf(variable.variable.name.value) !== -1);
|
|
78823
78907
|
if (operation.operation === "subscription") {
|
|
78824
|
-
selectionSet.selections = selectionSet.selections.filter((selection) => selection.kind !==
|
|
78908
|
+
selectionSet.selections = selectionSet.selections.filter((selection) => selection.kind !== import_graphql52.Kind.FIELD || selection.name.value !== "__typename");
|
|
78825
78909
|
}
|
|
78826
|
-
if (selectionSet.selections.length === 1 && selectionSet.selections[0] && selectionSet.selections[0].kind ===
|
|
78910
|
+
if (selectionSet.selections.length === 1 && selectionSet.selections[0] && selectionSet.selections[0].kind === import_graphql52.Kind.FIELD && selectionSet.selections[0].name.value === "__typename") {
|
|
78827
78911
|
continue;
|
|
78828
78912
|
}
|
|
78829
78913
|
newOperations.push({
|
|
78830
|
-
kind:
|
|
78914
|
+
kind: import_graphql52.Kind.OPERATION_DEFINITION,
|
|
78831
78915
|
operation: operation.operation,
|
|
78832
78916
|
name: operation.name,
|
|
78833
78917
|
directives: operation.directives,
|
|
@@ -78843,14 +78927,14 @@ function finalizeGatewayDocument(targetSchema, fragments, operations, onOverlapp
|
|
|
78843
78927
|
});
|
|
78844
78928
|
}
|
|
78845
78929
|
let newDocument = {
|
|
78846
|
-
kind:
|
|
78930
|
+
kind: import_graphql52.Kind.DOCUMENT,
|
|
78847
78931
|
definitions: [...newOperations, ...newFragments]
|
|
78848
78932
|
};
|
|
78849
78933
|
const stitchingInfo = delegationContext.info?.schema?.extensions?.["stitchingInfo"];
|
|
78850
78934
|
if (stitchingInfo != null) {
|
|
78851
78935
|
const typeInfo = getTypeInfo(targetSchema);
|
|
78852
|
-
newDocument =
|
|
78853
|
-
[
|
|
78936
|
+
newDocument = import_graphql52.visit(newDocument, import_graphql52.visitWithTypeInfo(typeInfo, {
|
|
78937
|
+
[import_graphql52.Kind.FIELD](fieldNode) {
|
|
78854
78938
|
const parentType = typeInfo.getParentType();
|
|
78855
78939
|
if (parentType) {
|
|
78856
78940
|
const parentTypeName = parentType.name;
|
|
@@ -78863,7 +78947,7 @@ function finalizeGatewayDocument(targetSchema, fragments, operations, onOverlapp
|
|
|
78863
78947
|
return {
|
|
78864
78948
|
...fieldNode,
|
|
78865
78949
|
selectionSet: {
|
|
78866
|
-
kind:
|
|
78950
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
78867
78951
|
selections: [
|
|
78868
78952
|
...providedSelection.selections,
|
|
78869
78953
|
...fieldNode.selectionSet?.selections ?? []
|
|
@@ -78909,7 +78993,7 @@ function finalizeGatewayRequest(originalRequest, delegationContext, onOverlappin
|
|
|
78909
78993
|
};
|
|
78910
78994
|
}
|
|
78911
78995
|
function isTypeNameField(selection) {
|
|
78912
|
-
return selection.kind ===
|
|
78996
|
+
return selection.kind === import_graphql52.Kind.FIELD && !selection.alias && selection.name.value === "__typename";
|
|
78913
78997
|
}
|
|
78914
78998
|
function filterTypenameFields(selections) {
|
|
78915
78999
|
let hasTypeNameField = false;
|
|
@@ -78935,7 +79019,7 @@ function addVariablesToRootFields(targetSchema, operations, args) {
|
|
|
78935
79019
|
const type = getDefinedRootType(targetSchema, operation.operation);
|
|
78936
79020
|
const newSelections = [];
|
|
78937
79021
|
for (const selection of operation.selectionSet.selections) {
|
|
78938
|
-
if (selection.kind ===
|
|
79022
|
+
if (selection.kind === import_graphql52.Kind.FIELD) {
|
|
78939
79023
|
const argumentNodes = selection.arguments ?? [];
|
|
78940
79024
|
const argumentNodeMap = argumentNodes.reduce((prev, argument) => ({
|
|
78941
79025
|
...prev,
|
|
@@ -78954,7 +79038,7 @@ function addVariablesToRootFields(targetSchema, operations, args) {
|
|
|
78954
79038
|
}
|
|
78955
79039
|
}
|
|
78956
79040
|
const newSelectionSet = {
|
|
78957
|
-
kind:
|
|
79041
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
78958
79042
|
selections: newSelections
|
|
78959
79043
|
};
|
|
78960
79044
|
return {
|
|
@@ -79002,9 +79086,9 @@ function collectFragmentVariables(targetSchema, fragmentSet, validFragments, val
|
|
|
79002
79086
|
if (name && !(name in fragmentSet)) {
|
|
79003
79087
|
fragmentSet[name] = true;
|
|
79004
79088
|
newFragments.push({
|
|
79005
|
-
kind:
|
|
79089
|
+
kind: import_graphql52.Kind.FRAGMENT_DEFINITION,
|
|
79006
79090
|
name: {
|
|
79007
|
-
kind:
|
|
79091
|
+
kind: import_graphql52.Kind.NAME,
|
|
79008
79092
|
value: name
|
|
79009
79093
|
},
|
|
79010
79094
|
typeCondition: fragment.typeCondition,
|
|
@@ -79044,8 +79128,8 @@ function finalizeSelectionSet(schema, type, validFragments, selectionSet, onOver
|
|
|
79044
79128
|
const seenNonNullableMap = /* @__PURE__ */ new WeakMap;
|
|
79045
79129
|
const seenNullableMap = /* @__PURE__ */ new WeakMap;
|
|
79046
79130
|
const filteredSelectionSet = filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOverlappingAliases, usedFragments, seenNonNullableMap, seenNullableMap);
|
|
79047
|
-
|
|
79048
|
-
[
|
|
79131
|
+
import_graphql52.visit(filteredSelectionSet, {
|
|
79132
|
+
[import_graphql52.Kind.VARIABLE]: (variableNode) => {
|
|
79049
79133
|
usedVariables.push(variableNode.name.value);
|
|
79050
79134
|
}
|
|
79051
79135
|
}, variablesVisitorKeys);
|
|
@@ -79056,11 +79140,11 @@ function finalizeSelectionSet(schema, type, validFragments, selectionSet, onOver
|
|
|
79056
79140
|
};
|
|
79057
79141
|
}
|
|
79058
79142
|
function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOverlappingAliases, usedFragments, seenNonNullableMap, seenNullableMap) {
|
|
79059
|
-
return
|
|
79060
|
-
[
|
|
79143
|
+
return import_graphql52.visit(selectionSet, import_graphql52.visitWithTypeInfo(typeInfo, {
|
|
79144
|
+
[import_graphql52.Kind.FIELD]: {
|
|
79061
79145
|
enter: (node) => {
|
|
79062
79146
|
const parentType = typeInfo.getParentType();
|
|
79063
|
-
if (
|
|
79147
|
+
if (import_graphql52.isObjectType(parentType) || import_graphql52.isInterfaceType(parentType)) {
|
|
79064
79148
|
const field = typeInfo.getFieldDef();
|
|
79065
79149
|
if (!field) {
|
|
79066
79150
|
return null;
|
|
@@ -79085,18 +79169,18 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79085
79169
|
}
|
|
79086
79170
|
}
|
|
79087
79171
|
}
|
|
79088
|
-
if (
|
|
79172
|
+
if (import_graphql52.isUnionType(parentType) && typeInfo.getType() == null) {
|
|
79089
79173
|
const possibleTypeNames = [];
|
|
79090
79174
|
const fieldName = node.name.value;
|
|
79091
79175
|
for (const memberType of parentType.getTypes()) {
|
|
79092
79176
|
const memberFields = memberType.getFields();
|
|
79093
79177
|
const possibleField = memberFields[fieldName];
|
|
79094
79178
|
if (possibleField != null) {
|
|
79095
|
-
const namedType =
|
|
79096
|
-
if (node.selectionSet?.selections?.length &&
|
|
79179
|
+
const namedType = import_graphql52.getNamedType(possibleField.type);
|
|
79180
|
+
if (node.selectionSet?.selections?.length && import_graphql52.isLeafType(namedType)) {
|
|
79097
79181
|
continue;
|
|
79098
79182
|
}
|
|
79099
|
-
if (!node.selectionSet?.selections?.length &&
|
|
79183
|
+
if (!node.selectionSet?.selections?.length && import_graphql52.isCompositeType(namedType)) {
|
|
79100
79184
|
continue;
|
|
79101
79185
|
}
|
|
79102
79186
|
possibleTypeNames.push(memberType.name);
|
|
@@ -79106,16 +79190,16 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79106
79190
|
const spreads = possibleTypeNames.map((possibleTypeName) => {
|
|
79107
79191
|
if (!node.selectionSet?.selections) {
|
|
79108
79192
|
return {
|
|
79109
|
-
kind:
|
|
79193
|
+
kind: import_graphql52.Kind.INLINE_FRAGMENT,
|
|
79110
79194
|
typeCondition: {
|
|
79111
|
-
kind:
|
|
79195
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79112
79196
|
name: {
|
|
79113
|
-
kind:
|
|
79197
|
+
kind: import_graphql52.Kind.NAME,
|
|
79114
79198
|
value: possibleTypeName
|
|
79115
79199
|
}
|
|
79116
79200
|
},
|
|
79117
79201
|
selectionSet: {
|
|
79118
|
-
kind:
|
|
79202
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79119
79203
|
selections: [node]
|
|
79120
79204
|
}
|
|
79121
79205
|
};
|
|
@@ -79130,16 +79214,16 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79130
79214
|
return;
|
|
79131
79215
|
}
|
|
79132
79216
|
return {
|
|
79133
|
-
kind:
|
|
79217
|
+
kind: import_graphql52.Kind.INLINE_FRAGMENT,
|
|
79134
79218
|
typeCondition: {
|
|
79135
|
-
kind:
|
|
79219
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79136
79220
|
name: {
|
|
79137
|
-
kind:
|
|
79221
|
+
kind: import_graphql52.Kind.NAME,
|
|
79138
79222
|
value: possibleTypeName
|
|
79139
79223
|
}
|
|
79140
79224
|
},
|
|
79141
79225
|
selectionSet: {
|
|
79142
|
-
kind:
|
|
79226
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79143
79227
|
selections: [
|
|
79144
79228
|
{
|
|
79145
79229
|
...node,
|
|
@@ -79163,11 +79247,11 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79163
79247
|
if (type == null) {
|
|
79164
79248
|
return null;
|
|
79165
79249
|
}
|
|
79166
|
-
const namedType =
|
|
79250
|
+
const namedType = import_graphql52.getNamedType(type);
|
|
79167
79251
|
if (schema.getType(namedType.name) == null) {
|
|
79168
79252
|
return null;
|
|
79169
79253
|
}
|
|
79170
|
-
if (
|
|
79254
|
+
if (import_graphql52.isObjectType(namedType) || import_graphql52.isInterfaceType(namedType)) {
|
|
79171
79255
|
const selections = node.selectionSet != null ? node.selectionSet.selections : null;
|
|
79172
79256
|
if (selections == null || selections.length === 0) {
|
|
79173
79257
|
return null;
|
|
@@ -79176,7 +79260,7 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79176
79260
|
return;
|
|
79177
79261
|
}
|
|
79178
79262
|
},
|
|
79179
|
-
[
|
|
79263
|
+
[import_graphql52.Kind.FRAGMENT_SPREAD]: {
|
|
79180
79264
|
enter: (node) => {
|
|
79181
79265
|
if (!(node.name.value in validFragments)) {
|
|
79182
79266
|
return null;
|
|
@@ -79190,15 +79274,15 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79190
79274
|
return;
|
|
79191
79275
|
}
|
|
79192
79276
|
},
|
|
79193
|
-
[
|
|
79277
|
+
[import_graphql52.Kind.SELECTION_SET]: {
|
|
79194
79278
|
enter: (node, _key, _parent, _path) => {
|
|
79195
79279
|
const parentType = typeInfo.getParentType();
|
|
79196
79280
|
const { hasTypeNameField, selections } = filterTypenameFields(node.selections);
|
|
79197
|
-
if (hasTypeNameField || parentType != null &&
|
|
79281
|
+
if (hasTypeNameField || parentType != null && import_graphql52.isAbstractType(parentType)) {
|
|
79198
79282
|
selections.unshift({
|
|
79199
|
-
kind:
|
|
79283
|
+
kind: import_graphql52.Kind.FIELD,
|
|
79200
79284
|
name: {
|
|
79201
|
-
kind:
|
|
79285
|
+
kind: import_graphql52.Kind.NAME,
|
|
79202
79286
|
value: "__typename"
|
|
79203
79287
|
}
|
|
79204
79288
|
});
|
|
@@ -79209,12 +79293,12 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79209
79293
|
};
|
|
79210
79294
|
}
|
|
79211
79295
|
},
|
|
79212
|
-
[
|
|
79296
|
+
[import_graphql52.Kind.INLINE_FRAGMENT]: {
|
|
79213
79297
|
enter: (node) => {
|
|
79214
79298
|
if (node.typeCondition != null) {
|
|
79215
79299
|
const parentType = typeInfo.getParentType();
|
|
79216
79300
|
const innerType = schema.getType(node.typeCondition.name.value);
|
|
79217
|
-
if (
|
|
79301
|
+
if (import_graphql52.isUnionType(parentType) && parentType.getTypes().some((t) => t.name === innerType?.name)) {
|
|
79218
79302
|
return node;
|
|
79219
79303
|
}
|
|
79220
79304
|
if (!implementsAbstractType(schema, parentType, innerType)) {
|
|
@@ -79248,13 +79332,13 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79248
79332
|
selectionSet: {
|
|
79249
79333
|
...selection.selectionSet,
|
|
79250
79334
|
selections: selection.selectionSet.selections.map((subSelection) => {
|
|
79251
|
-
if (subSelection.kind ===
|
|
79335
|
+
if (subSelection.kind === import_graphql52.Kind.FIELD) {
|
|
79252
79336
|
const fieldName = subSelection.name.value;
|
|
79253
79337
|
if (!subSelection.alias) {
|
|
79254
79338
|
const field = selectionTypeFields[fieldName];
|
|
79255
79339
|
if (field) {
|
|
79256
79340
|
let currentNullable;
|
|
79257
|
-
if (
|
|
79341
|
+
if (import_graphql52.isNullableType(field.type)) {
|
|
79258
79342
|
seenNullable.add(fieldName);
|
|
79259
79343
|
currentNullable = true;
|
|
79260
79344
|
} else {
|
|
@@ -79266,7 +79350,7 @@ function filterSelectionSet(schema, typeInfo, validFragments, selectionSet, onOv
|
|
|
79266
79350
|
return {
|
|
79267
79351
|
...subSelection,
|
|
79268
79352
|
alias: {
|
|
79269
|
-
kind:
|
|
79353
|
+
kind: import_graphql52.Kind.NAME,
|
|
79270
79354
|
value: currentNullable ? `_nullable_${fieldName}` : `_nonNullable_${fieldName}`
|
|
79271
79355
|
}
|
|
79272
79356
|
};
|
|
@@ -79328,7 +79412,7 @@ function prepareGatewayDocument(originalDocument, transformedSchema, returnType,
|
|
|
79328
79412
|
const { expandedFragments, fragmentReplacements } = getExpandedFragments(fragments, fragmentNames, possibleTypesMap);
|
|
79329
79413
|
const typeInfo = getTypeInfo(transformedSchema);
|
|
79330
79414
|
const expandedDocument = {
|
|
79331
|
-
kind:
|
|
79415
|
+
kind: import_graphql52.Kind.DOCUMENT,
|
|
79332
79416
|
definitions: [...operations, ...fragments, ...expandedFragments]
|
|
79333
79417
|
};
|
|
79334
79418
|
const visitorKeyMap = {
|
|
@@ -79339,8 +79423,8 @@ function prepareGatewayDocument(originalDocument, transformedSchema, returnType,
|
|
|
79339
79423
|
InlineFragment: ["selectionSet"],
|
|
79340
79424
|
FragmentDefinition: ["selectionSet"]
|
|
79341
79425
|
};
|
|
79342
|
-
return
|
|
79343
|
-
[
|
|
79426
|
+
return import_graphql52.visit(expandedDocument, import_graphql52.visitWithTypeInfo(typeInfo, {
|
|
79427
|
+
[import_graphql52.Kind.SELECTION_SET]: (node) => visitSelectionSet(node, fragmentReplacements, transformedSchema, typeInfo, possibleTypesMap, reversePossibleTypesMap2, interfaceExtensionsMap, fieldNodesByType, fieldNodesByField, dynamicSelectionSetsByField, infoSchema, visitedSelections)
|
|
79344
79428
|
}), visitorKeyMap);
|
|
79345
79429
|
}
|
|
79346
79430
|
var getExtraPossibleTypesFn = memoize2(function getExtraPossibleTypes(transformedSchema, infoSchema) {
|
|
@@ -79351,7 +79435,7 @@ var getExtraPossibleTypesFn = memoize2(function getExtraPossibleTypes(transforme
|
|
|
79351
79435
|
extraTypesForSubschema = /* @__PURE__ */ new Set;
|
|
79352
79436
|
const gatewayType = infoSchema.getType(typeName);
|
|
79353
79437
|
const subschemaType = transformedSchema.getType(typeName);
|
|
79354
|
-
if (
|
|
79438
|
+
if (import_graphql52.isAbstractType(gatewayType) && import_graphql52.isAbstractType(subschemaType)) {
|
|
79355
79439
|
const possibleTypes = infoSchema.getPossibleTypes(gatewayType);
|
|
79356
79440
|
const possibleTypesInSubschema = transformedSchema.getPossibleTypes(subschemaType);
|
|
79357
79441
|
for (const possibleType of possibleTypes) {
|
|
@@ -79374,7 +79458,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79374
79458
|
const newSelections = /* @__PURE__ */ new Set;
|
|
79375
79459
|
const maybeType = typeInfo.getParentType();
|
|
79376
79460
|
if (maybeType != null) {
|
|
79377
|
-
const parentType =
|
|
79461
|
+
const parentType = import_graphql52.getNamedType(maybeType);
|
|
79378
79462
|
const parentTypeName = parentType.name;
|
|
79379
79463
|
const fieldNodes = fieldNodesByType[parentTypeName];
|
|
79380
79464
|
if (fieldNodes) {
|
|
@@ -79385,7 +79469,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79385
79469
|
const interfaceExtensions = interfaceExtensionsMap[parentType.name];
|
|
79386
79470
|
const interfaceExtensionFields = [];
|
|
79387
79471
|
for (const selection of node.selections) {
|
|
79388
|
-
if (selection.kind ===
|
|
79472
|
+
if (selection.kind === import_graphql52.Kind.INLINE_FRAGMENT) {
|
|
79389
79473
|
if (selection.typeCondition != null) {
|
|
79390
79474
|
if (!visitedSelections.has(selection)) {
|
|
79391
79475
|
visitedSelections.add(selection);
|
|
@@ -79396,19 +79480,19 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79396
79480
|
newSelections.add({
|
|
79397
79481
|
...selection,
|
|
79398
79482
|
typeCondition: {
|
|
79399
|
-
kind:
|
|
79483
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79400
79484
|
name: {
|
|
79401
|
-
kind:
|
|
79485
|
+
kind: import_graphql52.Kind.NAME,
|
|
79402
79486
|
value: extraPossibleTypeName
|
|
79403
79487
|
}
|
|
79404
79488
|
}
|
|
79405
79489
|
});
|
|
79406
79490
|
}
|
|
79407
79491
|
const typeInSubschema = transformedSchema.getType(typeName);
|
|
79408
|
-
if (
|
|
79492
|
+
if (import_graphql52.isObjectType(typeInSubschema) || import_graphql52.isInterfaceType(typeInSubschema)) {
|
|
79409
79493
|
const fieldMap = typeInSubschema.getFields();
|
|
79410
79494
|
for (const subSelection of selection.selectionSet.selections) {
|
|
79411
|
-
if (subSelection.kind ===
|
|
79495
|
+
if (subSelection.kind === import_graphql52.Kind.FIELD) {
|
|
79412
79496
|
const fieldName = subSelection.name.value;
|
|
79413
79497
|
const field = fieldMap[fieldName];
|
|
79414
79498
|
if (!field) {
|
|
@@ -79445,7 +79529,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79445
79529
|
} else {
|
|
79446
79530
|
newSelections.add(selection);
|
|
79447
79531
|
}
|
|
79448
|
-
} else if (selection.kind ===
|
|
79532
|
+
} else if (selection.kind === import_graphql52.Kind.FRAGMENT_SPREAD) {
|
|
79449
79533
|
const fragmentName = selection.name.value;
|
|
79450
79534
|
if (!fragmentReplacements[fragmentName]) {
|
|
79451
79535
|
newSelections.add(selection);
|
|
@@ -79456,9 +79540,9 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79456
79540
|
const maybeReplacementType = transformedSchema.getType(typeName);
|
|
79457
79541
|
if (maybeReplacementType != null && implementsAbstractType(transformedSchema, parentType, maybeType)) {
|
|
79458
79542
|
newSelections.add({
|
|
79459
|
-
kind:
|
|
79543
|
+
kind: import_graphql52.Kind.FRAGMENT_SPREAD,
|
|
79460
79544
|
name: {
|
|
79461
|
-
kind:
|
|
79545
|
+
kind: import_graphql52.Kind.NAME,
|
|
79462
79546
|
value: replacement.fragmentName
|
|
79463
79547
|
}
|
|
79464
79548
|
});
|
|
@@ -79466,7 +79550,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79466
79550
|
}
|
|
79467
79551
|
} else {
|
|
79468
79552
|
const fieldName = selection.name.value;
|
|
79469
|
-
if (
|
|
79553
|
+
if (import_graphql52.isAbstractType(parentType)) {
|
|
79470
79554
|
const fieldNodesForTypeName = fieldNodesByField[parentTypeName]?.["__typename"];
|
|
79471
79555
|
if (fieldNodesForTypeName) {
|
|
79472
79556
|
for (const fieldNode of fieldNodesForTypeName) {
|
|
@@ -79498,9 +79582,9 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79498
79582
|
}
|
|
79499
79583
|
if (reversePossibleTypesMap2[parentType.name]) {
|
|
79500
79584
|
newSelections.add({
|
|
79501
|
-
kind:
|
|
79585
|
+
kind: import_graphql52.Kind.FIELD,
|
|
79502
79586
|
name: {
|
|
79503
|
-
kind:
|
|
79587
|
+
kind: import_graphql52.Kind.NAME,
|
|
79504
79588
|
value: "__typename"
|
|
79505
79589
|
}
|
|
79506
79590
|
});
|
|
@@ -79510,7 +79594,7 @@ function visitSelectionSet(node, fragmentReplacements, transformedSchema, typeIn
|
|
|
79510
79594
|
if (possibleTypes != null) {
|
|
79511
79595
|
for (const possibleType of possibleTypes) {
|
|
79512
79596
|
newSelections.add(generateInlineFragment(possibleType, {
|
|
79513
|
-
kind:
|
|
79597
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79514
79598
|
selections: interfaceExtensionFields
|
|
79515
79599
|
}));
|
|
79516
79600
|
}
|
|
@@ -79538,11 +79622,11 @@ function addDependenciesNestedly(fieldNode, seenFieldNames, fieldNodesByField, n
|
|
|
79538
79622
|
}
|
|
79539
79623
|
function generateInlineFragment(typeName, selectionSet) {
|
|
79540
79624
|
return {
|
|
79541
|
-
kind:
|
|
79625
|
+
kind: import_graphql52.Kind.INLINE_FRAGMENT,
|
|
79542
79626
|
typeCondition: {
|
|
79543
|
-
kind:
|
|
79627
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79544
79628
|
name: {
|
|
79545
|
-
kind:
|
|
79629
|
+
kind: import_graphql52.Kind.NAME,
|
|
79546
79630
|
value: typeName
|
|
79547
79631
|
}
|
|
79548
79632
|
},
|
|
@@ -79556,9 +79640,9 @@ var getSchemaMetaData = memoize2((sourceSchema, targetSchema) => {
|
|
|
79556
79640
|
const interfaceExtensionsMap = /* @__PURE__ */ Object.create(null);
|
|
79557
79641
|
for (const typeName in typeMap) {
|
|
79558
79642
|
const type = typeMap[typeName];
|
|
79559
|
-
if (
|
|
79643
|
+
if (import_graphql52.isAbstractType(type)) {
|
|
79560
79644
|
const targetType = targetTypeMap[typeName];
|
|
79561
|
-
if (
|
|
79645
|
+
if (import_graphql52.isInterfaceType(type) && import_graphql52.isInterfaceType(targetType)) {
|
|
79562
79646
|
const targetTypeFields = targetType.getFields();
|
|
79563
79647
|
const sourceTypeFields = type.getFields();
|
|
79564
79648
|
const extensionFields = /* @__PURE__ */ Object.create(null);
|
|
@@ -79573,7 +79657,7 @@ var getSchemaMetaData = memoize2((sourceSchema, targetSchema) => {
|
|
|
79573
79657
|
interfaceExtensionsMap[typeName] = extensionFields;
|
|
79574
79658
|
}
|
|
79575
79659
|
}
|
|
79576
|
-
if (interfaceExtensionsMap[typeName] || !
|
|
79660
|
+
if (interfaceExtensionsMap[typeName] || !import_graphql52.isAbstractType(targetType)) {
|
|
79577
79661
|
const implementations = sourceSchema.getPossibleTypes(type);
|
|
79578
79662
|
possibleTypesMap[typeName] = [];
|
|
79579
79663
|
for (const impl of implementations) {
|
|
@@ -79630,15 +79714,15 @@ function getExpandedFragments(fragments, fragmentNames, possibleTypesMap) {
|
|
|
79630
79714
|
const name = generateFragmentName(possibleTypeName);
|
|
79631
79715
|
fragmentNames.add(name);
|
|
79632
79716
|
expandedFragments.push({
|
|
79633
|
-
kind:
|
|
79717
|
+
kind: import_graphql52.Kind.FRAGMENT_DEFINITION,
|
|
79634
79718
|
name: {
|
|
79635
|
-
kind:
|
|
79719
|
+
kind: import_graphql52.Kind.NAME,
|
|
79636
79720
|
value: name
|
|
79637
79721
|
},
|
|
79638
79722
|
typeCondition: {
|
|
79639
|
-
kind:
|
|
79723
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79640
79724
|
name: {
|
|
79641
|
-
kind:
|
|
79725
|
+
kind: import_graphql52.Kind.NAME,
|
|
79642
79726
|
value: possibleTypeName
|
|
79643
79727
|
}
|
|
79644
79728
|
},
|
|
@@ -79657,11 +79741,11 @@ function getExpandedFragments(fragments, fragmentNames, possibleTypesMap) {
|
|
|
79657
79741
|
};
|
|
79658
79742
|
}
|
|
79659
79743
|
function wrapConcreteTypes(returnType, targetSchema, document) {
|
|
79660
|
-
const namedType =
|
|
79661
|
-
if (
|
|
79744
|
+
const namedType = import_graphql52.getNamedType(returnType);
|
|
79745
|
+
if (import_graphql52.isLeafType(namedType)) {
|
|
79662
79746
|
return document;
|
|
79663
79747
|
}
|
|
79664
|
-
let possibleTypes =
|
|
79748
|
+
let possibleTypes = import_graphql52.isAbstractType(namedType) ? targetSchema.getPossibleTypes(namedType) : [namedType];
|
|
79665
79749
|
if (possibleTypes.length === 0) {
|
|
79666
79750
|
possibleTypes = [namedType];
|
|
79667
79751
|
}
|
|
@@ -79674,29 +79758,29 @@ function wrapConcreteTypes(returnType, targetSchema, document) {
|
|
|
79674
79758
|
InlineFragment: ["selectionSet"],
|
|
79675
79759
|
FragmentDefinition: ["selectionSet"]
|
|
79676
79760
|
};
|
|
79677
|
-
return
|
|
79678
|
-
[
|
|
79761
|
+
return import_graphql52.visit(document, import_graphql52.visitWithTypeInfo(typeInfo, {
|
|
79762
|
+
[import_graphql52.Kind.FRAGMENT_DEFINITION]: (node) => {
|
|
79679
79763
|
const typeName = node.typeCondition.name.value;
|
|
79680
79764
|
if (!rootTypeNames.has(typeName)) {
|
|
79681
79765
|
return false;
|
|
79682
79766
|
}
|
|
79683
79767
|
return;
|
|
79684
79768
|
},
|
|
79685
|
-
[
|
|
79769
|
+
[import_graphql52.Kind.FIELD]: (node) => {
|
|
79686
79770
|
const fieldType = typeInfo.getType();
|
|
79687
79771
|
if (fieldType) {
|
|
79688
|
-
const fieldNamedType =
|
|
79689
|
-
if (
|
|
79772
|
+
const fieldNamedType = import_graphql52.getNamedType(fieldType);
|
|
79773
|
+
if (import_graphql52.isAbstractType(fieldNamedType) && fieldNamedType.name !== namedType.name && possibleTypes.length > 0) {
|
|
79690
79774
|
return {
|
|
79691
79775
|
...node,
|
|
79692
79776
|
selectionSet: {
|
|
79693
|
-
kind:
|
|
79777
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79694
79778
|
selections: possibleTypes.map((possibleType) => ({
|
|
79695
|
-
kind:
|
|
79779
|
+
kind: import_graphql52.Kind.INLINE_FRAGMENT,
|
|
79696
79780
|
typeCondition: {
|
|
79697
|
-
kind:
|
|
79781
|
+
kind: import_graphql52.Kind.NAMED_TYPE,
|
|
79698
79782
|
name: {
|
|
79699
|
-
kind:
|
|
79783
|
+
kind: import_graphql52.Kind.NAME,
|
|
79700
79784
|
value: possibleType.name
|
|
79701
79785
|
}
|
|
79702
79786
|
},
|
|
@@ -79782,6 +79866,7 @@ function getDelegatingOperation(parentType, schema) {
|
|
|
79782
79866
|
return "query";
|
|
79783
79867
|
}
|
|
79784
79868
|
function createRequest({
|
|
79869
|
+
subgraphName,
|
|
79785
79870
|
sourceSchema,
|
|
79786
79871
|
sourceParentType,
|
|
79787
79872
|
sourceFieldName,
|
|
@@ -79811,7 +79896,7 @@ function createRequest({
|
|
|
79811
79896
|
}
|
|
79812
79897
|
}
|
|
79813
79898
|
newSelectionSet = selections.length ? {
|
|
79814
|
-
kind:
|
|
79899
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79815
79900
|
selections
|
|
79816
79901
|
} : undefined;
|
|
79817
79902
|
const args = fieldNodes?.[0]?.arguments;
|
|
@@ -79827,7 +79912,7 @@ function createRequest({
|
|
|
79827
79912
|
for (const def of variableDefinitions) {
|
|
79828
79913
|
const varName = def.variable.name.value;
|
|
79829
79914
|
variableDefinitionMap[varName] = def;
|
|
79830
|
-
const varType =
|
|
79915
|
+
const varType = import_graphql52.typeFromAST(sourceSchema, def.type);
|
|
79831
79916
|
const serializedValue = serializeInputValue(varType, variableValues?.[varName]);
|
|
79832
79917
|
if (serializedValue !== undefined) {
|
|
79833
79918
|
newVariables[varName] = serializedValue;
|
|
@@ -79843,26 +79928,26 @@ function createRequest({
|
|
|
79843
79928
|
throw new Error(`Either "targetFieldName" or a non empty "fieldNodes" array must be provided.`);
|
|
79844
79929
|
}
|
|
79845
79930
|
const rootfieldNode = {
|
|
79846
|
-
kind:
|
|
79931
|
+
kind: import_graphql52.Kind.FIELD,
|
|
79847
79932
|
arguments: Object.values(argumentNodeMap),
|
|
79848
79933
|
name: {
|
|
79849
|
-
kind:
|
|
79934
|
+
kind: import_graphql52.Kind.NAME,
|
|
79850
79935
|
value: rootFieldName
|
|
79851
79936
|
},
|
|
79852
79937
|
selectionSet: newSelectionSet,
|
|
79853
79938
|
directives: fieldNode?.directives
|
|
79854
79939
|
};
|
|
79855
79940
|
const operationName = targetOperationName ? {
|
|
79856
|
-
kind:
|
|
79941
|
+
kind: import_graphql52.Kind.NAME,
|
|
79857
79942
|
value: targetOperationName
|
|
79858
79943
|
} : undefined;
|
|
79859
79944
|
const operationDefinition = {
|
|
79860
|
-
kind:
|
|
79945
|
+
kind: import_graphql52.Kind.OPERATION_DEFINITION,
|
|
79861
79946
|
name: operationName,
|
|
79862
79947
|
operation: targetOperation,
|
|
79863
79948
|
variableDefinitions: Object.values(variableDefinitionMap),
|
|
79864
79949
|
selectionSet: {
|
|
79865
|
-
kind:
|
|
79950
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79866
79951
|
selections: [rootfieldNode]
|
|
79867
79952
|
}
|
|
79868
79953
|
};
|
|
@@ -79876,10 +79961,11 @@ function createRequest({
|
|
|
79876
79961
|
}
|
|
79877
79962
|
}
|
|
79878
79963
|
const document = {
|
|
79879
|
-
kind:
|
|
79964
|
+
kind: import_graphql52.Kind.DOCUMENT,
|
|
79880
79965
|
definitions
|
|
79881
79966
|
};
|
|
79882
79967
|
return {
|
|
79968
|
+
subgraphName,
|
|
79883
79969
|
document,
|
|
79884
79970
|
variables: newVariables,
|
|
79885
79971
|
rootValue: targetRootValue,
|
|
@@ -79912,7 +79998,7 @@ function defaultMergedResolver(parent, args, context, info) {
|
|
|
79912
79998
|
}
|
|
79913
79999
|
const responseKey = getResponseKeyFromInfo(info);
|
|
79914
80000
|
if (!isExternalObject(parent)) {
|
|
79915
|
-
return
|
|
80001
|
+
return import_graphql52.defaultFieldResolver(parent, args, context, info);
|
|
79916
80002
|
}
|
|
79917
80003
|
if (!Object.prototype.hasOwnProperty.call(parent, responseKey)) {
|
|
79918
80004
|
const leftOver = getPlanLeftOverFromParent(parent);
|
|
@@ -79982,7 +80068,7 @@ function handleLeftOver(parent, context, info, leftOver) {
|
|
|
79982
80068
|
}
|
|
79983
80069
|
if (selectionSets2.size) {
|
|
79984
80070
|
const selectionSet = {
|
|
79985
|
-
kind:
|
|
80071
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
79986
80072
|
selections: Array.from(selectionSets2).flatMap((selectionSet2) => selectionSet2.selections)
|
|
79987
80073
|
};
|
|
79988
80074
|
handleMaybePromise(() => flattenPromise(parent), (flattenedParent) => {
|
|
@@ -80000,7 +80086,7 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
80000
80086
|
if (resolver) {
|
|
80001
80087
|
Object.assign(leftOverParent, flattenedParent);
|
|
80002
80088
|
const selectionSet2 = {
|
|
80003
|
-
kind:
|
|
80089
|
+
kind: import_graphql52.Kind.SELECTION_SET,
|
|
80004
80090
|
selections: missingFieldNodes
|
|
80005
80091
|
};
|
|
80006
80092
|
handleMaybePromise(() => resolver(leftOverParent, context, info, possibleSubschema, selectionSet2, info.parentType, info.parentType), (resolverResult) => {
|
|
@@ -80010,7 +80096,7 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
80010
80096
|
}
|
|
80011
80097
|
} else {
|
|
80012
80098
|
for (const selectionNode of selectionSet.selections) {
|
|
80013
|
-
if (selectionNode.kind ===
|
|
80099
|
+
if (selectionNode.kind === import_graphql52.Kind.FIELD && selectionNode.selectionSet?.selections?.length) {
|
|
80014
80100
|
const responseKey = selectionNode.alias?.value ?? selectionNode.name.value;
|
|
80015
80101
|
const nestedParent = flattenedParent[responseKey];
|
|
80016
80102
|
const nestedSelectionSet = selectionNode.selectionSet;
|
|
@@ -80028,7 +80114,7 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
80028
80114
|
if (resolver) {
|
|
80029
80115
|
const res = await resolver(nestedParentItem, context, info, subschema, selectionSet2, info.parentType, info.parentType);
|
|
80030
80116
|
if (res) {
|
|
80031
|
-
handleResolverResult(res, subschema, selectionSet2, nestedParentItem, nestedParentItem[FIELD_SUBSCHEMA_MAP_SYMBOL] ||= /* @__PURE__ */ new Map, info,
|
|
80117
|
+
handleResolverResult(res, subschema, selectionSet2, nestedParentItem, nestedParentItem[FIELD_SUBSCHEMA_MAP_SYMBOL] ||= /* @__PURE__ */ new Map, info, import_graphql52.responsePathAsArray(info.path), nestedParentItem[UNPATHED_ERRORS_SYMBOL] ||= []);
|
|
80032
80118
|
}
|
|
80033
80119
|
}
|
|
80034
80120
|
}
|
|
@@ -80051,7 +80137,7 @@ function handleFlattenedParent(flattenedParent, leftOverParent, possibleSubschem
|
|
|
80051
80137
|
}
|
|
80052
80138
|
}
|
|
80053
80139
|
function handleDeferredResolverResult(resolverResult, possibleSubschema, selectionSet, leftOverParent, leftOver, context, info) {
|
|
80054
|
-
handleResolverResult(resolverResult, possibleSubschema, selectionSet, leftOverParent, leftOverParent[FIELD_SUBSCHEMA_MAP_SYMBOL], info,
|
|
80140
|
+
handleResolverResult(resolverResult, possibleSubschema, selectionSet, leftOverParent, leftOverParent[FIELD_SUBSCHEMA_MAP_SYMBOL], info, import_graphql52.responsePathAsArray(info.path), leftOverParent[UNPATHED_ERRORS_SYMBOL]);
|
|
80055
80141
|
const deferredFields = leftOver.missingFieldsParentDeferredMap.get(leftOverParent);
|
|
80056
80142
|
if (deferredFields) {
|
|
80057
80143
|
for (const [responseKey, deferred] of deferredFields) {
|
|
@@ -80093,7 +80179,7 @@ function parentSatisfiedSelectionSet(parent, selectionSet) {
|
|
|
80093
80179
|
}
|
|
80094
80180
|
const subschemas = /* @__PURE__ */ new Set;
|
|
80095
80181
|
for (const selection of selectionSet.selections) {
|
|
80096
|
-
if (selection.kind ===
|
|
80182
|
+
if (selection.kind === import_graphql52.Kind.FIELD) {
|
|
80097
80183
|
const responseKey = selection.alias?.value ?? selection.name.value;
|
|
80098
80184
|
if (parent[responseKey] === undefined) {
|
|
80099
80185
|
return;
|
|
@@ -80116,7 +80202,7 @@ function parentSatisfiedSelectionSet(parent, selectionSet) {
|
|
|
80116
80202
|
subschemas.add(subschema);
|
|
80117
80203
|
}
|
|
80118
80204
|
}
|
|
80119
|
-
} else if (selection.kind ===
|
|
80205
|
+
} else if (selection.kind === import_graphql52.Kind.INLINE_FRAGMENT) {
|
|
80120
80206
|
const inlineSatisfied = parentSatisfiedSelectionSet(parent, selection.selectionSet);
|
|
80121
80207
|
if (inlineSatisfied === undefined) {
|
|
80122
80208
|
return;
|
|
@@ -80180,6 +80266,7 @@ function delegateToSchema(options) {
|
|
|
80180
80266
|
context
|
|
80181
80267
|
} = options;
|
|
80182
80268
|
const request = createRequest({
|
|
80269
|
+
subgraphName: schema.name,
|
|
80183
80270
|
sourceSchema: info.schema,
|
|
80184
80271
|
sourceParentType: info.parentType,
|
|
80185
80272
|
sourceFieldName: info.fieldName,
|
|
@@ -80217,7 +80304,7 @@ function delegateRequest(options) {
|
|
|
80217
80304
|
}
|
|
80218
80305
|
return handleMaybePromise(() => getExecutor(delegationContext)(processedRequest), function handleExecutorResult(executorResult) {
|
|
80219
80306
|
if (isAsyncIterable(executorResult)) {
|
|
80220
|
-
if (delegationContext.operation === "query" &&
|
|
80307
|
+
if (delegationContext.operation === "query" && import_graphql52.isListType(delegationContext.returnType)) {
|
|
80221
80308
|
return new Repeater(async (push2, stop2) => {
|
|
80222
80309
|
const pushed = /* @__PURE__ */ new WeakSet;
|
|
80223
80310
|
let stopped = false;
|
|
@@ -80328,7 +80415,7 @@ function getDelegationContext({
|
|
|
80328
80415
|
};
|
|
80329
80416
|
}
|
|
80330
80417
|
function validateRequest(delegationContext, document) {
|
|
80331
|
-
const errors5 =
|
|
80418
|
+
const errors5 = import_graphql52.validate(delegationContext.targetSchema, document);
|
|
80332
80419
|
if (errors5.length > 0) {
|
|
80333
80420
|
if (errors5.length > 1) {
|
|
80334
80421
|
const combinedError = new AggregateError(errors5, errors5.map((error210) => error210.message).join(`,
|
|
@@ -80352,8 +80439,8 @@ function getExecutor(delegationContext) {
|
|
|
80352
80439
|
return executor2;
|
|
80353
80440
|
}
|
|
80354
80441
|
|
|
80355
|
-
// ../../node_modules/.bun/@graphql-tools+wrap@
|
|
80356
|
-
var
|
|
80442
|
+
// ../../node_modules/.bun/@graphql-tools+wrap@11.0.0+ded46c799560c44e/node_modules/@graphql-tools/wrap/dist/index.js
|
|
80443
|
+
var import_graphql53 = __toESM(require_graphql2(), 1);
|
|
80357
80444
|
function generateProxyingResolvers(subschemaConfig) {
|
|
80358
80445
|
const targetSchema = subschemaConfig.schema;
|
|
80359
80446
|
const createProxyingResolver = subschemaConfig.createProxyingResolver ?? defaultCreateProxyingResolver;
|
|
@@ -80439,21 +80526,21 @@ function createWrappingSchema(schema, proxyingResolvers) {
|
|
|
80439
80526
|
},
|
|
80440
80527
|
[MapperKind.OBJECT_TYPE]: (type) => {
|
|
80441
80528
|
const config3 = type.toConfig();
|
|
80442
|
-
return new
|
|
80529
|
+
return new import_graphql53.GraphQLObjectType({
|
|
80443
80530
|
...config3,
|
|
80444
80531
|
isTypeOf: undefined
|
|
80445
80532
|
});
|
|
80446
80533
|
},
|
|
80447
80534
|
[MapperKind.INTERFACE_TYPE]: (type) => {
|
|
80448
80535
|
const config3 = type.toConfig();
|
|
80449
|
-
return new
|
|
80536
|
+
return new import_graphql53.GraphQLInterfaceType({
|
|
80450
80537
|
...config3,
|
|
80451
80538
|
resolveType: undefined
|
|
80452
80539
|
});
|
|
80453
80540
|
},
|
|
80454
80541
|
[MapperKind.UNION_TYPE]: (type) => {
|
|
80455
80542
|
const config3 = type.toConfig();
|
|
80456
|
-
return new
|
|
80543
|
+
return new import_graphql53.GraphQLUnionType({
|
|
80457
80544
|
...config3,
|
|
80458
80545
|
resolveType: undefined
|
|
80459
80546
|
});
|
|
@@ -80467,14 +80554,14 @@ function createWrappingSchema(schema, proxyingResolvers) {
|
|
|
80467
80554
|
});
|
|
80468
80555
|
}
|
|
80469
80556
|
var getTypeInfo3 = memoize1(function getTypeInfo22(schema) {
|
|
80470
|
-
return new
|
|
80557
|
+
return new import_graphql53.TypeInfo(schema);
|
|
80471
80558
|
});
|
|
80472
80559
|
memoize2(function getTypeInfoWithType22(schema, type) {
|
|
80473
|
-
return
|
|
80560
|
+
return import_graphql53.versionInfo.major < 16 ? new import_graphql53.TypeInfo(schema, undefined, type) : new import_graphql53.TypeInfo(schema, type);
|
|
80474
80561
|
});
|
|
80475
80562
|
function getSchemaFromIntrospection(introspectionResult, options) {
|
|
80476
80563
|
if (introspectionResult?.data?.__schema) {
|
|
80477
|
-
return
|
|
80564
|
+
return import_graphql53.buildClientSchema(introspectionResult.data, options);
|
|
80478
80565
|
}
|
|
80479
80566
|
if (introspectionResult?.errors) {
|
|
80480
80567
|
const graphqlErrors = introspectionResult.errors.map((error43) => createGraphQLError(error43.message, error43));
|
|
@@ -80488,7 +80575,7 @@ function getSchemaFromIntrospection(introspectionResult, options) {
|
|
|
80488
80575
|
${inspect(introspectionResult)}`);
|
|
80489
80576
|
}
|
|
80490
80577
|
function schemaFromExecutor(executor2, context, options) {
|
|
80491
|
-
const parsedIntrospectionQuery =
|
|
80578
|
+
const parsedIntrospectionQuery = import_graphql53.parse(import_graphql53.getIntrospectionQuery(options), options);
|
|
80492
80579
|
return handleMaybePromise(() => handleMaybePromise(() => executor2({
|
|
80493
80580
|
document: parsedIntrospectionQuery,
|
|
80494
80581
|
context
|
|
@@ -80501,10 +80588,10 @@ function schemaFromExecutor(executor2, context, options) {
|
|
|
80501
80588
|
}), (introspection) => getSchemaFromIntrospection(introspection, options));
|
|
80502
80589
|
}
|
|
80503
80590
|
|
|
80504
|
-
// ../../node_modules/.bun/@graphql-tools+url-loader@
|
|
80591
|
+
// ../../node_modules/.bun/@graphql-tools+url-loader@9.0.0+ded46c799560c44e/node_modules/@graphql-tools/url-loader/esm/defaultAsyncFetch.js
|
|
80505
80592
|
var defaultAsyncFetch = $fetch;
|
|
80506
80593
|
|
|
80507
|
-
// ../../node_modules/.bun/@graphql-tools+url-loader@
|
|
80594
|
+
// ../../node_modules/.bun/@graphql-tools+url-loader@9.0.0+ded46c799560c44e/node_modules/@graphql-tools/url-loader/esm/defaultSyncFetch.js
|
|
80508
80595
|
var import_sync_fetch = __toESM(require_sync_fetch(), 1);
|
|
80509
80596
|
var defaultSyncFetch = (input, init) => {
|
|
80510
80597
|
if (typeof input === "string") {
|
|
@@ -80515,7 +80602,7 @@ var defaultSyncFetch = (input, init) => {
|
|
|
80515
80602
|
return import_sync_fetch.default(input, init);
|
|
80516
80603
|
};
|
|
80517
80604
|
|
|
80518
|
-
// ../../node_modules/.bun/@graphql-tools+url-loader@
|
|
80605
|
+
// ../../node_modules/.bun/@graphql-tools+url-loader@9.0.0+ded46c799560c44e/node_modules/@graphql-tools/url-loader/esm/index.js
|
|
80519
80606
|
var asyncImport = (moduleName) => import(`${moduleName}`);
|
|
80520
80607
|
var syncImport = (moduleName) => __require(`${moduleName}`);
|
|
80521
80608
|
var SubscriptionProtocol;
|
|
@@ -80667,7 +80754,7 @@ class UrlLoader {
|
|
|
80667
80754
|
if (!source.schema && !source.document && !source.rawSDL) {
|
|
80668
80755
|
throw new Error(`Invalid SDL response`);
|
|
80669
80756
|
}
|
|
80670
|
-
source.schema = source.schema || (source.document ?
|
|
80757
|
+
source.schema = source.schema || (source.document ? import_graphql54.buildASTSchema(source.document, options) : source.rawSDL ? import_graphql54.buildSchema(source.rawSDL, options) : undefined);
|
|
80671
80758
|
} else {
|
|
80672
80759
|
executor2 = this.getExecutorAsync(pointer, options);
|
|
80673
80760
|
source.schema = await schemaFromExecutor(executor2, {}, options);
|
|
@@ -80701,7 +80788,7 @@ class UrlLoader {
|
|
|
80701
80788
|
if (!source.schema && !source.document && !source.rawSDL) {
|
|
80702
80789
|
throw new Error(`Invalid SDL response`);
|
|
80703
80790
|
}
|
|
80704
|
-
source.schema = source.schema || (source.document ?
|
|
80791
|
+
source.schema = source.schema || (source.document ? import_graphql54.buildASTSchema(source.document, options) : source.rawSDL ? import_graphql54.buildSchema(source.rawSDL, options) : undefined);
|
|
80705
80792
|
} else {
|
|
80706
80793
|
executor2 = this.getExecutorSync(pointer, options);
|
|
80707
80794
|
source.schema = schemaFromExecutor(executor2, {}, options);
|
|
@@ -82110,7 +82197,7 @@ var portalQueries = (server, env3) => {
|
|
|
82110
82197
|
var package_default = {
|
|
82111
82198
|
name: "@settlemint/sdk-mcp",
|
|
82112
82199
|
description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
82113
|
-
version: "2.6.
|
|
82200
|
+
version: "2.6.2-main05babdc6",
|
|
82114
82201
|
type: "module",
|
|
82115
82202
|
private: false,
|
|
82116
82203
|
license: "FSL-1.1-MIT",
|
|
@@ -82151,10 +82238,10 @@ var package_default = {
|
|
|
82151
82238
|
dependencies: {
|
|
82152
82239
|
"@commander-js/extra-typings": "14.0.0",
|
|
82153
82240
|
"@graphql-tools/load": "8.1.2",
|
|
82154
|
-
"@graphql-tools/url-loader": "
|
|
82155
|
-
"@modelcontextprotocol/sdk": "1.17.
|
|
82156
|
-
"@settlemint/sdk-js": "2.6.
|
|
82157
|
-
"@settlemint/sdk-utils": "2.6.
|
|
82241
|
+
"@graphql-tools/url-loader": "9.0.0",
|
|
82242
|
+
"@modelcontextprotocol/sdk": "1.17.5",
|
|
82243
|
+
"@settlemint/sdk-js": "2.6.2-main05babdc6",
|
|
82244
|
+
"@settlemint/sdk-utils": "2.6.2-main05babdc6",
|
|
82158
82245
|
commander: "14.0.0",
|
|
82159
82246
|
graphql: "16.11.0",
|
|
82160
82247
|
zod: "^4",
|
|
@@ -82974,7 +83061,7 @@ var registerBlockchainConcepts = (server) => {
|
|
|
82974
83061
|
};
|
|
82975
83062
|
|
|
82976
83063
|
// src/utils/sdl.ts
|
|
82977
|
-
var
|
|
83064
|
+
var import_graphql55 = __toESM(require_graphql2(), 1);
|
|
82978
83065
|
var processFieldTypes = (fields2, schema, collectedTypes) => {
|
|
82979
83066
|
for (const field of Object.values(fields2)) {
|
|
82980
83067
|
collectCustomTypes(field.type, schema, collectedTypes);
|
|
@@ -82995,7 +83082,7 @@ var collectCustomTypes = (type, schema, collectedTypes = new Set) => {
|
|
|
82995
83082
|
return collectedTypes;
|
|
82996
83083
|
}
|
|
82997
83084
|
collectedTypes.add(typeName);
|
|
82998
|
-
if (
|
|
83085
|
+
if (import_graphql55.isInputObjectType(schemaType) || import_graphql55.isObjectType(schemaType)) {
|
|
82999
83086
|
const fields2 = schemaType.getFields();
|
|
83000
83087
|
processFieldTypes(fields2, schema, collectedTypes);
|
|
83001
83088
|
}
|
|
@@ -83005,7 +83092,7 @@ var generateTypeSDL = (typeName, schema) => {
|
|
|
83005
83092
|
const type = schema[typeName];
|
|
83006
83093
|
if (!type)
|
|
83007
83094
|
return "";
|
|
83008
|
-
if (
|
|
83095
|
+
if (import_graphql55.isInputObjectType(type)) {
|
|
83009
83096
|
const fields2 = type.getFields();
|
|
83010
83097
|
const fieldSDLs = Object.values(fields2).map((field) => ` ${field.name}: ${field.type}`).join(`
|
|
83011
83098
|
`);
|
|
@@ -83013,7 +83100,7 @@ var generateTypeSDL = (typeName, schema) => {
|
|
|
83013
83100
|
${fieldSDLs}
|
|
83014
83101
|
}`;
|
|
83015
83102
|
}
|
|
83016
|
-
if (
|
|
83103
|
+
if (import_graphql55.isObjectType(type)) {
|
|
83017
83104
|
const fields2 = type.getFields();
|
|
83018
83105
|
const fieldSDLs = Object.values(fields2).map((field) => {
|
|
83019
83106
|
const args = field.args.length > 0 ? `(${field.args.map((arg) => `${arg.name}: ${arg.type}`).join(", ")})` : "";
|
|
@@ -83514,7 +83601,7 @@ var parseRawRequestArgs = (queryOrOptions, variables, requestHeaders) => {
|
|
|
83514
83601
|
};
|
|
83515
83602
|
|
|
83516
83603
|
// ../../node_modules/.bun/graphql-request@7.2.0+ded46c799560c44e/node_modules/graphql-request/build/legacy/lib/graphql.js
|
|
83517
|
-
var
|
|
83604
|
+
var import_graphql56 = __toESM(require_graphql2(), 1);
|
|
83518
83605
|
|
|
83519
83606
|
// ../../node_modules/.bun/graphql-request@7.2.0+ded46c799560c44e/node_modules/graphql-request/build/lib/http.js
|
|
83520
83607
|
var ACCEPT_HEADER = `Accept`;
|
|
@@ -83582,12 +83669,12 @@ var parseExecutionResult = (result) => {
|
|
|
83582
83669
|
var isRequestResultHaveErrors = (result) => result._tag === `Batch` ? result.executionResults.some(isExecutionResultHaveErrors) : isExecutionResultHaveErrors(result.executionResult);
|
|
83583
83670
|
var isExecutionResultHaveErrors = (result) => Array.isArray(result.errors) ? result.errors.length > 0 : Boolean(result.errors);
|
|
83584
83671
|
var isOperationDefinitionNode = (definition) => {
|
|
83585
|
-
return typeof definition === `object` && definition !== null && `kind` in definition && definition.kind ===
|
|
83672
|
+
return typeof definition === `object` && definition !== null && `kind` in definition && definition.kind === import_graphql56.Kind.OPERATION_DEFINITION;
|
|
83586
83673
|
};
|
|
83587
83674
|
|
|
83588
83675
|
// ../../node_modules/.bun/graphql-request@7.2.0+ded46c799560c44e/node_modules/graphql-request/build/legacy/helpers/analyzeDocument.js
|
|
83676
|
+
var import_graphql58 = __toESM(require_graphql2(), 1);
|
|
83589
83677
|
var import_graphql59 = __toESM(require_graphql2(), 1);
|
|
83590
|
-
var import_graphql60 = __toESM(require_graphql2(), 1);
|
|
83591
83678
|
var extractOperationName = (document) => {
|
|
83592
83679
|
let operationName = undefined;
|
|
83593
83680
|
const defs = document.definitions.filter(isOperationDefinitionNode);
|
|
@@ -83605,13 +83692,13 @@ var extractIsMutation = (document) => {
|
|
|
83605
83692
|
return isMutation;
|
|
83606
83693
|
};
|
|
83607
83694
|
var analyzeDocument = (document, excludeOperationName) => {
|
|
83608
|
-
const expression = typeof document === `string` ? document :
|
|
83695
|
+
const expression = typeof document === `string` ? document : import_graphql59.print(document);
|
|
83609
83696
|
let isMutation = false;
|
|
83610
83697
|
let operationName = undefined;
|
|
83611
83698
|
if (excludeOperationName) {
|
|
83612
83699
|
return { expression, isMutation, operationName };
|
|
83613
83700
|
}
|
|
83614
|
-
const docNode = tryCatch(() => typeof document === `string` ?
|
|
83701
|
+
const docNode = tryCatch(() => typeof document === `string` ? import_graphql58.parse(document) : document);
|
|
83615
83702
|
if (docNode instanceof Error) {
|
|
83616
83703
|
return { expression, isMutation, operationName };
|
|
83617
83704
|
}
|
|
@@ -84815,36 +84902,6 @@ var BlockchainNetworkFragment = graphql(`
|
|
|
84815
84902
|
... on BesuIbftv2BlockchainNetwork {
|
|
84816
84903
|
chainId
|
|
84817
84904
|
}
|
|
84818
|
-
... on GethPoWBlockchainNetwork {
|
|
84819
|
-
chainId
|
|
84820
|
-
}
|
|
84821
|
-
... on GethPoSRinkebyBlockchainNetwork {
|
|
84822
|
-
chainId
|
|
84823
|
-
}
|
|
84824
|
-
... on GethVenidiumBlockchainNetwork {
|
|
84825
|
-
chainId
|
|
84826
|
-
}
|
|
84827
|
-
... on GethGoerliBlockchainNetwork {
|
|
84828
|
-
chainId
|
|
84829
|
-
}
|
|
84830
|
-
... on AvalancheBlockchainNetwork {
|
|
84831
|
-
chainId
|
|
84832
|
-
}
|
|
84833
|
-
... on AvalancheFujiBlockchainNetwork {
|
|
84834
|
-
chainId
|
|
84835
|
-
}
|
|
84836
|
-
... on BscPoWBlockchainNetwork {
|
|
84837
|
-
chainId
|
|
84838
|
-
}
|
|
84839
|
-
... on BscPoWTestnetBlockchainNetwork {
|
|
84840
|
-
chainId
|
|
84841
|
-
}
|
|
84842
|
-
... on PolygonBlockchainNetwork {
|
|
84843
|
-
chainId
|
|
84844
|
-
}
|
|
84845
|
-
... on PolygonMumbaiBlockchainNetwork {
|
|
84846
|
-
chainId
|
|
84847
|
-
}
|
|
84848
84905
|
... on PolygonEdgePoABlockchainNetwork {
|
|
84849
84906
|
chainId
|
|
84850
84907
|
}
|
|
@@ -84854,6 +84911,9 @@ var BlockchainNetworkFragment = graphql(`
|
|
|
84854
84911
|
... on GethCliqueBlockchainNetwork {
|
|
84855
84912
|
chainId
|
|
84856
84913
|
}
|
|
84914
|
+
... on PublicEvmBlockchainNetwork {
|
|
84915
|
+
chainId
|
|
84916
|
+
}
|
|
84857
84917
|
blockchainNodes {
|
|
84858
84918
|
... on BlockchainNode {
|
|
84859
84919
|
id
|
|
@@ -84912,6 +84972,7 @@ var createBlockchainNetwork = graphql(`
|
|
|
84912
84972
|
$quorumGenesis: QuorumGenesisInput
|
|
84913
84973
|
$externalNodes: [BlockchainNetworkExternalNodeInput!]
|
|
84914
84974
|
$privateKeyId: ID
|
|
84975
|
+
$includePredeployedContracts: Boolean
|
|
84915
84976
|
) {
|
|
84916
84977
|
createBlockchainNetwork(
|
|
84917
84978
|
applicationId: $applicationId
|
|
@@ -84940,6 +85001,7 @@ var createBlockchainNetwork = graphql(`
|
|
|
84940
85001
|
quorumGenesis: $quorumGenesis
|
|
84941
85002
|
externalNodes: $externalNodes
|
|
84942
85003
|
keyMaterial: $privateKeyId
|
|
85004
|
+
includePredeployedContracts: $includePredeployedContracts
|
|
84943
85005
|
) {
|
|
84944
85006
|
...BlockchainNetwork
|
|
84945
85007
|
}
|
|
@@ -85047,36 +85109,6 @@ var BlockchainNodeFragment = graphql(`
|
|
|
85047
85109
|
... on BesuIbftv2BlockchainNetwork {
|
|
85048
85110
|
chainId
|
|
85049
85111
|
}
|
|
85050
|
-
... on GethPoWBlockchainNetwork {
|
|
85051
|
-
chainId
|
|
85052
|
-
}
|
|
85053
|
-
... on GethPoSRinkebyBlockchainNetwork {
|
|
85054
|
-
chainId
|
|
85055
|
-
}
|
|
85056
|
-
... on GethVenidiumBlockchainNetwork {
|
|
85057
|
-
chainId
|
|
85058
|
-
}
|
|
85059
|
-
... on GethGoerliBlockchainNetwork {
|
|
85060
|
-
chainId
|
|
85061
|
-
}
|
|
85062
|
-
... on AvalancheBlockchainNetwork {
|
|
85063
|
-
chainId
|
|
85064
|
-
}
|
|
85065
|
-
... on AvalancheFujiBlockchainNetwork {
|
|
85066
|
-
chainId
|
|
85067
|
-
}
|
|
85068
|
-
... on BscPoWBlockchainNetwork {
|
|
85069
|
-
chainId
|
|
85070
|
-
}
|
|
85071
|
-
... on BscPoWTestnetBlockchainNetwork {
|
|
85072
|
-
chainId
|
|
85073
|
-
}
|
|
85074
|
-
... on PolygonBlockchainNetwork {
|
|
85075
|
-
chainId
|
|
85076
|
-
}
|
|
85077
|
-
... on PolygonMumbaiBlockchainNetwork {
|
|
85078
|
-
chainId
|
|
85079
|
-
}
|
|
85080
85112
|
... on PolygonEdgePoABlockchainNetwork {
|
|
85081
85113
|
chainId
|
|
85082
85114
|
}
|
|
@@ -85086,6 +85118,9 @@ var BlockchainNodeFragment = graphql(`
|
|
|
85086
85118
|
... on GethCliqueBlockchainNetwork {
|
|
85087
85119
|
chainId
|
|
85088
85120
|
}
|
|
85121
|
+
... on PublicEvmBlockchainNetwork {
|
|
85122
|
+
chainId
|
|
85123
|
+
}
|
|
85089
85124
|
}
|
|
85090
85125
|
}
|
|
85091
85126
|
privateKeys {
|
|
@@ -88275,4 +88310,4 @@ await main().catch((error44) => {
|
|
|
88275
88310
|
process.exit(1);
|
|
88276
88311
|
});
|
|
88277
88312
|
|
|
88278
|
-
//# debugId=
|
|
88313
|
+
//# debugId=A453963D1C66648164756E2164756E21
|