houdini 1.5.3 → 1.5.4
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/build/cmd-cjs/index.js +418 -544
- package/build/cmd-esm/index.js +268 -394
- package/build/codegen/generators/runtime/index.d.ts +2 -7
- package/build/codegen/generators/runtime/pluginRuntime.d.ts +8 -1
- package/build/codegen-cjs/index.js +389 -389
- package/build/codegen-esm/index.js +239 -239
- package/build/lib/router/conventions.d.ts +1 -1
- package/build/lib/router/manifest.d.ts +1 -1
- package/build/lib/typescript.d.ts +1 -1
- package/build/lib-cjs/index.js +665 -663
- package/build/lib-esm/index.js +665 -663
- package/build/test-cjs/index.js +398 -398
- package/build/test-esm/index.js +248 -248
- package/build/vite-cjs/index.js +741 -739
- package/build/vite-esm/index.js +631 -629
- package/package.json +1 -1
package/build/test-cjs/index.js
CHANGED
|
@@ -52337,7 +52337,7 @@ async function runPipeline(config, pipeline, target) {
|
|
|
52337
52337
|
}
|
|
52338
52338
|
|
|
52339
52339
|
// src/lib/config.ts
|
|
52340
|
-
var
|
|
52340
|
+
var graphql5 = __toESM(require("graphql"), 1);
|
|
52341
52341
|
var import_minimatch8 = __toESM(require_minimatch(), 1);
|
|
52342
52342
|
var import_node_url3 = require("node:url");
|
|
52343
52343
|
|
|
@@ -58245,10 +58245,219 @@ var graphql = __toESM(require("graphql"), 1);
|
|
|
58245
58245
|
|
|
58246
58246
|
// src/lib/router/manifest.ts
|
|
58247
58247
|
var t = __toESM(require_lib5(), 1);
|
|
58248
|
+
var graphql3 = __toESM(require("graphql"), 1);
|
|
58249
|
+
|
|
58250
|
+
// src/lib/graphql.ts
|
|
58248
58251
|
var graphql2 = __toESM(require("graphql"), 1);
|
|
58252
|
+
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
58253
|
+
function getRootType(type) {
|
|
58254
|
+
if (graphql2.isNonNullType(type)) {
|
|
58255
|
+
return getRootType(type.ofType);
|
|
58256
|
+
}
|
|
58257
|
+
if (graphql2.isListType(type)) {
|
|
58258
|
+
return getRootType(type.ofType);
|
|
58259
|
+
}
|
|
58260
|
+
return type;
|
|
58261
|
+
}
|
|
58262
|
+
function hashOriginal({ document }) {
|
|
58263
|
+
return hashDocument(document.originalString);
|
|
58264
|
+
}
|
|
58265
|
+
function hashRaw({ document }) {
|
|
58266
|
+
return hashDocument(document.artifact?.raw);
|
|
58267
|
+
}
|
|
58268
|
+
function hashDocument(str) {
|
|
58269
|
+
return import_node_crypto.default.createHash("sha256").update(str || "").digest("hex");
|
|
58270
|
+
}
|
|
58271
|
+
function parentField(ancestors) {
|
|
58272
|
+
return walkParentField([...ancestors].sort(() => -1));
|
|
58273
|
+
}
|
|
58274
|
+
function walkParentField(ancestors) {
|
|
58275
|
+
let head = ancestors.shift();
|
|
58276
|
+
if (Array.isArray(head) || head.kind === "SelectionSet") {
|
|
58277
|
+
return walkParentField(ancestors);
|
|
58278
|
+
}
|
|
58279
|
+
return head;
|
|
58280
|
+
}
|
|
58281
|
+
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
58282
|
+
const parents = [...ancestors];
|
|
58283
|
+
parents.reverse();
|
|
58284
|
+
return walkAncestors(schema, filepath, parents);
|
|
58285
|
+
}
|
|
58286
|
+
function walkAncestors(schema, filepath, ancestors) {
|
|
58287
|
+
let head = ancestors.shift();
|
|
58288
|
+
if (Array.isArray(head)) {
|
|
58289
|
+
return walkAncestors(schema, filepath, ancestors);
|
|
58290
|
+
}
|
|
58291
|
+
if (!head) {
|
|
58292
|
+
throw new HoudiniError({ filepath, message: "Could not figure out type of field" });
|
|
58293
|
+
}
|
|
58294
|
+
if (head.kind === "OperationDefinition") {
|
|
58295
|
+
const operationType = {
|
|
58296
|
+
query: schema.getQueryType(),
|
|
58297
|
+
mutation: schema.getMutationType(),
|
|
58298
|
+
subscription: schema.getSubscriptionType()
|
|
58299
|
+
}[head.operation];
|
|
58300
|
+
if (!operationType) {
|
|
58301
|
+
throw new HoudiniError({ filepath, message: "Could not find operation type" });
|
|
58302
|
+
}
|
|
58303
|
+
return operationType;
|
|
58304
|
+
}
|
|
58305
|
+
if (head.kind === "FragmentDefinition") {
|
|
58306
|
+
const result = schema.getType(head.typeCondition.name.value);
|
|
58307
|
+
if (!result) {
|
|
58308
|
+
throw new HoudiniError({
|
|
58309
|
+
filepath,
|
|
58310
|
+
message: `Could not find definition for ${head.typeCondition.name.value} in the schema`
|
|
58311
|
+
});
|
|
58312
|
+
}
|
|
58313
|
+
return result;
|
|
58314
|
+
}
|
|
58315
|
+
if (head.kind === "FragmentSpread") {
|
|
58316
|
+
throw new Error("How the hell did this happen?");
|
|
58317
|
+
}
|
|
58318
|
+
const parent2 = walkAncestors(schema, filepath, ancestors);
|
|
58319
|
+
if (head.kind === "InlineFragment") {
|
|
58320
|
+
if (!head.typeCondition) {
|
|
58321
|
+
return parent2;
|
|
58322
|
+
}
|
|
58323
|
+
const wrapper = schema.getType(head.typeCondition.name.value);
|
|
58324
|
+
if (!wrapper) {
|
|
58325
|
+
throw new HoudiniError({
|
|
58326
|
+
filepath,
|
|
58327
|
+
message: "Could not find type with name: " + head.typeCondition.name.value
|
|
58328
|
+
});
|
|
58329
|
+
}
|
|
58330
|
+
return wrapper;
|
|
58331
|
+
}
|
|
58332
|
+
if (head.kind === "SelectionSet") {
|
|
58333
|
+
return parent2;
|
|
58334
|
+
}
|
|
58335
|
+
const field = parent2.getFields()[head.name.value];
|
|
58336
|
+
if (!field) {
|
|
58337
|
+
throw new HoudiniError({
|
|
58338
|
+
filepath,
|
|
58339
|
+
message: `Could not find definition of ${head.name.value} in ${parent2.toString()}`
|
|
58340
|
+
});
|
|
58341
|
+
}
|
|
58342
|
+
return getRootType(field.type);
|
|
58343
|
+
}
|
|
58344
|
+
function definitionFromAncestors(ancestors) {
|
|
58345
|
+
let parents = [...ancestors];
|
|
58346
|
+
parents.shift();
|
|
58347
|
+
let definition = parents.shift();
|
|
58348
|
+
while (Array.isArray(definition) && definition) {
|
|
58349
|
+
definition = parents.shift();
|
|
58350
|
+
}
|
|
58351
|
+
return { parents, definition };
|
|
58352
|
+
}
|
|
58353
|
+
function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
|
|
58354
|
+
if (type.kind === "NonNullType") {
|
|
58355
|
+
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
58356
|
+
}
|
|
58357
|
+
if (type instanceof graphql2.GraphQLNonNull) {
|
|
58358
|
+
return unwrapType(config, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
58359
|
+
}
|
|
58360
|
+
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
58361
|
+
wrappers.unshift(TypeWrapper.Nullable);
|
|
58362
|
+
}
|
|
58363
|
+
if (type.kind === "ListType") {
|
|
58364
|
+
return unwrapType(config, type.type, [TypeWrapper.List, ...wrappers]);
|
|
58365
|
+
}
|
|
58366
|
+
if (type instanceof graphql2.GraphQLList) {
|
|
58367
|
+
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
58368
|
+
}
|
|
58369
|
+
if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
58370
|
+
type = config.schema.getType(
|
|
58371
|
+
config.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
58372
|
+
);
|
|
58373
|
+
}
|
|
58374
|
+
const namedType = config.schema.getType(type.name.value || type.name);
|
|
58375
|
+
if (!namedType) {
|
|
58376
|
+
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
58377
|
+
}
|
|
58378
|
+
return { type: namedType, wrappers };
|
|
58379
|
+
}
|
|
58380
|
+
function wrapType({
|
|
58381
|
+
type,
|
|
58382
|
+
wrappers
|
|
58383
|
+
}) {
|
|
58384
|
+
const head = wrappers[0];
|
|
58385
|
+
const tail = wrappers.slice(1);
|
|
58386
|
+
let kind = graphql2.Kind.NAMED_TYPE;
|
|
58387
|
+
if (head === TypeWrapper.List) {
|
|
58388
|
+
kind = graphql2.Kind.LIST_TYPE;
|
|
58389
|
+
} else if (head === TypeWrapper.NonNull) {
|
|
58390
|
+
kind = graphql2.Kind.NON_NULL_TYPE;
|
|
58391
|
+
}
|
|
58392
|
+
if (kind === "NamedType") {
|
|
58393
|
+
return {
|
|
58394
|
+
kind,
|
|
58395
|
+
name: {
|
|
58396
|
+
kind: graphql2.Kind.NAME,
|
|
58397
|
+
value: type.name
|
|
58398
|
+
}
|
|
58399
|
+
};
|
|
58400
|
+
}
|
|
58401
|
+
return {
|
|
58402
|
+
kind,
|
|
58403
|
+
type: wrapType({ type, wrappers: tail })
|
|
58404
|
+
};
|
|
58405
|
+
}
|
|
58406
|
+
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
58407
|
+
TypeWrapper2["Nullable"] = "Nullable";
|
|
58408
|
+
TypeWrapper2["List"] = "List";
|
|
58409
|
+
TypeWrapper2["NonNull"] = "NonNull";
|
|
58410
|
+
return TypeWrapper2;
|
|
58411
|
+
})(TypeWrapper || {});
|
|
58412
|
+
|
|
58413
|
+
// src/lib/parse.ts
|
|
58414
|
+
var import_parser = __toESM(require_lib6(), 1);
|
|
58415
|
+
var import_recast = __toESM(require_main2(), 1);
|
|
58416
|
+
|
|
58417
|
+
// src/lib/deepMerge.ts
|
|
58418
|
+
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
58419
|
+
function deepMerge2(filepath, ...targets) {
|
|
58420
|
+
try {
|
|
58421
|
+
if (targets.length === 1) {
|
|
58422
|
+
return targets[0];
|
|
58423
|
+
} else if (targets.length === 2) {
|
|
58424
|
+
return (0, import_deepmerge.default)(targets[0], targets[1], {
|
|
58425
|
+
arrayMerge: (source, update) => [...new Set(source.concat(update))]
|
|
58426
|
+
});
|
|
58427
|
+
}
|
|
58428
|
+
return deepMerge2(filepath, targets[0], deepMerge2(filepath, ...targets.slice(1)));
|
|
58429
|
+
} catch (e) {
|
|
58430
|
+
throw new HoudiniError({
|
|
58431
|
+
filepath,
|
|
58432
|
+
message: "could not merge: " + JSON.stringify(targets, null, 4),
|
|
58433
|
+
description: e.message
|
|
58434
|
+
});
|
|
58435
|
+
}
|
|
58436
|
+
}
|
|
58437
|
+
|
|
58438
|
+
// src/lib/parse.ts
|
|
58439
|
+
function parseJS(str, config) {
|
|
58440
|
+
const defaultConfig = {
|
|
58441
|
+
plugins: [
|
|
58442
|
+
"typescript",
|
|
58443
|
+
"importAssertions",
|
|
58444
|
+
"decorators-legacy",
|
|
58445
|
+
"explicitResourceManagement"
|
|
58446
|
+
],
|
|
58447
|
+
sourceType: "module"
|
|
58448
|
+
};
|
|
58449
|
+
return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
|
|
58450
|
+
}
|
|
58451
|
+
async function printJS(script, options) {
|
|
58452
|
+
if (options?.pretty) {
|
|
58453
|
+
return (0, import_recast.prettyPrint)(script, options);
|
|
58454
|
+
} else {
|
|
58455
|
+
return (0, import_recast.print)(script, options);
|
|
58456
|
+
}
|
|
58457
|
+
}
|
|
58249
58458
|
|
|
58250
58459
|
// src/lib/router/server.ts
|
|
58251
|
-
var
|
|
58460
|
+
var graphql4 = __toESM(require("graphql"), 1);
|
|
58252
58461
|
|
|
58253
58462
|
// src/runtime/lib/flatten.ts
|
|
58254
58463
|
function flatten(source) {
|
|
@@ -60661,7 +60870,7 @@ var Config = class {
|
|
|
60661
60870
|
persistedQueriesPath
|
|
60662
60871
|
} = this.configFile;
|
|
60663
60872
|
if (typeof schema === "string") {
|
|
60664
|
-
this.schema =
|
|
60873
|
+
this.schema = graphql5.buildSchema(schema);
|
|
60665
60874
|
} else {
|
|
60666
60875
|
this.schema = schema;
|
|
60667
60876
|
}
|
|
@@ -60809,7 +61018,7 @@ var Config = class {
|
|
|
60809
61018
|
set newSchema(value) {
|
|
60810
61019
|
this.schemaString = value;
|
|
60811
61020
|
if (value) {
|
|
60812
|
-
this.#newSchemaInstance =
|
|
61021
|
+
this.#newSchemaInstance = graphql5.buildSchema(value);
|
|
60813
61022
|
} else {
|
|
60814
61023
|
this.#newSchemaInstance = null;
|
|
60815
61024
|
}
|
|
@@ -60899,21 +61108,21 @@ var Config = class {
|
|
|
60899
61108
|
}
|
|
60900
61109
|
documentName(document) {
|
|
60901
61110
|
const operation = document.definitions.find(
|
|
60902
|
-
({ kind }) => kind ===
|
|
61111
|
+
({ kind }) => kind === graphql5.Kind.OPERATION_DEFINITION
|
|
60903
61112
|
);
|
|
60904
61113
|
if (operation) {
|
|
60905
61114
|
if (!operation.name) {
|
|
60906
|
-
throw new Error("encountered operation with no name: " +
|
|
61115
|
+
throw new Error("encountered operation with no name: " + graphql5.print(document));
|
|
60907
61116
|
}
|
|
60908
61117
|
return operation.name.value;
|
|
60909
61118
|
}
|
|
60910
61119
|
const fragmentDefinitions = document.definitions.filter(
|
|
60911
|
-
({ kind }) => kind ===
|
|
61120
|
+
({ kind }) => kind === graphql5.Kind.FRAGMENT_DEFINITION
|
|
60912
61121
|
);
|
|
60913
61122
|
if (fragmentDefinitions.length) {
|
|
60914
61123
|
return fragmentDefinitions[0].name.value;
|
|
60915
61124
|
}
|
|
60916
|
-
throw new Error("Could not generate artifact name for document: " +
|
|
61125
|
+
throw new Error("Could not generate artifact name for document: " + graphql5.print(document));
|
|
60917
61126
|
}
|
|
60918
61127
|
isSelectionScalar(type) {
|
|
60919
61128
|
return ["String", "Boolean", "Float", "ID", "Int"].concat(Object.keys(this.scalars || {})).includes(type);
|
|
@@ -61123,10 +61332,10 @@ var Config = class {
|
|
|
61123
61332
|
localDocumentData(document) {
|
|
61124
61333
|
let paginated = false;
|
|
61125
61334
|
let componentFields3 = [];
|
|
61126
|
-
const typeInfo = new
|
|
61127
|
-
|
|
61335
|
+
const typeInfo = new graphql5.TypeInfo(this.schema);
|
|
61336
|
+
graphql5.visit(
|
|
61128
61337
|
document,
|
|
61129
|
-
|
|
61338
|
+
graphql5.visitWithTypeInfo(typeInfo, {
|
|
61130
61339
|
Directive: (node) => {
|
|
61131
61340
|
if ([this.paginateDirective].includes(node.name.value)) {
|
|
61132
61341
|
paginated = true;
|
|
@@ -61263,218 +61472,9 @@ function findModule(pkg = "houdini", currentLocation) {
|
|
|
61263
61472
|
}
|
|
61264
61473
|
return locationFound;
|
|
61265
61474
|
}
|
|
61266
|
-
var emptySchema =
|
|
61475
|
+
var emptySchema = graphql5.buildSchema("type Query { hello: String }");
|
|
61267
61476
|
var defaultDirectives = emptySchema.getDirectives().map((dir) => dir.name);
|
|
61268
61477
|
|
|
61269
|
-
// src/lib/graphql.ts
|
|
61270
|
-
var graphql5 = __toESM(require("graphql"), 1);
|
|
61271
|
-
var import_node_crypto = __toESM(require("node:crypto"), 1);
|
|
61272
|
-
function getRootType(type) {
|
|
61273
|
-
if (graphql5.isNonNullType(type)) {
|
|
61274
|
-
return getRootType(type.ofType);
|
|
61275
|
-
}
|
|
61276
|
-
if (graphql5.isListType(type)) {
|
|
61277
|
-
return getRootType(type.ofType);
|
|
61278
|
-
}
|
|
61279
|
-
return type;
|
|
61280
|
-
}
|
|
61281
|
-
function hashOriginal({ document }) {
|
|
61282
|
-
return hashDocument(document.originalString);
|
|
61283
|
-
}
|
|
61284
|
-
function hashRaw({ document }) {
|
|
61285
|
-
return hashDocument(document.artifact?.raw);
|
|
61286
|
-
}
|
|
61287
|
-
function hashDocument(str) {
|
|
61288
|
-
return import_node_crypto.default.createHash("sha256").update(str || "").digest("hex");
|
|
61289
|
-
}
|
|
61290
|
-
function parentField(ancestors) {
|
|
61291
|
-
return walkParentField([...ancestors].sort(() => -1));
|
|
61292
|
-
}
|
|
61293
|
-
function walkParentField(ancestors) {
|
|
61294
|
-
let head = ancestors.shift();
|
|
61295
|
-
if (Array.isArray(head) || head.kind === "SelectionSet") {
|
|
61296
|
-
return walkParentField(ancestors);
|
|
61297
|
-
}
|
|
61298
|
-
return head;
|
|
61299
|
-
}
|
|
61300
|
-
function parentTypeFromAncestors(schema, filepath, ancestors) {
|
|
61301
|
-
const parents = [...ancestors];
|
|
61302
|
-
parents.reverse();
|
|
61303
|
-
return walkAncestors(schema, filepath, parents);
|
|
61304
|
-
}
|
|
61305
|
-
function walkAncestors(schema, filepath, ancestors) {
|
|
61306
|
-
let head = ancestors.shift();
|
|
61307
|
-
if (Array.isArray(head)) {
|
|
61308
|
-
return walkAncestors(schema, filepath, ancestors);
|
|
61309
|
-
}
|
|
61310
|
-
if (!head) {
|
|
61311
|
-
throw new HoudiniError({ filepath, message: "Could not figure out type of field" });
|
|
61312
|
-
}
|
|
61313
|
-
if (head.kind === "OperationDefinition") {
|
|
61314
|
-
const operationType = {
|
|
61315
|
-
query: schema.getQueryType(),
|
|
61316
|
-
mutation: schema.getMutationType(),
|
|
61317
|
-
subscription: schema.getSubscriptionType()
|
|
61318
|
-
}[head.operation];
|
|
61319
|
-
if (!operationType) {
|
|
61320
|
-
throw new HoudiniError({ filepath, message: "Could not find operation type" });
|
|
61321
|
-
}
|
|
61322
|
-
return operationType;
|
|
61323
|
-
}
|
|
61324
|
-
if (head.kind === "FragmentDefinition") {
|
|
61325
|
-
const result = schema.getType(head.typeCondition.name.value);
|
|
61326
|
-
if (!result) {
|
|
61327
|
-
throw new HoudiniError({
|
|
61328
|
-
filepath,
|
|
61329
|
-
message: `Could not find definition for ${head.typeCondition.name.value} in the schema`
|
|
61330
|
-
});
|
|
61331
|
-
}
|
|
61332
|
-
return result;
|
|
61333
|
-
}
|
|
61334
|
-
if (head.kind === "FragmentSpread") {
|
|
61335
|
-
throw new Error("How the hell did this happen?");
|
|
61336
|
-
}
|
|
61337
|
-
const parent2 = walkAncestors(schema, filepath, ancestors);
|
|
61338
|
-
if (head.kind === "InlineFragment") {
|
|
61339
|
-
if (!head.typeCondition) {
|
|
61340
|
-
return parent2;
|
|
61341
|
-
}
|
|
61342
|
-
const wrapper = schema.getType(head.typeCondition.name.value);
|
|
61343
|
-
if (!wrapper) {
|
|
61344
|
-
throw new HoudiniError({
|
|
61345
|
-
filepath,
|
|
61346
|
-
message: "Could not find type with name: " + head.typeCondition.name.value
|
|
61347
|
-
});
|
|
61348
|
-
}
|
|
61349
|
-
return wrapper;
|
|
61350
|
-
}
|
|
61351
|
-
if (head.kind === "SelectionSet") {
|
|
61352
|
-
return parent2;
|
|
61353
|
-
}
|
|
61354
|
-
const field = parent2.getFields()[head.name.value];
|
|
61355
|
-
if (!field) {
|
|
61356
|
-
throw new HoudiniError({
|
|
61357
|
-
filepath,
|
|
61358
|
-
message: `Could not find definition of ${head.name.value} in ${parent2.toString()}`
|
|
61359
|
-
});
|
|
61360
|
-
}
|
|
61361
|
-
return getRootType(field.type);
|
|
61362
|
-
}
|
|
61363
|
-
function definitionFromAncestors(ancestors) {
|
|
61364
|
-
let parents = [...ancestors];
|
|
61365
|
-
parents.shift();
|
|
61366
|
-
let definition = parents.shift();
|
|
61367
|
-
while (Array.isArray(definition) && definition) {
|
|
61368
|
-
definition = parents.shift();
|
|
61369
|
-
}
|
|
61370
|
-
return { parents, definition };
|
|
61371
|
-
}
|
|
61372
|
-
function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
|
|
61373
|
-
if (type.kind === "NonNullType") {
|
|
61374
|
-
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
61375
|
-
}
|
|
61376
|
-
if (type instanceof graphql5.GraphQLNonNull) {
|
|
61377
|
-
return unwrapType(config, type.ofType, [TypeWrapper.NonNull, ...wrappers]);
|
|
61378
|
-
}
|
|
61379
|
-
if (wrappers[0] !== TypeWrapper.NonNull) {
|
|
61380
|
-
wrappers.unshift(TypeWrapper.Nullable);
|
|
61381
|
-
}
|
|
61382
|
-
if (type.kind === "ListType") {
|
|
61383
|
-
return unwrapType(config, type.type, [TypeWrapper.List, ...wrappers]);
|
|
61384
|
-
}
|
|
61385
|
-
if (type instanceof graphql5.GraphQLList) {
|
|
61386
|
-
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
61387
|
-
}
|
|
61388
|
-
if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
61389
|
-
type = config.schema.getType(
|
|
61390
|
-
config.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
61391
|
-
);
|
|
61392
|
-
}
|
|
61393
|
-
const namedType = config.schema.getType(type.name.value || type.name);
|
|
61394
|
-
if (!namedType) {
|
|
61395
|
-
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
61396
|
-
}
|
|
61397
|
-
return { type: namedType, wrappers };
|
|
61398
|
-
}
|
|
61399
|
-
function wrapType({
|
|
61400
|
-
type,
|
|
61401
|
-
wrappers
|
|
61402
|
-
}) {
|
|
61403
|
-
const head = wrappers[0];
|
|
61404
|
-
const tail = wrappers.slice(1);
|
|
61405
|
-
let kind = graphql5.Kind.NAMED_TYPE;
|
|
61406
|
-
if (head === TypeWrapper.List) {
|
|
61407
|
-
kind = graphql5.Kind.LIST_TYPE;
|
|
61408
|
-
} else if (head === TypeWrapper.NonNull) {
|
|
61409
|
-
kind = graphql5.Kind.NON_NULL_TYPE;
|
|
61410
|
-
}
|
|
61411
|
-
if (kind === "NamedType") {
|
|
61412
|
-
return {
|
|
61413
|
-
kind,
|
|
61414
|
-
name: {
|
|
61415
|
-
kind: graphql5.Kind.NAME,
|
|
61416
|
-
value: type.name
|
|
61417
|
-
}
|
|
61418
|
-
};
|
|
61419
|
-
}
|
|
61420
|
-
return {
|
|
61421
|
-
kind,
|
|
61422
|
-
type: wrapType({ type, wrappers: tail })
|
|
61423
|
-
};
|
|
61424
|
-
}
|
|
61425
|
-
var TypeWrapper = /* @__PURE__ */ ((TypeWrapper2) => {
|
|
61426
|
-
TypeWrapper2["Nullable"] = "Nullable";
|
|
61427
|
-
TypeWrapper2["List"] = "List";
|
|
61428
|
-
TypeWrapper2["NonNull"] = "NonNull";
|
|
61429
|
-
return TypeWrapper2;
|
|
61430
|
-
})(TypeWrapper || {});
|
|
61431
|
-
|
|
61432
|
-
// src/lib/parse.ts
|
|
61433
|
-
var import_parser = __toESM(require_lib6(), 1);
|
|
61434
|
-
var import_recast = __toESM(require_main2(), 1);
|
|
61435
|
-
|
|
61436
|
-
// src/lib/deepMerge.ts
|
|
61437
|
-
var import_deepmerge = __toESM(require_cjs(), 1);
|
|
61438
|
-
function deepMerge2(filepath, ...targets) {
|
|
61439
|
-
try {
|
|
61440
|
-
if (targets.length === 1) {
|
|
61441
|
-
return targets[0];
|
|
61442
|
-
} else if (targets.length === 2) {
|
|
61443
|
-
return (0, import_deepmerge.default)(targets[0], targets[1], {
|
|
61444
|
-
arrayMerge: (source, update) => [...new Set(source.concat(update))]
|
|
61445
|
-
});
|
|
61446
|
-
}
|
|
61447
|
-
return deepMerge2(filepath, targets[0], deepMerge2(filepath, ...targets.slice(1)));
|
|
61448
|
-
} catch (e) {
|
|
61449
|
-
throw new HoudiniError({
|
|
61450
|
-
filepath,
|
|
61451
|
-
message: "could not merge: " + JSON.stringify(targets, null, 4),
|
|
61452
|
-
description: e.message
|
|
61453
|
-
});
|
|
61454
|
-
}
|
|
61455
|
-
}
|
|
61456
|
-
|
|
61457
|
-
// src/lib/parse.ts
|
|
61458
|
-
function parseJS(str, config) {
|
|
61459
|
-
const defaultConfig = {
|
|
61460
|
-
plugins: [
|
|
61461
|
-
"typescript",
|
|
61462
|
-
"importAssertions",
|
|
61463
|
-
"decorators-legacy",
|
|
61464
|
-
"explicitResourceManagement"
|
|
61465
|
-
],
|
|
61466
|
-
sourceType: "module"
|
|
61467
|
-
};
|
|
61468
|
-
return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
|
|
61469
|
-
}
|
|
61470
|
-
async function printJS(script, options) {
|
|
61471
|
-
if (options?.pretty) {
|
|
61472
|
-
return (0, import_recast.prettyPrint)(script, options);
|
|
61473
|
-
} else {
|
|
61474
|
-
return (0, import_recast.print)(script, options);
|
|
61475
|
-
}
|
|
61476
|
-
}
|
|
61477
|
-
|
|
61478
61478
|
// src/lib/imports.ts
|
|
61479
61479
|
var recast = __toESM(require_main2(), 1);
|
|
61480
61480
|
var AST2 = recast.types.builders;
|
|
@@ -61603,18 +61603,18 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
61603
61603
|
return AST3.tsNeverKeyword();
|
|
61604
61604
|
}
|
|
61605
61605
|
const component = config.componentFields[field.parent][field.field];
|
|
61606
|
-
const sourcePathRelative =
|
|
61607
|
-
|
|
61606
|
+
const sourcePathRelative = relative(
|
|
61607
|
+
join(config.projectRoot, "src"),
|
|
61608
61608
|
component.filepath
|
|
61609
61609
|
);
|
|
61610
|
-
let sourcePathParsed =
|
|
61611
|
-
let sourcePath =
|
|
61610
|
+
let sourcePathParsed = parse(sourcePathRelative);
|
|
61611
|
+
let sourcePath = join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
61612
61612
|
const localImport = ensureImports({
|
|
61613
61613
|
config,
|
|
61614
61614
|
body,
|
|
61615
61615
|
import: "__component__" + component.fragment,
|
|
61616
|
-
sourceModule:
|
|
61617
|
-
|
|
61616
|
+
sourceModule: join(
|
|
61617
|
+
relative(dirname(filepath), config.projectRoot),
|
|
61618
61618
|
"src",
|
|
61619
61619
|
sourcePath
|
|
61620
61620
|
)
|
|
@@ -62218,12 +62218,12 @@ function stripLoc(value) {
|
|
|
62218
62218
|
|
|
62219
62219
|
// src/codegen/transforms/collectDefinitions.ts
|
|
62220
62220
|
var graphql8 = __toESM(require("graphql"), 1);
|
|
62221
|
-
var
|
|
62221
|
+
var import_graphql3 = require("graphql");
|
|
62222
62222
|
async function includeFragmentDefinitions(config, documents) {
|
|
62223
62223
|
const fragments = collectDefinitions(config, documents);
|
|
62224
62224
|
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
62225
62225
|
const operation = document.definitions.find(
|
|
62226
|
-
(def) => def.kind ===
|
|
62226
|
+
(def) => def.kind === import_graphql3.Kind.OPERATION_DEFINITION || def.kind === "FragmentDefinition"
|
|
62227
62227
|
);
|
|
62228
62228
|
if (!operation) {
|
|
62229
62229
|
continue;
|
|
@@ -64219,6 +64219,16 @@ async function generatePluginIndex({
|
|
|
64219
64219
|
}
|
|
64220
64220
|
|
|
64221
64221
|
// src/codegen/generators/runtime/pluginRuntime.ts
|
|
64222
|
+
function moduleStatments(config) {
|
|
64223
|
+
const importStatement = config.module === "commonjs" ? importDefaultFrom : (where, as) => `import ${as} from '${where}'`;
|
|
64224
|
+
const exportDefaultStatement = config.module === "commonjs" ? exportDefault : (as) => `export default ${as}`;
|
|
64225
|
+
const exportStarStatement = config.module === "commonjs" ? exportStarFrom : (where) => `export * from '${where}'`;
|
|
64226
|
+
return {
|
|
64227
|
+
importStatement,
|
|
64228
|
+
exportDefaultStatement,
|
|
64229
|
+
exportStarStatement
|
|
64230
|
+
};
|
|
64231
|
+
}
|
|
64222
64232
|
async function generatePluginRuntimes({
|
|
64223
64233
|
config,
|
|
64224
64234
|
docs
|
|
@@ -64234,7 +64244,7 @@ async function generatePluginRuntimes({
|
|
|
64234
64244
|
return;
|
|
64235
64245
|
}
|
|
64236
64246
|
try {
|
|
64237
|
-
await
|
|
64247
|
+
await stat(runtime_path);
|
|
64238
64248
|
} catch {
|
|
64239
64249
|
throw new HoudiniError({
|
|
64240
64250
|
message: "Cannot find runtime to generate for " + plugin2.name,
|
|
@@ -64246,13 +64256,13 @@ async function generatePluginRuntimes({
|
|
|
64246
64256
|
if (transformMap && typeof transformMap === "function") {
|
|
64247
64257
|
transformMap = transformMap(docs, { config });
|
|
64248
64258
|
}
|
|
64249
|
-
await
|
|
64250
|
-
await
|
|
64259
|
+
await mkdirp(pluginDir);
|
|
64260
|
+
await recursiveCopy(
|
|
64251
64261
|
runtime_path,
|
|
64252
64262
|
pluginDir,
|
|
64253
64263
|
Object.fromEntries(
|
|
64254
64264
|
Object.entries(transformMap).map(([key, value]) => [
|
|
64255
|
-
|
|
64265
|
+
join(runtime_path, key),
|
|
64256
64266
|
(content) => value({
|
|
64257
64267
|
config,
|
|
64258
64268
|
content,
|
|
@@ -64299,21 +64309,21 @@ async function runtimeGenerator(config, docs) {
|
|
|
64299
64309
|
exportStarStatement: exportStar
|
|
64300
64310
|
} = moduleStatments(config);
|
|
64301
64311
|
await Promise.all([
|
|
64302
|
-
|
|
64303
|
-
[
|
|
64312
|
+
recursiveCopy(config.runtimeSource, config.runtimeDirectory, {
|
|
64313
|
+
[join(config.runtimeSource, "lib", "constants.js")]: (content) => {
|
|
64304
64314
|
return content.replace("SITE_URL", siteURL);
|
|
64305
64315
|
},
|
|
64306
|
-
[
|
|
64316
|
+
[join(config.runtimeSource, "imports", "pluginConfig.js")]: (content) => {
|
|
64307
64317
|
return injectConfig({ config, importStatement, exportStatement, content });
|
|
64308
64318
|
},
|
|
64309
|
-
[
|
|
64310
|
-
const configFilePath =
|
|
64311
|
-
const relativePath =
|
|
64319
|
+
[join(config.runtimeSource, "imports", "config.js")]: (content) => {
|
|
64320
|
+
const configFilePath = join(config.runtimeDirectory, "imports", "config.js");
|
|
64321
|
+
const relativePath = relative(dirname(configFilePath), config.filepath);
|
|
64312
64322
|
return `${importStatement(relativePath, "config")}
|
|
64313
64323
|
${exportStatement("config")}
|
|
64314
64324
|
`;
|
|
64315
64325
|
},
|
|
64316
|
-
[
|
|
64326
|
+
[join(config.runtimeSource, "client", "plugins", "injectedPlugins.js")]: (content) => injectPlugins({ config, content, importStatement, exportStatement })
|
|
64317
64327
|
}),
|
|
64318
64328
|
generatePluginRuntimes({
|
|
64319
64329
|
config,
|
|
@@ -64323,16 +64333,6 @@ ${exportStatement("config")}
|
|
|
64323
64333
|
]);
|
|
64324
64334
|
await generateGraphqlReturnTypes(config, docs);
|
|
64325
64335
|
}
|
|
64326
|
-
function moduleStatments(config) {
|
|
64327
|
-
const importStatement = config.module === "commonjs" ? importDefaultFrom : (where, as) => `import ${as} from '${where}'`;
|
|
64328
|
-
const exportDefaultStatement = config.module === "commonjs" ? exportDefault : (as) => `export default ${as}`;
|
|
64329
|
-
const exportStarStatement = config.module === "commonjs" ? exportStarFrom : (where) => `export * from '${where}'`;
|
|
64330
|
-
return {
|
|
64331
|
-
importStatement,
|
|
64332
|
-
exportDefaultStatement,
|
|
64333
|
-
exportStarStatement
|
|
64334
|
-
};
|
|
64335
|
-
}
|
|
64336
64336
|
|
|
64337
64337
|
// src/codegen/generators/typescript/documentTypes.ts
|
|
64338
64338
|
var recast11 = __toESM(require_main2(), 1);
|
|
@@ -65815,7 +65815,7 @@ async function writeIndexFile2(config, docs) {
|
|
|
65815
65815
|
}
|
|
65816
65816
|
|
|
65817
65817
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/helpers.js
|
|
65818
|
-
var
|
|
65818
|
+
var import_graphql4 = require("graphql");
|
|
65819
65819
|
function compareStrings(a, b) {
|
|
65820
65820
|
if (String(a) < String(b)) {
|
|
65821
65821
|
return -1;
|
|
@@ -65851,7 +65851,7 @@ function isSome(input) {
|
|
|
65851
65851
|
}
|
|
65852
65852
|
|
|
65853
65853
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/inspect.js
|
|
65854
|
-
var
|
|
65854
|
+
var import_graphql5 = require("graphql");
|
|
65855
65855
|
var MAX_RECURSIVE_DEPTH = 3;
|
|
65856
65856
|
function inspect(value) {
|
|
65857
65857
|
return formatValue(value, []);
|
|
@@ -65869,7 +65869,7 @@ function formatValue(value, seenValues) {
|
|
|
65869
65869
|
}
|
|
65870
65870
|
}
|
|
65871
65871
|
function formatError(value) {
|
|
65872
|
-
if (value instanceof
|
|
65872
|
+
if (value instanceof import_graphql5.GraphQLError) {
|
|
65873
65873
|
return value.toString();
|
|
65874
65874
|
}
|
|
65875
65875
|
return `${value.name}: ${value.message};
|
|
@@ -65952,43 +65952,43 @@ function getDirectivesInExtensions(node, pathToDirectivesInExtensions = ["direct
|
|
|
65952
65952
|
}
|
|
65953
65953
|
|
|
65954
65954
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js
|
|
65955
|
-
var
|
|
65955
|
+
var import_graphql9 = require("graphql");
|
|
65956
65956
|
|
|
65957
65957
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromType.js
|
|
65958
|
-
var
|
|
65958
|
+
var import_graphql6 = require("graphql");
|
|
65959
65959
|
function astFromType(type) {
|
|
65960
|
-
if ((0,
|
|
65960
|
+
if ((0, import_graphql6.isNonNullType)(type)) {
|
|
65961
65961
|
const innerType = astFromType(type.ofType);
|
|
65962
|
-
if (innerType.kind ===
|
|
65962
|
+
if (innerType.kind === import_graphql6.Kind.NON_NULL_TYPE) {
|
|
65963
65963
|
throw new Error(`Invalid type node ${inspect(type)}. Inner type of non-null type cannot be a non-null type.`);
|
|
65964
65964
|
}
|
|
65965
65965
|
return {
|
|
65966
|
-
kind:
|
|
65966
|
+
kind: import_graphql6.Kind.NON_NULL_TYPE,
|
|
65967
65967
|
type: innerType
|
|
65968
65968
|
};
|
|
65969
|
-
} else if ((0,
|
|
65969
|
+
} else if ((0, import_graphql6.isListType)(type)) {
|
|
65970
65970
|
return {
|
|
65971
|
-
kind:
|
|
65971
|
+
kind: import_graphql6.Kind.LIST_TYPE,
|
|
65972
65972
|
type: astFromType(type.ofType)
|
|
65973
65973
|
};
|
|
65974
65974
|
}
|
|
65975
65975
|
return {
|
|
65976
|
-
kind:
|
|
65976
|
+
kind: import_graphql6.Kind.NAMED_TYPE,
|
|
65977
65977
|
name: {
|
|
65978
|
-
kind:
|
|
65978
|
+
kind: import_graphql6.Kind.NAME,
|
|
65979
65979
|
value: type.name
|
|
65980
65980
|
}
|
|
65981
65981
|
};
|
|
65982
65982
|
}
|
|
65983
65983
|
|
|
65984
65984
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
|
|
65985
|
-
var
|
|
65985
|
+
var import_graphql8 = require("graphql");
|
|
65986
65986
|
|
|
65987
65987
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js
|
|
65988
|
-
var
|
|
65988
|
+
var import_graphql7 = require("graphql");
|
|
65989
65989
|
function astFromValueUntyped(value) {
|
|
65990
65990
|
if (value === null) {
|
|
65991
|
-
return { kind:
|
|
65991
|
+
return { kind: import_graphql7.Kind.NULL };
|
|
65992
65992
|
}
|
|
65993
65993
|
if (value === void 0) {
|
|
65994
65994
|
return null;
|
|
@@ -66001,7 +66001,7 @@ function astFromValueUntyped(value) {
|
|
|
66001
66001
|
valuesNodes.push(itemNode);
|
|
66002
66002
|
}
|
|
66003
66003
|
}
|
|
66004
|
-
return { kind:
|
|
66004
|
+
return { kind: import_graphql7.Kind.LIST, values: valuesNodes };
|
|
66005
66005
|
}
|
|
66006
66006
|
if (typeof value === "object") {
|
|
66007
66007
|
const fieldNodes = [];
|
|
@@ -66010,26 +66010,26 @@ function astFromValueUntyped(value) {
|
|
|
66010
66010
|
const ast = astFromValueUntyped(fieldValue);
|
|
66011
66011
|
if (ast) {
|
|
66012
66012
|
fieldNodes.push({
|
|
66013
|
-
kind:
|
|
66014
|
-
name: { kind:
|
|
66013
|
+
kind: import_graphql7.Kind.OBJECT_FIELD,
|
|
66014
|
+
name: { kind: import_graphql7.Kind.NAME, value: fieldName },
|
|
66015
66015
|
value: ast
|
|
66016
66016
|
});
|
|
66017
66017
|
}
|
|
66018
66018
|
}
|
|
66019
|
-
return { kind:
|
|
66019
|
+
return { kind: import_graphql7.Kind.OBJECT, fields: fieldNodes };
|
|
66020
66020
|
}
|
|
66021
66021
|
if (typeof value === "boolean") {
|
|
66022
|
-
return { kind:
|
|
66022
|
+
return { kind: import_graphql7.Kind.BOOLEAN, value };
|
|
66023
66023
|
}
|
|
66024
66024
|
if (typeof value === "bigint") {
|
|
66025
|
-
return { kind:
|
|
66025
|
+
return { kind: import_graphql7.Kind.INT, value: String(value) };
|
|
66026
66026
|
}
|
|
66027
66027
|
if (typeof value === "number" && isFinite(value)) {
|
|
66028
66028
|
const stringNum = String(value);
|
|
66029
|
-
return integerStringRegExp.test(stringNum) ? { kind:
|
|
66029
|
+
return integerStringRegExp.test(stringNum) ? { kind: import_graphql7.Kind.INT, value: stringNum } : { kind: import_graphql7.Kind.FLOAT, value: stringNum };
|
|
66030
66030
|
}
|
|
66031
66031
|
if (typeof value === "string") {
|
|
66032
|
-
return { kind:
|
|
66032
|
+
return { kind: import_graphql7.Kind.STRING, value };
|
|
66033
66033
|
}
|
|
66034
66034
|
throw new TypeError(`Cannot convert value to AST: ${value}.`);
|
|
66035
66035
|
}
|
|
@@ -66037,20 +66037,20 @@ var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;
|
|
|
66037
66037
|
|
|
66038
66038
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
|
|
66039
66039
|
function astFromValue(value, type) {
|
|
66040
|
-
if ((0,
|
|
66040
|
+
if ((0, import_graphql8.isNonNullType)(type)) {
|
|
66041
66041
|
const astValue = astFromValue(value, type.ofType);
|
|
66042
|
-
if (astValue?.kind ===
|
|
66042
|
+
if (astValue?.kind === import_graphql8.Kind.NULL) {
|
|
66043
66043
|
return null;
|
|
66044
66044
|
}
|
|
66045
66045
|
return astValue;
|
|
66046
66046
|
}
|
|
66047
66047
|
if (value === null) {
|
|
66048
|
-
return { kind:
|
|
66048
|
+
return { kind: import_graphql8.Kind.NULL };
|
|
66049
66049
|
}
|
|
66050
66050
|
if (value === void 0) {
|
|
66051
66051
|
return null;
|
|
66052
66052
|
}
|
|
66053
|
-
if ((0,
|
|
66053
|
+
if ((0, import_graphql8.isListType)(type)) {
|
|
66054
66054
|
const itemType = type.ofType;
|
|
66055
66055
|
if (isIterableObject(value)) {
|
|
66056
66056
|
const valuesNodes = [];
|
|
@@ -66060,11 +66060,11 @@ function astFromValue(value, type) {
|
|
|
66060
66060
|
valuesNodes.push(itemNode);
|
|
66061
66061
|
}
|
|
66062
66062
|
}
|
|
66063
|
-
return { kind:
|
|
66063
|
+
return { kind: import_graphql8.Kind.LIST, values: valuesNodes };
|
|
66064
66064
|
}
|
|
66065
66065
|
return astFromValue(value, itemType);
|
|
66066
66066
|
}
|
|
66067
|
-
if ((0,
|
|
66067
|
+
if ((0, import_graphql8.isInputObjectType)(type)) {
|
|
66068
66068
|
if (!isObjectLike(value)) {
|
|
66069
66069
|
return null;
|
|
66070
66070
|
}
|
|
@@ -66073,24 +66073,24 @@ function astFromValue(value, type) {
|
|
|
66073
66073
|
const fieldValue = astFromValue(value[field.name], field.type);
|
|
66074
66074
|
if (fieldValue) {
|
|
66075
66075
|
fieldNodes.push({
|
|
66076
|
-
kind:
|
|
66077
|
-
name: { kind:
|
|
66076
|
+
kind: import_graphql8.Kind.OBJECT_FIELD,
|
|
66077
|
+
name: { kind: import_graphql8.Kind.NAME, value: field.name },
|
|
66078
66078
|
value: fieldValue
|
|
66079
66079
|
});
|
|
66080
66080
|
}
|
|
66081
66081
|
}
|
|
66082
|
-
return { kind:
|
|
66082
|
+
return { kind: import_graphql8.Kind.OBJECT, fields: fieldNodes };
|
|
66083
66083
|
}
|
|
66084
|
-
if ((0,
|
|
66084
|
+
if ((0, import_graphql8.isLeafType)(type)) {
|
|
66085
66085
|
const serialized = type.serialize(value);
|
|
66086
66086
|
if (serialized == null) {
|
|
66087
66087
|
return null;
|
|
66088
66088
|
}
|
|
66089
|
-
if ((0,
|
|
66090
|
-
return { kind:
|
|
66089
|
+
if ((0, import_graphql8.isEnumType)(type)) {
|
|
66090
|
+
return { kind: import_graphql8.Kind.ENUM, value: serialized };
|
|
66091
66091
|
}
|
|
66092
66092
|
if (type.name === "ID" && typeof serialized === "string" && integerStringRegExp2.test(serialized)) {
|
|
66093
|
-
return { kind:
|
|
66093
|
+
return { kind: import_graphql8.Kind.INT, value: serialized };
|
|
66094
66094
|
}
|
|
66095
66095
|
return astFromValueUntyped(serialized);
|
|
66096
66096
|
}
|
|
@@ -66146,36 +66146,36 @@ function getDocumentNodeFromSchema(schema, options = {}) {
|
|
|
66146
66146
|
const definitions = schemaNode != null ? [schemaNode] : [];
|
|
66147
66147
|
const directives = schema.getDirectives();
|
|
66148
66148
|
for (const directive of directives) {
|
|
66149
|
-
if ((0,
|
|
66149
|
+
if ((0, import_graphql9.isSpecifiedDirective)(directive)) {
|
|
66150
66150
|
continue;
|
|
66151
66151
|
}
|
|
66152
66152
|
definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
|
|
66153
66153
|
}
|
|
66154
66154
|
for (const typeName in typesMap) {
|
|
66155
66155
|
const type = typesMap[typeName];
|
|
66156
|
-
const isPredefinedScalar = (0,
|
|
66157
|
-
const isIntrospection = (0,
|
|
66156
|
+
const isPredefinedScalar = (0, import_graphql9.isSpecifiedScalarType)(type);
|
|
66157
|
+
const isIntrospection = (0, import_graphql9.isIntrospectionType)(type);
|
|
66158
66158
|
if (isPredefinedScalar || isIntrospection) {
|
|
66159
66159
|
continue;
|
|
66160
66160
|
}
|
|
66161
|
-
if ((0,
|
|
66161
|
+
if ((0, import_graphql9.isObjectType)(type)) {
|
|
66162
66162
|
definitions.push(astFromObjectType(type, schema, pathToDirectivesInExtensions));
|
|
66163
|
-
} else if ((0,
|
|
66163
|
+
} else if ((0, import_graphql9.isInterfaceType)(type)) {
|
|
66164
66164
|
definitions.push(astFromInterfaceType(type, schema, pathToDirectivesInExtensions));
|
|
66165
|
-
} else if ((0,
|
|
66165
|
+
} else if ((0, import_graphql9.isUnionType)(type)) {
|
|
66166
66166
|
definitions.push(astFromUnionType(type, schema, pathToDirectivesInExtensions));
|
|
66167
|
-
} else if ((0,
|
|
66167
|
+
} else if ((0, import_graphql9.isInputObjectType)(type)) {
|
|
66168
66168
|
definitions.push(astFromInputObjectType(type, schema, pathToDirectivesInExtensions));
|
|
66169
|
-
} else if ((0,
|
|
66169
|
+
} else if ((0, import_graphql9.isEnumType)(type)) {
|
|
66170
66170
|
definitions.push(astFromEnumType(type, schema, pathToDirectivesInExtensions));
|
|
66171
|
-
} else if ((0,
|
|
66171
|
+
} else if ((0, import_graphql9.isScalarType)(type)) {
|
|
66172
66172
|
definitions.push(astFromScalarType(type, schema, pathToDirectivesInExtensions));
|
|
66173
66173
|
} else {
|
|
66174
66174
|
throw new Error(`Unknown type ${type}.`);
|
|
66175
66175
|
}
|
|
66176
66176
|
}
|
|
66177
66177
|
return {
|
|
66178
|
-
kind:
|
|
66178
|
+
kind: import_graphql9.Kind.DOCUMENT,
|
|
66179
66179
|
definitions
|
|
66180
66180
|
};
|
|
66181
66181
|
}
|
|
@@ -66210,7 +66210,7 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
|
|
|
66210
66210
|
operationTypeDefinitionNode.type = rootTypeAST;
|
|
66211
66211
|
} else {
|
|
66212
66212
|
operationTypeMap.set(operationTypeNode, {
|
|
66213
|
-
kind:
|
|
66213
|
+
kind: import_graphql9.Kind.OPERATION_TYPE_DEFINITION,
|
|
66214
66214
|
operation: operationTypeNode,
|
|
66215
66215
|
type: rootTypeAST
|
|
66216
66216
|
});
|
|
@@ -66223,12 +66223,12 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
|
|
|
66223
66223
|
return null;
|
|
66224
66224
|
}
|
|
66225
66225
|
const schemaNode = {
|
|
66226
|
-
kind: operationTypes != null ?
|
|
66226
|
+
kind: operationTypes != null ? import_graphql9.Kind.SCHEMA_DEFINITION : import_graphql9.Kind.SCHEMA_EXTENSION,
|
|
66227
66227
|
operationTypes,
|
|
66228
66228
|
directives
|
|
66229
66229
|
};
|
|
66230
66230
|
schemaNode.description = schema.astNode?.description ?? schema.description != null ? {
|
|
66231
|
-
kind:
|
|
66231
|
+
kind: import_graphql9.Kind.STRING,
|
|
66232
66232
|
value: schema.description,
|
|
66233
66233
|
block: true
|
|
66234
66234
|
} : void 0;
|
|
@@ -66236,19 +66236,19 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
|
|
|
66236
66236
|
}
|
|
66237
66237
|
function astFromDirective(directive, schema, pathToDirectivesInExtensions) {
|
|
66238
66238
|
return {
|
|
66239
|
-
kind:
|
|
66239
|
+
kind: import_graphql9.Kind.DIRECTIVE_DEFINITION,
|
|
66240
66240
|
description: directive.astNode?.description ?? (directive.description ? {
|
|
66241
|
-
kind:
|
|
66241
|
+
kind: import_graphql9.Kind.STRING,
|
|
66242
66242
|
value: directive.description
|
|
66243
66243
|
} : void 0),
|
|
66244
66244
|
name: {
|
|
66245
|
-
kind:
|
|
66245
|
+
kind: import_graphql9.Kind.NAME,
|
|
66246
66246
|
value: directive.name
|
|
66247
66247
|
},
|
|
66248
66248
|
arguments: directive.args?.map((arg) => astFromArg(arg, schema, pathToDirectivesInExtensions)),
|
|
66249
66249
|
repeatable: directive.isRepeatable,
|
|
66250
66250
|
locations: directive.locations?.map((location) => ({
|
|
66251
|
-
kind:
|
|
66251
|
+
kind: import_graphql9.Kind.NAME,
|
|
66252
66252
|
value: location
|
|
66253
66253
|
})) || []
|
|
66254
66254
|
};
|
|
@@ -66298,14 +66298,14 @@ function getDeprecatableDirectiveNodes(entity, schema, pathToDirectivesInExtensi
|
|
|
66298
66298
|
}
|
|
66299
66299
|
function astFromArg(arg, schema, pathToDirectivesInExtensions) {
|
|
66300
66300
|
return {
|
|
66301
|
-
kind:
|
|
66301
|
+
kind: import_graphql9.Kind.INPUT_VALUE_DEFINITION,
|
|
66302
66302
|
description: arg.astNode?.description ?? (arg.description ? {
|
|
66303
|
-
kind:
|
|
66303
|
+
kind: import_graphql9.Kind.STRING,
|
|
66304
66304
|
value: arg.description,
|
|
66305
66305
|
block: true
|
|
66306
66306
|
} : void 0),
|
|
66307
66307
|
name: {
|
|
66308
|
-
kind:
|
|
66308
|
+
kind: import_graphql9.Kind.NAME,
|
|
66309
66309
|
value: arg.name
|
|
66310
66310
|
},
|
|
66311
66311
|
type: astFromType(arg.type),
|
|
@@ -66315,14 +66315,14 @@ function astFromArg(arg, schema, pathToDirectivesInExtensions) {
|
|
|
66315
66315
|
}
|
|
66316
66316
|
function astFromObjectType(type, schema, pathToDirectivesInExtensions) {
|
|
66317
66317
|
return {
|
|
66318
|
-
kind:
|
|
66318
|
+
kind: import_graphql9.Kind.OBJECT_TYPE_DEFINITION,
|
|
66319
66319
|
description: type.astNode?.description ?? (type.description ? {
|
|
66320
|
-
kind:
|
|
66320
|
+
kind: import_graphql9.Kind.STRING,
|
|
66321
66321
|
value: type.description,
|
|
66322
66322
|
block: true
|
|
66323
66323
|
} : void 0),
|
|
66324
66324
|
name: {
|
|
66325
|
-
kind:
|
|
66325
|
+
kind: import_graphql9.Kind.NAME,
|
|
66326
66326
|
value: type.name
|
|
66327
66327
|
},
|
|
66328
66328
|
fields: Object.values(type.getFields()).map((field) => astFromField(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -66332,14 +66332,14 @@ function astFromObjectType(type, schema, pathToDirectivesInExtensions) {
|
|
|
66332
66332
|
}
|
|
66333
66333
|
function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) {
|
|
66334
66334
|
const node = {
|
|
66335
|
-
kind:
|
|
66335
|
+
kind: import_graphql9.Kind.INTERFACE_TYPE_DEFINITION,
|
|
66336
66336
|
description: type.astNode?.description ?? (type.description ? {
|
|
66337
|
-
kind:
|
|
66337
|
+
kind: import_graphql9.Kind.STRING,
|
|
66338
66338
|
value: type.description,
|
|
66339
66339
|
block: true
|
|
66340
66340
|
} : void 0),
|
|
66341
66341
|
name: {
|
|
66342
|
-
kind:
|
|
66342
|
+
kind: import_graphql9.Kind.NAME,
|
|
66343
66343
|
value: type.name
|
|
66344
66344
|
},
|
|
66345
66345
|
fields: Object.values(type.getFields()).map((field) => astFromField(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -66352,14 +66352,14 @@ function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) {
|
|
|
66352
66352
|
}
|
|
66353
66353
|
function astFromUnionType(type, schema, pathToDirectivesInExtensions) {
|
|
66354
66354
|
return {
|
|
66355
|
-
kind:
|
|
66355
|
+
kind: import_graphql9.Kind.UNION_TYPE_DEFINITION,
|
|
66356
66356
|
description: type.astNode?.description ?? (type.description ? {
|
|
66357
|
-
kind:
|
|
66357
|
+
kind: import_graphql9.Kind.STRING,
|
|
66358
66358
|
value: type.description,
|
|
66359
66359
|
block: true
|
|
66360
66360
|
} : void 0),
|
|
66361
66361
|
name: {
|
|
66362
|
-
kind:
|
|
66362
|
+
kind: import_graphql9.Kind.NAME,
|
|
66363
66363
|
value: type.name
|
|
66364
66364
|
},
|
|
66365
66365
|
directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions),
|
|
@@ -66368,14 +66368,14 @@ function astFromUnionType(type, schema, pathToDirectivesInExtensions) {
|
|
|
66368
66368
|
}
|
|
66369
66369
|
function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) {
|
|
66370
66370
|
return {
|
|
66371
|
-
kind:
|
|
66371
|
+
kind: import_graphql9.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
66372
66372
|
description: type.astNode?.description ?? (type.description ? {
|
|
66373
|
-
kind:
|
|
66373
|
+
kind: import_graphql9.Kind.STRING,
|
|
66374
66374
|
value: type.description,
|
|
66375
66375
|
block: true
|
|
66376
66376
|
} : void 0),
|
|
66377
66377
|
name: {
|
|
66378
|
-
kind:
|
|
66378
|
+
kind: import_graphql9.Kind.NAME,
|
|
66379
66379
|
value: type.name
|
|
66380
66380
|
},
|
|
66381
66381
|
fields: Object.values(type.getFields()).map((field) => astFromInputField(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -66384,14 +66384,14 @@ function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) {
|
|
|
66384
66384
|
}
|
|
66385
66385
|
function astFromEnumType(type, schema, pathToDirectivesInExtensions) {
|
|
66386
66386
|
return {
|
|
66387
|
-
kind:
|
|
66387
|
+
kind: import_graphql9.Kind.ENUM_TYPE_DEFINITION,
|
|
66388
66388
|
description: type.astNode?.description ?? (type.description ? {
|
|
66389
|
-
kind:
|
|
66389
|
+
kind: import_graphql9.Kind.STRING,
|
|
66390
66390
|
value: type.description,
|
|
66391
66391
|
block: true
|
|
66392
66392
|
} : void 0),
|
|
66393
66393
|
name: {
|
|
66394
|
-
kind:
|
|
66394
|
+
kind: import_graphql9.Kind.NAME,
|
|
66395
66395
|
value: type.name
|
|
66396
66396
|
},
|
|
66397
66397
|
values: Object.values(type.getValues()).map((value) => astFromEnumValue(value, schema, pathToDirectivesInExtensions)),
|
|
@@ -66409,14 +66409,14 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
|
|
|
66409
66409
|
directives.push(makeDirectiveNode("specifiedBy", specifiedByArgs));
|
|
66410
66410
|
}
|
|
66411
66411
|
return {
|
|
66412
|
-
kind:
|
|
66412
|
+
kind: import_graphql9.Kind.SCALAR_TYPE_DEFINITION,
|
|
66413
66413
|
description: type.astNode?.description ?? (type.description ? {
|
|
66414
|
-
kind:
|
|
66414
|
+
kind: import_graphql9.Kind.STRING,
|
|
66415
66415
|
value: type.description,
|
|
66416
66416
|
block: true
|
|
66417
66417
|
} : void 0),
|
|
66418
66418
|
name: {
|
|
66419
|
-
kind:
|
|
66419
|
+
kind: import_graphql9.Kind.NAME,
|
|
66420
66420
|
value: type.name
|
|
66421
66421
|
},
|
|
66422
66422
|
directives
|
|
@@ -66424,14 +66424,14 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
|
|
|
66424
66424
|
}
|
|
66425
66425
|
function astFromField(field, schema, pathToDirectivesInExtensions) {
|
|
66426
66426
|
return {
|
|
66427
|
-
kind:
|
|
66427
|
+
kind: import_graphql9.Kind.FIELD_DEFINITION,
|
|
66428
66428
|
description: field.astNode?.description ?? (field.description ? {
|
|
66429
|
-
kind:
|
|
66429
|
+
kind: import_graphql9.Kind.STRING,
|
|
66430
66430
|
value: field.description,
|
|
66431
66431
|
block: true
|
|
66432
66432
|
} : void 0),
|
|
66433
66433
|
name: {
|
|
66434
|
-
kind:
|
|
66434
|
+
kind: import_graphql9.Kind.NAME,
|
|
66435
66435
|
value: field.name
|
|
66436
66436
|
},
|
|
66437
66437
|
arguments: field.args.map((arg) => astFromArg(arg, schema, pathToDirectivesInExtensions)),
|
|
@@ -66441,14 +66441,14 @@ function astFromField(field, schema, pathToDirectivesInExtensions) {
|
|
|
66441
66441
|
}
|
|
66442
66442
|
function astFromInputField(field, schema, pathToDirectivesInExtensions) {
|
|
66443
66443
|
return {
|
|
66444
|
-
kind:
|
|
66444
|
+
kind: import_graphql9.Kind.INPUT_VALUE_DEFINITION,
|
|
66445
66445
|
description: field.astNode?.description ?? (field.description ? {
|
|
66446
|
-
kind:
|
|
66446
|
+
kind: import_graphql9.Kind.STRING,
|
|
66447
66447
|
value: field.description,
|
|
66448
66448
|
block: true
|
|
66449
66449
|
} : void 0),
|
|
66450
66450
|
name: {
|
|
66451
|
-
kind:
|
|
66451
|
+
kind: import_graphql9.Kind.NAME,
|
|
66452
66452
|
value: field.name
|
|
66453
66453
|
},
|
|
66454
66454
|
type: astFromType(field.type),
|
|
@@ -66458,21 +66458,21 @@ function astFromInputField(field, schema, pathToDirectivesInExtensions) {
|
|
|
66458
66458
|
}
|
|
66459
66459
|
function astFromEnumValue(value, schema, pathToDirectivesInExtensions) {
|
|
66460
66460
|
return {
|
|
66461
|
-
kind:
|
|
66461
|
+
kind: import_graphql9.Kind.ENUM_VALUE_DEFINITION,
|
|
66462
66462
|
description: value.astNode?.description ?? (value.description ? {
|
|
66463
|
-
kind:
|
|
66463
|
+
kind: import_graphql9.Kind.STRING,
|
|
66464
66464
|
value: value.description,
|
|
66465
66465
|
block: true
|
|
66466
66466
|
} : void 0),
|
|
66467
66467
|
name: {
|
|
66468
|
-
kind:
|
|
66468
|
+
kind: import_graphql9.Kind.NAME,
|
|
66469
66469
|
value: value.name
|
|
66470
66470
|
},
|
|
66471
66471
|
directives: getDeprecatableDirectiveNodes(value, schema, pathToDirectivesInExtensions)
|
|
66472
66472
|
};
|
|
66473
66473
|
}
|
|
66474
66474
|
function makeDeprecatedDirective(deprecationReason) {
|
|
66475
|
-
return makeDirectiveNode("deprecated", { reason: deprecationReason },
|
|
66475
|
+
return makeDirectiveNode("deprecated", { reason: deprecationReason }, import_graphql9.GraphQLDeprecatedDirective);
|
|
66476
66476
|
}
|
|
66477
66477
|
function makeDirectiveNode(name, args, directive) {
|
|
66478
66478
|
const directiveArguments = [];
|
|
@@ -66484,9 +66484,9 @@ function makeDirectiveNode(name, args, directive) {
|
|
|
66484
66484
|
const value = astFromValue(argValue, arg.type);
|
|
66485
66485
|
if (value) {
|
|
66486
66486
|
directiveArguments.push({
|
|
66487
|
-
kind:
|
|
66487
|
+
kind: import_graphql9.Kind.ARGUMENT,
|
|
66488
66488
|
name: {
|
|
66489
|
-
kind:
|
|
66489
|
+
kind: import_graphql9.Kind.NAME,
|
|
66490
66490
|
value: argName
|
|
66491
66491
|
},
|
|
66492
66492
|
value
|
|
@@ -66500,9 +66500,9 @@ function makeDirectiveNode(name, args, directive) {
|
|
|
66500
66500
|
const value = astFromValueUntyped(argValue);
|
|
66501
66501
|
if (value) {
|
|
66502
66502
|
directiveArguments.push({
|
|
66503
|
-
kind:
|
|
66503
|
+
kind: import_graphql9.Kind.ARGUMENT,
|
|
66504
66504
|
name: {
|
|
66505
|
-
kind:
|
|
66505
|
+
kind: import_graphql9.Kind.NAME,
|
|
66506
66506
|
value: argName
|
|
66507
66507
|
},
|
|
66508
66508
|
value
|
|
@@ -66511,9 +66511,9 @@ function makeDirectiveNode(name, args, directive) {
|
|
|
66511
66511
|
}
|
|
66512
66512
|
}
|
|
66513
66513
|
return {
|
|
66514
|
-
kind:
|
|
66514
|
+
kind: import_graphql9.Kind.DIRECTIVE,
|
|
66515
66515
|
name: {
|
|
66516
|
-
kind:
|
|
66516
|
+
kind: import_graphql9.Kind.NAME,
|
|
66517
66517
|
value: name
|
|
66518
66518
|
},
|
|
66519
66519
|
arguments: directiveArguments
|
|
@@ -66536,7 +66536,7 @@ function makeDirectiveNodes(schema, directiveValues) {
|
|
|
66536
66536
|
}
|
|
66537
66537
|
|
|
66538
66538
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/comments.js
|
|
66539
|
-
var
|
|
66539
|
+
var import_graphql10 = require("graphql");
|
|
66540
66540
|
var MAX_LINE_LENGTH = 80;
|
|
66541
66541
|
var commentsRegistry = {};
|
|
66542
66542
|
function resetComments() {
|
|
@@ -66781,7 +66781,7 @@ var printDocASTReducerWithComments = Object.keys(printDocASTReducer).reduce((pre
|
|
|
66781
66781
|
}
|
|
66782
66782
|
}), {});
|
|
66783
66783
|
function printWithComments(ast) {
|
|
66784
|
-
return (0,
|
|
66784
|
+
return (0, import_graphql10.visit)(ast, printDocASTReducerWithComments);
|
|
66785
66785
|
}
|
|
66786
66786
|
function isFieldDefinitionNode(node) {
|
|
66787
66787
|
return node.kind === "FieldDefinition";
|
|
@@ -66800,7 +66800,7 @@ function getLeadingCommentBlock(node) {
|
|
|
66800
66800
|
}
|
|
66801
66801
|
const comments = [];
|
|
66802
66802
|
let token = loc.startToken.prev;
|
|
66803
|
-
while (token != null && token.kind ===
|
|
66803
|
+
while (token != null && token.kind === import_graphql10.TokenKind.COMMENT && token.next != null && token.prev != null && token.line + 1 === token.next.line && token.line !== token.prev.line) {
|
|
66804
66804
|
const value = String(token.value);
|
|
66805
66805
|
comments.push(value);
|
|
66806
66806
|
token = token.prev;
|
|
@@ -66852,9 +66852,9 @@ function isBlank(str) {
|
|
|
66852
66852
|
}
|
|
66853
66853
|
|
|
66854
66854
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/isDocumentNode.js
|
|
66855
|
-
var
|
|
66855
|
+
var import_graphql11 = require("graphql");
|
|
66856
66856
|
function isDocumentNode(object) {
|
|
66857
|
-
return object && typeof object === "object" && "kind" in object && object.kind ===
|
|
66857
|
+
return object && typeof object === "object" && "kind" in object && object.kind === import_graphql11.Kind.DOCUMENT;
|
|
66858
66858
|
}
|
|
66859
66859
|
|
|
66860
66860
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js
|
|
@@ -66878,7 +66878,7 @@ function deduplicateArguments(args, config) {
|
|
|
66878
66878
|
}
|
|
66879
66879
|
|
|
66880
66880
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js
|
|
66881
|
-
var
|
|
66881
|
+
var import_graphql12 = require("graphql");
|
|
66882
66882
|
function directiveAlreadyExists(directivesArr, otherDirective) {
|
|
66883
66883
|
return !!directivesArr.find((directive) => directive.name.value === otherDirective.name.value);
|
|
66884
66884
|
}
|
|
@@ -66938,11 +66938,11 @@ function mergeDirectives(d1 = [], d2 = [], config, directives) {
|
|
|
66938
66938
|
return result;
|
|
66939
66939
|
}
|
|
66940
66940
|
function validateInputs(node, existingNode) {
|
|
66941
|
-
const printedNode = (0,
|
|
66941
|
+
const printedNode = (0, import_graphql12.print)({
|
|
66942
66942
|
...node,
|
|
66943
66943
|
description: void 0
|
|
66944
66944
|
});
|
|
66945
|
-
const printedExistingNode = (0,
|
|
66945
|
+
const printedExistingNode = (0, import_graphql12.print)({
|
|
66946
66946
|
...existingNode,
|
|
66947
66947
|
description: void 0
|
|
66948
66948
|
});
|
|
@@ -67009,7 +67009,7 @@ function mergeEnumValues(first, second, config, directives) {
|
|
|
67009
67009
|
}
|
|
67010
67010
|
|
|
67011
67011
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js
|
|
67012
|
-
var
|
|
67012
|
+
var import_graphql13 = require("graphql");
|
|
67013
67013
|
function mergeEnum(e1, e2, config, directives) {
|
|
67014
67014
|
if (e2) {
|
|
67015
67015
|
return {
|
|
@@ -67023,33 +67023,33 @@ function mergeEnum(e1, e2, config, directives) {
|
|
|
67023
67023
|
}
|
|
67024
67024
|
return config?.convertExtensions ? {
|
|
67025
67025
|
...e1,
|
|
67026
|
-
kind:
|
|
67026
|
+
kind: import_graphql13.Kind.ENUM_TYPE_DEFINITION
|
|
67027
67027
|
} : e1;
|
|
67028
67028
|
}
|
|
67029
67029
|
|
|
67030
67030
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
67031
|
-
var
|
|
67031
|
+
var import_graphql14 = require("graphql");
|
|
67032
67032
|
function isStringTypes(types15) {
|
|
67033
67033
|
return typeof types15 === "string";
|
|
67034
67034
|
}
|
|
67035
67035
|
function isSourceTypes(types15) {
|
|
67036
|
-
return types15 instanceof
|
|
67036
|
+
return types15 instanceof import_graphql14.Source;
|
|
67037
67037
|
}
|
|
67038
67038
|
function extractType(type) {
|
|
67039
67039
|
let visitedType = type;
|
|
67040
|
-
while (visitedType.kind ===
|
|
67040
|
+
while (visitedType.kind === import_graphql14.Kind.LIST_TYPE || visitedType.kind === "NonNullType") {
|
|
67041
67041
|
visitedType = visitedType.type;
|
|
67042
67042
|
}
|
|
67043
67043
|
return visitedType;
|
|
67044
67044
|
}
|
|
67045
67045
|
function isWrappingTypeNode(type) {
|
|
67046
|
-
return type.kind !==
|
|
67046
|
+
return type.kind !== import_graphql14.Kind.NAMED_TYPE;
|
|
67047
67047
|
}
|
|
67048
67048
|
function isListTypeNode(type) {
|
|
67049
|
-
return type.kind ===
|
|
67049
|
+
return type.kind === import_graphql14.Kind.LIST_TYPE;
|
|
67050
67050
|
}
|
|
67051
67051
|
function isNonNullTypeNode(type) {
|
|
67052
|
-
return type.kind ===
|
|
67052
|
+
return type.kind === import_graphql14.Kind.NON_NULL_TYPE;
|
|
67053
67053
|
}
|
|
67054
67054
|
function printTypeNode(type) {
|
|
67055
67055
|
if (isListTypeNode(type)) {
|
|
@@ -67152,7 +67152,7 @@ function safeChangeForFieldType(oldType, newType, ignoreNullability = false) {
|
|
|
67152
67152
|
}
|
|
67153
67153
|
|
|
67154
67154
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js
|
|
67155
|
-
var
|
|
67155
|
+
var import_graphql15 = require("graphql");
|
|
67156
67156
|
function mergeInputType(node, existingNode, config, directives) {
|
|
67157
67157
|
if (existingNode) {
|
|
67158
67158
|
try {
|
|
@@ -67170,12 +67170,12 @@ function mergeInputType(node, existingNode, config, directives) {
|
|
|
67170
67170
|
}
|
|
67171
67171
|
return config?.convertExtensions ? {
|
|
67172
67172
|
...node,
|
|
67173
|
-
kind:
|
|
67173
|
+
kind: import_graphql15.Kind.INPUT_OBJECT_TYPE_DEFINITION
|
|
67174
67174
|
} : node;
|
|
67175
67175
|
}
|
|
67176
67176
|
|
|
67177
67177
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js
|
|
67178
|
-
var
|
|
67178
|
+
var import_graphql16 = require("graphql");
|
|
67179
67179
|
|
|
67180
67180
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js
|
|
67181
67181
|
function alreadyExists(arr, other) {
|
|
@@ -67208,15 +67208,15 @@ function mergeInterface(node, existingNode, config, directives) {
|
|
|
67208
67208
|
}
|
|
67209
67209
|
return config?.convertExtensions ? {
|
|
67210
67210
|
...node,
|
|
67211
|
-
kind:
|
|
67211
|
+
kind: import_graphql16.Kind.INTERFACE_TYPE_DEFINITION
|
|
67212
67212
|
} : node;
|
|
67213
67213
|
}
|
|
67214
67214
|
|
|
67215
67215
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js
|
|
67216
|
-
var
|
|
67216
|
+
var import_graphql21 = require("graphql");
|
|
67217
67217
|
|
|
67218
67218
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js
|
|
67219
|
-
var
|
|
67219
|
+
var import_graphql17 = require("graphql");
|
|
67220
67220
|
function mergeType(node, existingNode, config, directives) {
|
|
67221
67221
|
if (existingNode) {
|
|
67222
67222
|
try {
|
|
@@ -67235,12 +67235,12 @@ function mergeType(node, existingNode, config, directives) {
|
|
|
67235
67235
|
}
|
|
67236
67236
|
return config?.convertExtensions ? {
|
|
67237
67237
|
...node,
|
|
67238
|
-
kind:
|
|
67238
|
+
kind: import_graphql17.Kind.OBJECT_TYPE_DEFINITION
|
|
67239
67239
|
} : node;
|
|
67240
67240
|
}
|
|
67241
67241
|
|
|
67242
67242
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js
|
|
67243
|
-
var
|
|
67243
|
+
var import_graphql18 = require("graphql");
|
|
67244
67244
|
function mergeScalar(node, existingNode, config, directives) {
|
|
67245
67245
|
if (existingNode) {
|
|
67246
67246
|
return {
|
|
@@ -67253,31 +67253,31 @@ function mergeScalar(node, existingNode, config, directives) {
|
|
|
67253
67253
|
}
|
|
67254
67254
|
return config?.convertExtensions ? {
|
|
67255
67255
|
...node,
|
|
67256
|
-
kind:
|
|
67256
|
+
kind: import_graphql18.Kind.SCALAR_TYPE_DEFINITION
|
|
67257
67257
|
} : node;
|
|
67258
67258
|
}
|
|
67259
67259
|
|
|
67260
67260
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js
|
|
67261
|
-
var
|
|
67261
|
+
var import_graphql19 = require("graphql");
|
|
67262
67262
|
function mergeUnion(first, second, config, directives) {
|
|
67263
67263
|
if (second) {
|
|
67264
67264
|
return {
|
|
67265
67265
|
name: first.name,
|
|
67266
67266
|
description: first["description"] || second["description"],
|
|
67267
67267
|
directives: mergeDirectives(first.directives, second.directives, config, directives),
|
|
67268
|
-
kind: config?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ?
|
|
67268
|
+
kind: config?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql19.Kind.UNION_TYPE_DEFINITION : import_graphql19.Kind.UNION_TYPE_EXTENSION,
|
|
67269
67269
|
loc: first.loc,
|
|
67270
67270
|
types: mergeNamedTypeArray(first.types, second.types, config)
|
|
67271
67271
|
};
|
|
67272
67272
|
}
|
|
67273
67273
|
return config?.convertExtensions ? {
|
|
67274
67274
|
...first,
|
|
67275
|
-
kind:
|
|
67275
|
+
kind: import_graphql19.Kind.UNION_TYPE_DEFINITION
|
|
67276
67276
|
} : first;
|
|
67277
67277
|
}
|
|
67278
67278
|
|
|
67279
67279
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js
|
|
67280
|
-
var
|
|
67280
|
+
var import_graphql20 = require("graphql");
|
|
67281
67281
|
var DEFAULT_OPERATION_TYPE_NAME_MAP = {
|
|
67282
67282
|
query: "Query",
|
|
67283
67283
|
mutation: "Mutation",
|
|
@@ -67296,7 +67296,7 @@ function mergeOperationTypes(opNodeList = [], existingOpNodeList = []) {
|
|
|
67296
67296
|
function mergeSchemaDefs(node, existingNode, config, directives) {
|
|
67297
67297
|
if (existingNode) {
|
|
67298
67298
|
return {
|
|
67299
|
-
kind: node.kind ===
|
|
67299
|
+
kind: node.kind === import_graphql20.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql20.Kind.SCHEMA_DEFINITION ? import_graphql20.Kind.SCHEMA_DEFINITION : import_graphql20.Kind.SCHEMA_EXTENSION,
|
|
67300
67300
|
description: node["description"] || existingNode["description"],
|
|
67301
67301
|
directives: mergeDirectives(node.directives, existingNode.directives, config, directives),
|
|
67302
67302
|
operationTypes: mergeOperationTypes(node.operationTypes, existingNode.operationTypes)
|
|
@@ -67304,7 +67304,7 @@ function mergeSchemaDefs(node, existingNode, config, directives) {
|
|
|
67304
67304
|
}
|
|
67305
67305
|
return config?.convertExtensions ? {
|
|
67306
67306
|
...node,
|
|
67307
|
-
kind:
|
|
67307
|
+
kind: import_graphql20.Kind.SCHEMA_DEFINITION
|
|
67308
67308
|
} : node;
|
|
67309
67309
|
}
|
|
67310
67310
|
|
|
@@ -67328,36 +67328,36 @@ function mergeGraphQLNodes(nodes, config, directives = {}) {
|
|
|
67328
67328
|
delete mergedResultMap[name];
|
|
67329
67329
|
} else {
|
|
67330
67330
|
switch (nodeDefinition.kind) {
|
|
67331
|
-
case
|
|
67332
|
-
case
|
|
67331
|
+
case import_graphql21.Kind.OBJECT_TYPE_DEFINITION:
|
|
67332
|
+
case import_graphql21.Kind.OBJECT_TYPE_EXTENSION:
|
|
67333
67333
|
mergedResultMap[name] = mergeType(nodeDefinition, mergedResultMap[name], config, directives);
|
|
67334
67334
|
break;
|
|
67335
|
-
case
|
|
67336
|
-
case
|
|
67335
|
+
case import_graphql21.Kind.ENUM_TYPE_DEFINITION:
|
|
67336
|
+
case import_graphql21.Kind.ENUM_TYPE_EXTENSION:
|
|
67337
67337
|
mergedResultMap[name] = mergeEnum(nodeDefinition, mergedResultMap[name], config, directives);
|
|
67338
67338
|
break;
|
|
67339
|
-
case
|
|
67340
|
-
case
|
|
67339
|
+
case import_graphql21.Kind.UNION_TYPE_DEFINITION:
|
|
67340
|
+
case import_graphql21.Kind.UNION_TYPE_EXTENSION:
|
|
67341
67341
|
mergedResultMap[name] = mergeUnion(nodeDefinition, mergedResultMap[name], config, directives);
|
|
67342
67342
|
break;
|
|
67343
|
-
case
|
|
67344
|
-
case
|
|
67343
|
+
case import_graphql21.Kind.SCALAR_TYPE_DEFINITION:
|
|
67344
|
+
case import_graphql21.Kind.SCALAR_TYPE_EXTENSION:
|
|
67345
67345
|
mergedResultMap[name] = mergeScalar(nodeDefinition, mergedResultMap[name], config, directives);
|
|
67346
67346
|
break;
|
|
67347
|
-
case
|
|
67348
|
-
case
|
|
67347
|
+
case import_graphql21.Kind.INPUT_OBJECT_TYPE_DEFINITION:
|
|
67348
|
+
case import_graphql21.Kind.INPUT_OBJECT_TYPE_EXTENSION:
|
|
67349
67349
|
mergedResultMap[name] = mergeInputType(nodeDefinition, mergedResultMap[name], config, directives);
|
|
67350
67350
|
break;
|
|
67351
|
-
case
|
|
67352
|
-
case
|
|
67351
|
+
case import_graphql21.Kind.INTERFACE_TYPE_DEFINITION:
|
|
67352
|
+
case import_graphql21.Kind.INTERFACE_TYPE_EXTENSION:
|
|
67353
67353
|
mergedResultMap[name] = mergeInterface(nodeDefinition, mergedResultMap[name], config, directives);
|
|
67354
67354
|
break;
|
|
67355
|
-
case
|
|
67355
|
+
case import_graphql21.Kind.DIRECTIVE_DEFINITION:
|
|
67356
67356
|
mergedResultMap[name] = mergeDirective(nodeDefinition, mergedResultMap[name]);
|
|
67357
67357
|
break;
|
|
67358
67358
|
}
|
|
67359
67359
|
}
|
|
67360
|
-
} else if (nodeDefinition.kind ===
|
|
67360
|
+
} else if (nodeDefinition.kind === import_graphql21.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql21.Kind.SCHEMA_EXTENSION) {
|
|
67361
67361
|
mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol], config);
|
|
67362
67362
|
}
|
|
67363
67363
|
}
|
|
@@ -67365,11 +67365,11 @@ function mergeGraphQLNodes(nodes, config, directives = {}) {
|
|
|
67365
67365
|
}
|
|
67366
67366
|
|
|
67367
67367
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js
|
|
67368
|
-
var
|
|
67368
|
+
var import_graphql22 = require("graphql");
|
|
67369
67369
|
function mergeTypeDefs(typeSource, config) {
|
|
67370
67370
|
resetComments();
|
|
67371
67371
|
const doc = {
|
|
67372
|
-
kind:
|
|
67372
|
+
kind: import_graphql22.Kind.DOCUMENT,
|
|
67373
67373
|
definitions: mergeGraphQLTypes(typeSource, {
|
|
67374
67374
|
useSchemaDefinition: true,
|
|
67375
67375
|
forceSchemaDefinition: false,
|
|
@@ -67396,14 +67396,14 @@ function visitTypeSources(typeSource, options, allDirectives = [], allNodes = []
|
|
|
67396
67396
|
for (const type of typeSource) {
|
|
67397
67397
|
visitTypeSources(type, options, allDirectives, allNodes, visitedTypeSources);
|
|
67398
67398
|
}
|
|
67399
|
-
} else if ((0,
|
|
67399
|
+
} else if ((0, import_graphql22.isSchema)(typeSource)) {
|
|
67400
67400
|
const documentNode = getDocumentNodeFromSchema(typeSource, options);
|
|
67401
67401
|
visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
|
|
67402
67402
|
} else if (isStringTypes(typeSource) || isSourceTypes(typeSource)) {
|
|
67403
|
-
const documentNode = (0,
|
|
67403
|
+
const documentNode = (0, import_graphql22.parse)(typeSource, options);
|
|
67404
67404
|
visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
|
|
67405
|
-
} else if (typeof typeSource === "object" && (0,
|
|
67406
|
-
if (typeSource.kind ===
|
|
67405
|
+
} else if (typeof typeSource === "object" && (0, import_graphql22.isDefinitionNode)(typeSource)) {
|
|
67406
|
+
if (typeSource.kind === import_graphql22.Kind.DIRECTIVE_DEFINITION) {
|
|
67407
67407
|
allDirectives.push(typeSource);
|
|
67408
67408
|
} else {
|
|
67409
67409
|
allNodes.push(typeSource);
|
|
@@ -67423,7 +67423,7 @@ function mergeGraphQLTypes(typeSource, config) {
|
|
|
67423
67423
|
const mergedNodes = mergeGraphQLNodes(allNodes, config, mergedDirectives);
|
|
67424
67424
|
if (config?.useSchemaDefinition) {
|
|
67425
67425
|
const schemaDef = mergedNodes[schemaDefSymbol] || {
|
|
67426
|
-
kind:
|
|
67426
|
+
kind: import_graphql22.Kind.SCHEMA_DEFINITION,
|
|
67427
67427
|
operationTypes: []
|
|
67428
67428
|
};
|
|
67429
67429
|
const operationTypes = schemaDef.operationTypes;
|
|
@@ -67434,9 +67434,9 @@ function mergeGraphQLTypes(typeSource, config) {
|
|
|
67434
67434
|
const existingPossibleRootType = mergedNodes[possibleRootTypeName];
|
|
67435
67435
|
if (existingPossibleRootType != null && existingPossibleRootType.name != null) {
|
|
67436
67436
|
operationTypes.push({
|
|
67437
|
-
kind:
|
|
67437
|
+
kind: import_graphql22.Kind.OPERATION_TYPE_DEFINITION,
|
|
67438
67438
|
type: {
|
|
67439
|
-
kind:
|
|
67439
|
+
kind: import_graphql22.Kind.NAMED_TYPE,
|
|
67440
67440
|
name: existingPossibleRootType.name
|
|
67441
67441
|
},
|
|
67442
67442
|
operation: opTypeDefNodeType
|
|
@@ -67450,15 +67450,15 @@ function mergeGraphQLTypes(typeSource, config) {
|
|
|
67450
67450
|
}
|
|
67451
67451
|
if (config?.forceSchemaDefinition && !mergedNodes[schemaDefSymbol]?.operationTypes?.length) {
|
|
67452
67452
|
mergedNodes[schemaDefSymbol] = {
|
|
67453
|
-
kind:
|
|
67453
|
+
kind: import_graphql22.Kind.SCHEMA_DEFINITION,
|
|
67454
67454
|
operationTypes: [
|
|
67455
67455
|
{
|
|
67456
|
-
kind:
|
|
67456
|
+
kind: import_graphql22.Kind.OPERATION_TYPE_DEFINITION,
|
|
67457
67457
|
operation: "query",
|
|
67458
67458
|
type: {
|
|
67459
|
-
kind:
|
|
67459
|
+
kind: import_graphql22.Kind.NAMED_TYPE,
|
|
67460
67460
|
name: {
|
|
67461
|
-
kind:
|
|
67461
|
+
kind: import_graphql22.Kind.NAME,
|
|
67462
67462
|
value: "Query"
|
|
67463
67463
|
}
|
|
67464
67464
|
}
|