houdini 1.2.43 → 1.2.45
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 +684 -786
- package/build/cmd-esm/index.js +534 -636
- package/build/codegen/generators/artifacts/inputs.d.ts +1 -1
- package/build/codegen/generators/comments/jsdoc.d.ts +2 -0
- package/build/codegen/transforms/index.d.ts +1 -0
- package/build/codegen/transforms/runtimeScalars.d.ts +2 -0
- package/build/codegen-cjs/index.js +677 -782
- package/build/codegen-esm/index.js +527 -632
- package/build/lib/config.d.ts +1 -0
- package/build/lib/graphql.d.ts +1 -1
- package/build/lib/index.d.ts +1 -0
- package/build/lib/typescript.d.ts +19 -0
- package/build/lib-cjs/index.js +711 -477
- package/build/lib-esm/index.js +705 -477
- package/build/runtime/client/index.d.ts +7 -1
- package/build/runtime/client/plugins/fragment.d.ts +2 -2
- package/build/runtime/client/plugins/mutation.d.ts +2 -1
- package/build/runtime/client/plugins/query.d.ts +2 -2
- package/build/runtime/lib/config.d.ts +12 -2
- package/build/runtime/lib/scalars.d.ts +1 -1
- package/build/runtime/lib/types.d.ts +17 -2
- package/build/runtime/router/session.d.ts +1 -2
- package/build/runtime/router/types.d.ts +3 -1
- package/build/runtime-cjs/client/index.d.ts +7 -1
- package/build/runtime-cjs/client/index.js +26 -11
- package/build/runtime-cjs/client/plugins/fragment.d.ts +2 -2
- package/build/runtime-cjs/client/plugins/fragment.js +4 -11
- package/build/runtime-cjs/client/plugins/mutation.d.ts +2 -1
- package/build/runtime-cjs/client/plugins/mutation.js +8 -15
- package/build/runtime-cjs/client/plugins/query.d.ts +2 -2
- package/build/runtime-cjs/client/plugins/query.js +18 -11
- package/build/runtime-cjs/lib/config.d.ts +12 -2
- package/build/runtime-cjs/lib/scalars.d.ts +1 -1
- package/build/runtime-cjs/lib/scalars.js +4 -0
- package/build/runtime-cjs/lib/types.d.ts +17 -2
- package/build/runtime-cjs/router/server.js +2 -3
- package/build/runtime-cjs/router/session.d.ts +1 -2
- package/build/runtime-cjs/router/session.js +25 -11
- package/build/runtime-cjs/router/types.d.ts +3 -1
- package/build/runtime-esm/client/index.d.ts +7 -1
- package/build/runtime-esm/client/index.js +26 -11
- package/build/runtime-esm/client/plugins/fragment.d.ts +2 -2
- package/build/runtime-esm/client/plugins/fragment.js +1 -2
- package/build/runtime-esm/client/plugins/mutation.d.ts +2 -1
- package/build/runtime-esm/client/plugins/mutation.js +1 -2
- package/build/runtime-esm/client/plugins/query.d.ts +2 -2
- package/build/runtime-esm/client/plugins/query.js +15 -2
- package/build/runtime-esm/lib/config.d.ts +12 -2
- package/build/runtime-esm/lib/scalars.d.ts +1 -1
- package/build/runtime-esm/lib/scalars.js +6 -0
- package/build/runtime-esm/lib/types.d.ts +17 -2
- package/build/runtime-esm/router/server.js +2 -3
- package/build/runtime-esm/router/session.d.ts +1 -2
- package/build/runtime-esm/router/session.js +25 -11
- package/build/runtime-esm/router/types.d.ts +3 -1
- package/build/test-cjs/index.js +706 -785
- package/build/test-esm/index.js +556 -635
- package/build/vite-cjs/index.js +793 -793
- package/build/vite-esm/index.js +643 -643
- package/package.json +1 -1
- package/build/codegen/generators/typescript/typeReference.d.ts +0 -8
- package/build/codegen/generators/typescript/types.d.ts +0 -10
package/build/vite-cjs/index.js
CHANGED
|
@@ -31862,7 +31862,7 @@ var require_path_visitor = __commonJS({
|
|
|
31862
31862
|
}
|
|
31863
31863
|
return target;
|
|
31864
31864
|
}
|
|
31865
|
-
PathVisitor.visit = function
|
|
31865
|
+
PathVisitor.visit = function visit20(node, methods) {
|
|
31866
31866
|
return PathVisitor.fromMethodsObject(methods).visit(node);
|
|
31867
31867
|
};
|
|
31868
31868
|
var PVp = PathVisitor.prototype;
|
|
@@ -32053,7 +32053,7 @@ var require_path_visitor = __commonJS({
|
|
|
32053
32053
|
this.needToCallTraverse = false;
|
|
32054
32054
|
return visitChildren(path3, PathVisitor.fromMethodsObject(newVisitor || this.visitor));
|
|
32055
32055
|
};
|
|
32056
|
-
sharedContextProtoMethods.visit = function
|
|
32056
|
+
sharedContextProtoMethods.visit = function visit20(path3, newVisitor) {
|
|
32057
32057
|
if (!(this instanceof this.Context)) {
|
|
32058
32058
|
throw new Error("");
|
|
32059
32059
|
}
|
|
@@ -33446,7 +33446,7 @@ var require_main = __commonJS({
|
|
|
33446
33446
|
var someField = _a.someField;
|
|
33447
33447
|
var Type = _a.Type;
|
|
33448
33448
|
var use = _a.use;
|
|
33449
|
-
var
|
|
33449
|
+
var visit20 = _a.visit;
|
|
33450
33450
|
exports.astNodesAreEquivalent = astNodesAreEquivalent;
|
|
33451
33451
|
exports.builders = builders;
|
|
33452
33452
|
exports.builtInTypes = builtInTypes;
|
|
@@ -33463,7 +33463,7 @@ var require_main = __commonJS({
|
|
|
33463
33463
|
exports.someField = someField;
|
|
33464
33464
|
exports.Type = Type;
|
|
33465
33465
|
exports.use = use;
|
|
33466
|
-
exports.visit =
|
|
33466
|
+
exports.visit = visit20;
|
|
33467
33467
|
Object.assign(namedTypes_1.namedTypes, n);
|
|
33468
33468
|
}
|
|
33469
33469
|
});
|
|
@@ -64582,47 +64582,6 @@ function deepMerge(...objects) {
|
|
|
64582
64582
|
return mergedObj;
|
|
64583
64583
|
}
|
|
64584
64584
|
|
|
64585
|
-
// src/runtime/lib/scalars.ts
|
|
64586
|
-
async function marshalSelection({
|
|
64587
|
-
selection,
|
|
64588
|
-
data
|
|
64589
|
-
}) {
|
|
64590
|
-
const config2 = getCurrentConfig();
|
|
64591
|
-
if (data === null || typeof data === "undefined") {
|
|
64592
|
-
return data;
|
|
64593
|
-
}
|
|
64594
|
-
if (Array.isArray(data)) {
|
|
64595
|
-
return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
|
|
64596
|
-
}
|
|
64597
|
-
const targetSelection = getFieldsForType(selection, data["__typename"], false);
|
|
64598
|
-
return Object.fromEntries(
|
|
64599
|
-
await Promise.all(
|
|
64600
|
-
Object.entries(data).map(async ([fieldName, value]) => {
|
|
64601
|
-
const { type, selection: selection2 } = targetSelection[fieldName];
|
|
64602
|
-
if (!type) {
|
|
64603
|
-
return [fieldName, value];
|
|
64604
|
-
}
|
|
64605
|
-
if (selection2) {
|
|
64606
|
-
return [fieldName, await marshalSelection({ selection: selection2, data: value })];
|
|
64607
|
-
}
|
|
64608
|
-
if (config2.scalars?.[type]) {
|
|
64609
|
-
const marshalFn = config2.scalars[type].marshal;
|
|
64610
|
-
if (!marshalFn) {
|
|
64611
|
-
throw new Error(
|
|
64612
|
-
`scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
|
|
64613
|
-
);
|
|
64614
|
-
}
|
|
64615
|
-
if (Array.isArray(value)) {
|
|
64616
|
-
return [fieldName, value.map(marshalFn)];
|
|
64617
|
-
}
|
|
64618
|
-
return [fieldName, marshalFn(value)];
|
|
64619
|
-
}
|
|
64620
|
-
return [fieldName, value];
|
|
64621
|
-
})
|
|
64622
|
-
)
|
|
64623
|
-
);
|
|
64624
|
-
}
|
|
64625
|
-
|
|
64626
64585
|
// src/runtime/lib/types.ts
|
|
64627
64586
|
var CachePolicy = {
|
|
64628
64587
|
CacheOrNetwork: "CacheOrNetwork",
|
|
@@ -64650,11 +64609,6 @@ var RefetchUpdateMode = {
|
|
|
64650
64609
|
prepend: "prepend",
|
|
64651
64610
|
replace: "replace"
|
|
64652
64611
|
};
|
|
64653
|
-
var DataSource = {
|
|
64654
|
-
Cache: "cache",
|
|
64655
|
-
Network: "network",
|
|
64656
|
-
Ssr: "ssr"
|
|
64657
|
-
};
|
|
64658
64612
|
var fragmentKey = " $fragments";
|
|
64659
64613
|
var PendingValue = Symbol("houdini_loading");
|
|
64660
64614
|
|
|
@@ -68425,188 +68379,6 @@ var cache_default = new Cache();
|
|
|
68425
68379
|
// src/runtime/client/plugins/cache.ts
|
|
68426
68380
|
var serverSide = typeof globalThis.window === "undefined";
|
|
68427
68381
|
|
|
68428
|
-
// src/runtime/client/utils/documentPlugins.ts
|
|
68429
|
-
var documentPlugin = (kind, source) => {
|
|
68430
|
-
return () => {
|
|
68431
|
-
const sourceHandlers = source();
|
|
68432
|
-
const enterWrapper = (handler) => {
|
|
68433
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
68434
|
-
if (ctx.artifact.kind !== kind) {
|
|
68435
|
-
return handlers.next(ctx);
|
|
68436
|
-
}
|
|
68437
|
-
return handler(ctx, handlers);
|
|
68438
|
-
};
|
|
68439
|
-
};
|
|
68440
|
-
const exitWrapper = (handler) => {
|
|
68441
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
68442
|
-
if (ctx.artifact.kind !== kind) {
|
|
68443
|
-
return handlers.resolve(ctx);
|
|
68444
|
-
}
|
|
68445
|
-
return handler(ctx, handlers);
|
|
68446
|
-
};
|
|
68447
|
-
};
|
|
68448
|
-
return {
|
|
68449
|
-
start: enterWrapper(sourceHandlers.start),
|
|
68450
|
-
network: enterWrapper(sourceHandlers.network),
|
|
68451
|
-
afterNetwork: exitWrapper(sourceHandlers.afterNetwork),
|
|
68452
|
-
end: exitWrapper(sourceHandlers.end),
|
|
68453
|
-
catch: sourceHandlers.catch ? (ctx, handlers) => sourceHandlers.catch(ctx, handlers) : void 0,
|
|
68454
|
-
cleanup: (...args) => sourceHandlers.cleanup?.(...args)
|
|
68455
|
-
};
|
|
68456
|
-
};
|
|
68457
|
-
};
|
|
68458
|
-
|
|
68459
|
-
// src/runtime/client/plugins/query.ts
|
|
68460
|
-
var query = documentPlugin(ArtifactKind.Query, function() {
|
|
68461
|
-
let subscriptionSpec = null;
|
|
68462
|
-
let lastVariables = null;
|
|
68463
|
-
return {
|
|
68464
|
-
start(ctx, { next }) {
|
|
68465
|
-
ctx.variables = {
|
|
68466
|
-
...lastVariables,
|
|
68467
|
-
...ctx.variables
|
|
68468
|
-
};
|
|
68469
|
-
next(ctx);
|
|
68470
|
-
},
|
|
68471
|
-
end(ctx, { resolve: resolve2, marshalVariables, variablesChanged }) {
|
|
68472
|
-
if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
|
|
68473
|
-
if (subscriptionSpec) {
|
|
68474
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
68475
|
-
}
|
|
68476
|
-
lastVariables = { ...marshalVariables(ctx) };
|
|
68477
|
-
const variables = lastVariables;
|
|
68478
|
-
subscriptionSpec = {
|
|
68479
|
-
rootType: ctx.artifact.rootType,
|
|
68480
|
-
selection: ctx.artifact.selection,
|
|
68481
|
-
variables: () => variables,
|
|
68482
|
-
set: (newValue) => {
|
|
68483
|
-
resolve2(ctx, {
|
|
68484
|
-
data: newValue,
|
|
68485
|
-
errors: null,
|
|
68486
|
-
fetching: false,
|
|
68487
|
-
partial: false,
|
|
68488
|
-
stale: false,
|
|
68489
|
-
source: DataSource.Cache,
|
|
68490
|
-
variables: ctx.variables ?? {}
|
|
68491
|
-
});
|
|
68492
|
-
}
|
|
68493
|
-
};
|
|
68494
|
-
cache_default.subscribe(subscriptionSpec, lastVariables);
|
|
68495
|
-
}
|
|
68496
|
-
resolve2(ctx);
|
|
68497
|
-
},
|
|
68498
|
-
cleanup() {
|
|
68499
|
-
if (subscriptionSpec) {
|
|
68500
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
68501
|
-
lastVariables = null;
|
|
68502
|
-
}
|
|
68503
|
-
}
|
|
68504
|
-
};
|
|
68505
|
-
});
|
|
68506
|
-
|
|
68507
|
-
// src/runtime/client/plugins/fragment.ts
|
|
68508
|
-
var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
68509
|
-
let subscriptionSpec = null;
|
|
68510
|
-
let lastReference = null;
|
|
68511
|
-
return {
|
|
68512
|
-
start(ctx, { next, resolve: resolve2, variablesChanged, marshalVariables }) {
|
|
68513
|
-
if (!ctx.stuff.parentID) {
|
|
68514
|
-
return next(ctx);
|
|
68515
|
-
}
|
|
68516
|
-
const currentReference = {
|
|
68517
|
-
parent: ctx.stuff.parentID,
|
|
68518
|
-
variables: marshalVariables(ctx)
|
|
68519
|
-
};
|
|
68520
|
-
if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged(ctx))) {
|
|
68521
|
-
if (subscriptionSpec) {
|
|
68522
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
68523
|
-
}
|
|
68524
|
-
const variables = marshalVariables(ctx);
|
|
68525
|
-
subscriptionSpec = {
|
|
68526
|
-
rootType: ctx.artifact.rootType,
|
|
68527
|
-
selection: ctx.artifact.selection,
|
|
68528
|
-
variables: () => variables,
|
|
68529
|
-
parentID: ctx.stuff.parentID,
|
|
68530
|
-
set: (newValue) => {
|
|
68531
|
-
resolve2(ctx, {
|
|
68532
|
-
data: newValue,
|
|
68533
|
-
errors: null,
|
|
68534
|
-
fetching: false,
|
|
68535
|
-
partial: false,
|
|
68536
|
-
stale: false,
|
|
68537
|
-
source: DataSource.Cache,
|
|
68538
|
-
variables
|
|
68539
|
-
});
|
|
68540
|
-
}
|
|
68541
|
-
};
|
|
68542
|
-
cache_default.subscribe(subscriptionSpec, variables);
|
|
68543
|
-
lastReference = currentReference;
|
|
68544
|
-
}
|
|
68545
|
-
next(ctx);
|
|
68546
|
-
},
|
|
68547
|
-
cleanup() {
|
|
68548
|
-
if (subscriptionSpec) {
|
|
68549
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
68550
|
-
}
|
|
68551
|
-
}
|
|
68552
|
-
};
|
|
68553
|
-
});
|
|
68554
|
-
|
|
68555
|
-
// src/runtime/client/plugins/mutation.ts
|
|
68556
|
-
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
68557
|
-
return {
|
|
68558
|
-
async start(ctx, { next, marshalVariables }) {
|
|
68559
|
-
const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
|
|
68560
|
-
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
68561
|
-
let toNotify = [];
|
|
68562
|
-
if (optimisticResponse) {
|
|
68563
|
-
toNotify = cache_default.write({
|
|
68564
|
-
selection: ctx.artifact.selection,
|
|
68565
|
-
data: await marshalSelection({
|
|
68566
|
-
selection: ctx.artifact.selection,
|
|
68567
|
-
data: optimisticResponse
|
|
68568
|
-
}),
|
|
68569
|
-
variables: marshalVariables(ctx),
|
|
68570
|
-
layer: layerOptimistic.id
|
|
68571
|
-
});
|
|
68572
|
-
}
|
|
68573
|
-
ctx.cacheParams = {
|
|
68574
|
-
...ctx.cacheParams,
|
|
68575
|
-
layer: layerOptimistic,
|
|
68576
|
-
notifySubscribers: toNotify,
|
|
68577
|
-
forceNotify: true
|
|
68578
|
-
};
|
|
68579
|
-
next(ctx);
|
|
68580
|
-
},
|
|
68581
|
-
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
68582
|
-
if (ctx.cacheParams?.layer) {
|
|
68583
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
68584
|
-
}
|
|
68585
|
-
resolve2(ctx);
|
|
68586
|
-
},
|
|
68587
|
-
end(ctx, { resolve: resolve2, value }) {
|
|
68588
|
-
const hasErrors = value.errors && value.errors.length > 0;
|
|
68589
|
-
if (hasErrors) {
|
|
68590
|
-
if (ctx.cacheParams?.layer) {
|
|
68591
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
68592
|
-
}
|
|
68593
|
-
}
|
|
68594
|
-
if (ctx.cacheParams?.layer) {
|
|
68595
|
-
cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
68596
|
-
}
|
|
68597
|
-
resolve2(ctx);
|
|
68598
|
-
},
|
|
68599
|
-
catch(ctx, { error }) {
|
|
68600
|
-
if (ctx.cacheParams?.layer) {
|
|
68601
|
-
const { layer } = ctx.cacheParams;
|
|
68602
|
-
cache_default.clearLayer(layer.id);
|
|
68603
|
-
cache_default._internal_unstable.storage.resolveLayer(layer.id);
|
|
68604
|
-
}
|
|
68605
|
-
throw error;
|
|
68606
|
-
}
|
|
68607
|
-
};
|
|
68608
|
-
});
|
|
68609
|
-
|
|
68610
68382
|
// src/lib/types.ts
|
|
68611
68383
|
var LogLevel = {
|
|
68612
68384
|
Full: "full",
|
|
@@ -69044,6 +68816,9 @@ var Config = class {
|
|
|
69044
68816
|
get loadingDirective() {
|
|
69045
68817
|
return `loading`;
|
|
69046
68818
|
}
|
|
68819
|
+
get runtimeScalarDirective() {
|
|
68820
|
+
return "__houdini__runtimeScalar";
|
|
68821
|
+
}
|
|
69047
68822
|
get whenDirective() {
|
|
69048
68823
|
return "when";
|
|
69049
68824
|
}
|
|
@@ -69114,7 +68889,7 @@ var Config = class {
|
|
|
69114
68889
|
const internalDirectives = this.#newSchemaInstance?.getDirectives().reduce((list, directive) => {
|
|
69115
68890
|
return list.concat(directive.name);
|
|
69116
68891
|
}, []) ?? [];
|
|
69117
|
-
return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name));
|
|
68892
|
+
return !defaultDirectives.includes(name) && (internalDirectives.includes(name) || this.isDeleteDirective(name) || name === this.runtimeScalarDirective);
|
|
69118
68893
|
}
|
|
69119
68894
|
get componentFieldDirective() {
|
|
69120
68895
|
return "componentField";
|
|
@@ -69617,7 +69392,7 @@ function formatErrors(e2, afterError) {
|
|
|
69617
69392
|
afterError?.(e2);
|
|
69618
69393
|
}
|
|
69619
69394
|
}
|
|
69620
|
-
function unwrapType(config2, type, wrappers = []) {
|
|
69395
|
+
function unwrapType(config2, type, wrappers = [], convertRuntimeScalars) {
|
|
69621
69396
|
if (type.kind === "NonNullType") {
|
|
69622
69397
|
return unwrapType(config2, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
69623
69398
|
}
|
|
@@ -69633,9 +69408,14 @@ function unwrapType(config2, type, wrappers = []) {
|
|
|
69633
69408
|
if (type instanceof graphql3.GraphQLList) {
|
|
69634
69409
|
return unwrapType(config2, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
69635
69410
|
}
|
|
69411
|
+
if (convertRuntimeScalars && config2.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
69412
|
+
type = config2.schema.getType(
|
|
69413
|
+
config2.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
69414
|
+
);
|
|
69415
|
+
}
|
|
69636
69416
|
const namedType = config2.schema.getType(type.name.value || type.name);
|
|
69637
69417
|
if (!namedType) {
|
|
69638
|
-
throw new Error("
|
|
69418
|
+
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
69639
69419
|
}
|
|
69640
69420
|
return { type: namedType, wrappers };
|
|
69641
69421
|
}
|
|
@@ -69772,6 +69552,231 @@ async function cleanupFiles(pathFolder, listOfObj) {
|
|
|
69772
69552
|
return allFilesNotInList;
|
|
69773
69553
|
}
|
|
69774
69554
|
|
|
69555
|
+
// src/runtime/router/match.ts
|
|
69556
|
+
var param_pattern = /^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;
|
|
69557
|
+
function parse_page_pattern(id) {
|
|
69558
|
+
const params = [];
|
|
69559
|
+
const pattern = id === "/" ? /^\/$/ : new RegExp(
|
|
69560
|
+
`^${get_route_segments(id).map((segment) => {
|
|
69561
|
+
const rest_match = /^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(segment);
|
|
69562
|
+
if (rest_match) {
|
|
69563
|
+
params.push({
|
|
69564
|
+
name: rest_match[1],
|
|
69565
|
+
matcher: rest_match[2],
|
|
69566
|
+
optional: false,
|
|
69567
|
+
rest: true,
|
|
69568
|
+
chained: true
|
|
69569
|
+
});
|
|
69570
|
+
return "(?:/(.*))?";
|
|
69571
|
+
}
|
|
69572
|
+
const optional_match = /^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(segment);
|
|
69573
|
+
if (optional_match) {
|
|
69574
|
+
params.push({
|
|
69575
|
+
name: optional_match[1],
|
|
69576
|
+
matcher: optional_match[2],
|
|
69577
|
+
optional: true,
|
|
69578
|
+
rest: false,
|
|
69579
|
+
chained: true
|
|
69580
|
+
});
|
|
69581
|
+
return "(?:/([^/]+))?";
|
|
69582
|
+
}
|
|
69583
|
+
if (!segment) {
|
|
69584
|
+
return;
|
|
69585
|
+
}
|
|
69586
|
+
const parts = segment.split(/\[(.+?)\](?!\])/);
|
|
69587
|
+
const result = parts.map((content, i2) => {
|
|
69588
|
+
if (i2 % 2) {
|
|
69589
|
+
if (content.startsWith("x+")) {
|
|
69590
|
+
return escape2(
|
|
69591
|
+
String.fromCharCode(parseInt(content.slice(2), 16))
|
|
69592
|
+
);
|
|
69593
|
+
}
|
|
69594
|
+
if (content.startsWith("u+")) {
|
|
69595
|
+
return escape2(
|
|
69596
|
+
String.fromCharCode(
|
|
69597
|
+
...content.slice(2).split("-").map((code) => parseInt(code, 16))
|
|
69598
|
+
)
|
|
69599
|
+
);
|
|
69600
|
+
}
|
|
69601
|
+
const match = param_pattern.exec(content);
|
|
69602
|
+
if (!match) {
|
|
69603
|
+
throw new Error(
|
|
69604
|
+
`Invalid param: ${content}. Params and matcher names can only have underscores and alphanumeric characters.`
|
|
69605
|
+
);
|
|
69606
|
+
}
|
|
69607
|
+
const [, is_optional, is_rest, name, matcher] = match;
|
|
69608
|
+
params.push({
|
|
69609
|
+
name,
|
|
69610
|
+
matcher,
|
|
69611
|
+
optional: !!is_optional,
|
|
69612
|
+
rest: !!is_rest,
|
|
69613
|
+
chained: is_rest ? i2 === 1 && parts[0] === "" : false
|
|
69614
|
+
});
|
|
69615
|
+
return is_rest ? "(.*?)" : is_optional ? "([^/]*)?" : "([^/]+?)";
|
|
69616
|
+
}
|
|
69617
|
+
return escape2(content);
|
|
69618
|
+
}).join("");
|
|
69619
|
+
return "/" + result;
|
|
69620
|
+
}).join("")}/?$`
|
|
69621
|
+
);
|
|
69622
|
+
return { pattern, params, page_id: id };
|
|
69623
|
+
}
|
|
69624
|
+
function affects_path(segment) {
|
|
69625
|
+
return !/^\([^)]+\)$/.test(segment);
|
|
69626
|
+
}
|
|
69627
|
+
function get_route_segments(route) {
|
|
69628
|
+
return route.slice(1).split("/").filter(affects_path);
|
|
69629
|
+
}
|
|
69630
|
+
function escape2(str) {
|
|
69631
|
+
return str.normalize().replace(/[[\]]/g, "\\$&").replace(/%/g, "%25").replace(/\//g, "%2[Ff]").replace(/\?/g, "%3[Ff]").replace(/#/g, "%23").replace(/[.*+?^${}()|\\]/g, "\\$&");
|
|
69632
|
+
}
|
|
69633
|
+
|
|
69634
|
+
// src/lib/typescript.ts
|
|
69635
|
+
var graphql4 = __toESM(require("graphql"), 1);
|
|
69636
|
+
var recast2 = __toESM(require_main2(), 1);
|
|
69637
|
+
var AST2 = recast2.types.builders;
|
|
69638
|
+
function unwrappedTsTypeReference(config2, filepath, missingScalars, {
|
|
69639
|
+
type,
|
|
69640
|
+
wrappers
|
|
69641
|
+
}, body) {
|
|
69642
|
+
let result;
|
|
69643
|
+
if (graphql4.isScalarType(type)) {
|
|
69644
|
+
result = scalarPropertyValue(config2, filepath, missingScalars, type, body, null);
|
|
69645
|
+
} else if (graphql4.isEnumType(type)) {
|
|
69646
|
+
result = enumReference(config2, body, type.name);
|
|
69647
|
+
} else {
|
|
69648
|
+
result = AST2.tsTypeReference(AST2.identifier(type.name));
|
|
69649
|
+
}
|
|
69650
|
+
for (const toWrap of wrappers) {
|
|
69651
|
+
if (toWrap === "NonNull" /* NonNull */) {
|
|
69652
|
+
continue;
|
|
69653
|
+
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
69654
|
+
result = nullableField(result, true);
|
|
69655
|
+
} else if (toWrap === "List" /* List */) {
|
|
69656
|
+
result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
|
|
69657
|
+
}
|
|
69658
|
+
}
|
|
69659
|
+
return result;
|
|
69660
|
+
}
|
|
69661
|
+
function tsTypeReference(config2, filepath, missingScalars, definition, body) {
|
|
69662
|
+
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
69663
|
+
return unwrappedTsTypeReference(
|
|
69664
|
+
config2,
|
|
69665
|
+
filepath,
|
|
69666
|
+
missingScalars,
|
|
69667
|
+
{ type, wrappers },
|
|
69668
|
+
body
|
|
69669
|
+
);
|
|
69670
|
+
}
|
|
69671
|
+
function enumReference(config2, body, name) {
|
|
69672
|
+
ensureImports({
|
|
69673
|
+
config: config2,
|
|
69674
|
+
body,
|
|
69675
|
+
import: ["ValueOf"],
|
|
69676
|
+
importKind: "type",
|
|
69677
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
69678
|
+
});
|
|
69679
|
+
return AST2.tsTypeReference(
|
|
69680
|
+
AST2.identifier("ValueOf"),
|
|
69681
|
+
AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
|
|
69682
|
+
);
|
|
69683
|
+
}
|
|
69684
|
+
function readonlyProperty(prop, enable = true) {
|
|
69685
|
+
if (enable) {
|
|
69686
|
+
prop.readonly = true;
|
|
69687
|
+
}
|
|
69688
|
+
return prop;
|
|
69689
|
+
}
|
|
69690
|
+
function nullableField(inner, input = false) {
|
|
69691
|
+
const members = [inner, AST2.tsNullKeyword()];
|
|
69692
|
+
if (input) {
|
|
69693
|
+
members.push(AST2.tsUndefinedKeyword());
|
|
69694
|
+
}
|
|
69695
|
+
return AST2.tsUnionType(members);
|
|
69696
|
+
}
|
|
69697
|
+
function scalarPropertyValue(config2, filepath, missingScalars, target, body, field) {
|
|
69698
|
+
if (config2.configFile.features?.componentFields && target.name === config2.componentScalar) {
|
|
69699
|
+
if (!field) {
|
|
69700
|
+
return AST2.tsNeverKeyword();
|
|
69701
|
+
}
|
|
69702
|
+
const component = config2.componentFields[field.parent][field.field];
|
|
69703
|
+
const sourcePathRelative = path_exports.relative(
|
|
69704
|
+
path_exports.join(config2.projectRoot, "src"),
|
|
69705
|
+
component.filepath
|
|
69706
|
+
);
|
|
69707
|
+
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
69708
|
+
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
69709
|
+
const localImport = ensureImports({
|
|
69710
|
+
config: config2,
|
|
69711
|
+
body,
|
|
69712
|
+
import: "__component__" + component.fragment,
|
|
69713
|
+
sourceModule: path_exports.join(
|
|
69714
|
+
path_exports.relative(path_exports.dirname(filepath), config2.projectRoot),
|
|
69715
|
+
"src",
|
|
69716
|
+
sourcePath
|
|
69717
|
+
)
|
|
69718
|
+
}) ?? "__component__" + component.fragment;
|
|
69719
|
+
const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
|
|
69720
|
+
parameters.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
69721
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
69722
|
+
]);
|
|
69723
|
+
const indexed = AST2.tsIndexedAccessType(
|
|
69724
|
+
parameters,
|
|
69725
|
+
AST2.tsLiteralType(AST2.numericLiteral(0))
|
|
69726
|
+
);
|
|
69727
|
+
const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
|
|
69728
|
+
omit.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
69729
|
+
indexed,
|
|
69730
|
+
AST2.tsLiteralType(AST2.stringLiteral(component.prop))
|
|
69731
|
+
]);
|
|
69732
|
+
const arg = AST2.identifier("props");
|
|
69733
|
+
arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
|
|
69734
|
+
const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
|
|
69735
|
+
returnType.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
69736
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
69737
|
+
]);
|
|
69738
|
+
const fnType = AST2.tsFunctionType([arg]);
|
|
69739
|
+
fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
|
|
69740
|
+
return fnType;
|
|
69741
|
+
}
|
|
69742
|
+
switch (target.name) {
|
|
69743
|
+
case "String": {
|
|
69744
|
+
return AST2.tsStringKeyword();
|
|
69745
|
+
}
|
|
69746
|
+
case "Int": {
|
|
69747
|
+
return AST2.tsNumberKeyword();
|
|
69748
|
+
}
|
|
69749
|
+
case "Float": {
|
|
69750
|
+
return AST2.tsNumberKeyword();
|
|
69751
|
+
}
|
|
69752
|
+
case "Boolean": {
|
|
69753
|
+
return AST2.tsBooleanKeyword();
|
|
69754
|
+
}
|
|
69755
|
+
case "ID": {
|
|
69756
|
+
return AST2.tsStringKeyword();
|
|
69757
|
+
}
|
|
69758
|
+
default: {
|
|
69759
|
+
if (graphql4.isNonNullType(target) && "ofType" in target) {
|
|
69760
|
+
return scalarPropertyValue(
|
|
69761
|
+
config2,
|
|
69762
|
+
filepath,
|
|
69763
|
+
missingScalars,
|
|
69764
|
+
target.ofType,
|
|
69765
|
+
body,
|
|
69766
|
+
field
|
|
69767
|
+
);
|
|
69768
|
+
}
|
|
69769
|
+
if (config2.scalars?.[target.name]) {
|
|
69770
|
+
return AST2.tsTypeReference(AST2.identifier(config2.scalars?.[target.name].type));
|
|
69771
|
+
}
|
|
69772
|
+
if (target.name !== config2.componentScalar) {
|
|
69773
|
+
missingScalars.add(target.name);
|
|
69774
|
+
}
|
|
69775
|
+
return AST2.tsAnyKeyword();
|
|
69776
|
+
}
|
|
69777
|
+
}
|
|
69778
|
+
}
|
|
69779
|
+
|
|
69775
69780
|
// ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
|
|
69776
69781
|
var WalkerBase = class {
|
|
69777
69782
|
constructor() {
|
|
@@ -69885,7 +69890,7 @@ async function asyncWalk(ast, { enter, leave }) {
|
|
|
69885
69890
|
}
|
|
69886
69891
|
|
|
69887
69892
|
// src/lib/walk.ts
|
|
69888
|
-
var
|
|
69893
|
+
var graphql5 = __toESM(require("graphql"), 1);
|
|
69889
69894
|
async function find_graphql(config2, parsedScript, walker) {
|
|
69890
69895
|
await asyncWalk(parsedScript, {
|
|
69891
69896
|
async enter(node, parent2) {
|
|
@@ -69940,7 +69945,7 @@ async function find_graphql(config2, parsedScript, walker) {
|
|
|
69940
69945
|
} else if (!documentString) {
|
|
69941
69946
|
return;
|
|
69942
69947
|
}
|
|
69943
|
-
const parsedTag =
|
|
69948
|
+
const parsedTag = graphql5.parse(documentString);
|
|
69944
69949
|
if (walker.where && !walker.where(parsedTag, { node, parent: parent2 })) {
|
|
69945
69950
|
return;
|
|
69946
69951
|
}
|
|
@@ -70072,7 +70077,7 @@ function extractAnonymousQuery(config2, raw, expr, propName) {
|
|
|
70072
70077
|
};
|
|
70073
70078
|
return defs.concat([
|
|
70074
70079
|
{
|
|
70075
|
-
raw:
|
|
70080
|
+
raw: graphql5.print(parsed),
|
|
70076
70081
|
parsed
|
|
70077
70082
|
}
|
|
70078
70083
|
]);
|
|
@@ -70213,7 +70218,7 @@ function serialized_manifest_path(config2, base = base_dir(config2)) {
|
|
|
70213
70218
|
|
|
70214
70219
|
// src/lib/router/manifest.ts
|
|
70215
70220
|
var t2 = __toESM(require_lib6(), 1);
|
|
70216
|
-
var
|
|
70221
|
+
var graphql6 = __toESM(require("graphql"), 1);
|
|
70217
70222
|
async function load_manifest(args) {
|
|
70218
70223
|
const manifest = await walk_routes({
|
|
70219
70224
|
config: args.config,
|
|
@@ -70230,7 +70235,8 @@ async function load_manifest(args) {
|
|
|
70230
70235
|
local_yoga: false
|
|
70231
70236
|
},
|
|
70232
70237
|
queries: [],
|
|
70233
|
-
layouts: []
|
|
70238
|
+
layouts: [],
|
|
70239
|
+
variables: {}
|
|
70234
70240
|
});
|
|
70235
70241
|
if (args.includeArtifacts) {
|
|
70236
70242
|
try {
|
|
@@ -70261,6 +70267,7 @@ async function walk_routes(args) {
|
|
|
70261
70267
|
const directory_contents = await fs_exports.readdir(args.filepath, {
|
|
70262
70268
|
withFileTypes: true
|
|
70263
70269
|
});
|
|
70270
|
+
const variables = { ...args.variables };
|
|
70264
70271
|
let newLayouts = args.layouts;
|
|
70265
70272
|
let newLayoutQueries = args.queries;
|
|
70266
70273
|
let layout = null;
|
|
@@ -70284,7 +70291,8 @@ async function walk_routes(args) {
|
|
|
70284
70291
|
url: args.url,
|
|
70285
70292
|
project: args.project,
|
|
70286
70293
|
type: "layout",
|
|
70287
|
-
contents: layoutQueryContents
|
|
70294
|
+
contents: layoutQueryContents,
|
|
70295
|
+
variables
|
|
70288
70296
|
});
|
|
70289
70297
|
newLayoutQueries = [...args.queries, layoutQuery.name];
|
|
70290
70298
|
}
|
|
@@ -70297,7 +70305,8 @@ async function walk_routes(args) {
|
|
|
70297
70305
|
contents: layoutViewContents,
|
|
70298
70306
|
layouts: args.layouts,
|
|
70299
70307
|
queries: newLayoutQueries,
|
|
70300
|
-
config: args.config
|
|
70308
|
+
config: args.config,
|
|
70309
|
+
variables
|
|
70301
70310
|
});
|
|
70302
70311
|
newLayouts = [...args.layouts, page_id(layout.url)];
|
|
70303
70312
|
}
|
|
@@ -70308,7 +70317,8 @@ async function walk_routes(args) {
|
|
|
70308
70317
|
url: args.url,
|
|
70309
70318
|
project: args.project,
|
|
70310
70319
|
type: "page",
|
|
70311
|
-
contents: pageQueryContents
|
|
70320
|
+
contents: pageQueryContents,
|
|
70321
|
+
variables
|
|
70312
70322
|
});
|
|
70313
70323
|
}
|
|
70314
70324
|
if (pageViewContents) {
|
|
@@ -70320,7 +70330,8 @@ async function walk_routes(args) {
|
|
|
70320
70330
|
contents: pageViewContents,
|
|
70321
70331
|
layouts: newLayouts,
|
|
70322
70332
|
queries: pageQuery ? [...newLayoutQueries, pageQuery.name] : newLayoutQueries,
|
|
70323
|
-
config: args.config
|
|
70333
|
+
config: args.config,
|
|
70334
|
+
variables
|
|
70324
70335
|
});
|
|
70325
70336
|
}
|
|
70326
70337
|
await Promise.all(
|
|
@@ -70333,7 +70344,8 @@ async function walk_routes(args) {
|
|
|
70333
70344
|
filepath: path_exports.join(args.filepath, dir.name),
|
|
70334
70345
|
url: `${args.url}${dir.name}/`,
|
|
70335
70346
|
queries: newLayoutQueries,
|
|
70336
|
-
layouts: newLayouts
|
|
70347
|
+
layouts: newLayouts,
|
|
70348
|
+
variables
|
|
70337
70349
|
});
|
|
70338
70350
|
})
|
|
70339
70351
|
);
|
|
@@ -70355,12 +70367,18 @@ async function add_view(args) {
|
|
|
70355
70367
|
url: args.url,
|
|
70356
70368
|
layouts: args.layouts,
|
|
70357
70369
|
path: path_exports.relative(args.config.projectRoot, args.path),
|
|
70358
|
-
query_options: args.queries
|
|
70370
|
+
query_options: args.queries,
|
|
70371
|
+
params: Object.fromEntries(
|
|
70372
|
+
parse_page_pattern(args.url).params.map((param) => [
|
|
70373
|
+
param.name,
|
|
70374
|
+
args.variables[param.name] ?? null
|
|
70375
|
+
])
|
|
70376
|
+
)
|
|
70359
70377
|
};
|
|
70360
70378
|
return target[id];
|
|
70361
70379
|
}
|
|
70362
70380
|
async function add_query(args) {
|
|
70363
|
-
const parsed =
|
|
70381
|
+
const parsed = graphql6.parse(args.contents);
|
|
70364
70382
|
const query2 = parsed.definitions.find(
|
|
70365
70383
|
(def) => def.kind === "OperationDefinition" && def.operation === "query"
|
|
70366
70384
|
);
|
|
@@ -70368,20 +70386,30 @@ async function add_query(args) {
|
|
|
70368
70386
|
throw new Error("No query found");
|
|
70369
70387
|
}
|
|
70370
70388
|
let loading = false;
|
|
70371
|
-
await
|
|
70389
|
+
await graphql6.visit(parsed, {
|
|
70372
70390
|
Directive(node) {
|
|
70373
70391
|
if (node.name.value === args.config.loadingDirective) {
|
|
70374
70392
|
loading = true;
|
|
70375
70393
|
}
|
|
70376
70394
|
}
|
|
70377
70395
|
});
|
|
70396
|
+
const queryVariables = Object.fromEntries(
|
|
70397
|
+
query2.variableDefinitions?.map((variable) => {
|
|
70398
|
+
const { type, wrappers } = unwrapType(args.config, variable.type, [], true);
|
|
70399
|
+
return [
|
|
70400
|
+
variable.variable.name.value,
|
|
70401
|
+
{ wrappers, type: type.name }
|
|
70402
|
+
];
|
|
70403
|
+
}) ?? []
|
|
70404
|
+
);
|
|
70405
|
+
Object.assign(args.variables, queryVariables);
|
|
70378
70406
|
const target = args.type === "page" ? args.project.page_queries : args.project.layout_queries;
|
|
70379
70407
|
target[page_id(args.url)] = {
|
|
70380
70408
|
path: path_exports.relative(args.config.routesDir, args.path),
|
|
70381
70409
|
name: query2.name.value,
|
|
70382
70410
|
url: args.url,
|
|
70383
70411
|
loading,
|
|
70384
|
-
variables:
|
|
70412
|
+
variables: queryVariables
|
|
70385
70413
|
};
|
|
70386
70414
|
return target[page_id(args.url)];
|
|
70387
70415
|
}
|
|
@@ -70477,8 +70505,8 @@ async function loadLocalSchema(config2) {
|
|
|
70477
70505
|
}
|
|
70478
70506
|
|
|
70479
70507
|
// src/codegen/generators/artifacts/index.ts
|
|
70480
|
-
var
|
|
70481
|
-
var
|
|
70508
|
+
var graphql17 = __toESM(require("graphql"), 1);
|
|
70509
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
70482
70510
|
|
|
70483
70511
|
// src/codegen/utils/commonjs.ts
|
|
70484
70512
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -70720,19 +70748,19 @@ var FieldCollection = class {
|
|
|
70720
70748
|
};
|
|
70721
70749
|
|
|
70722
70750
|
// src/codegen/utils/moduleExport.ts
|
|
70723
|
-
var
|
|
70724
|
-
var
|
|
70751
|
+
var recast3 = __toESM(require_main2(), 1);
|
|
70752
|
+
var AST3 = recast3.types.builders;
|
|
70725
70753
|
function moduleExport(config2, key, value) {
|
|
70726
70754
|
if (config2.module === "commonjs") {
|
|
70727
|
-
let target =
|
|
70755
|
+
let target = AST3.memberExpression(AST3.identifier("module"), AST3.identifier("exports"));
|
|
70728
70756
|
if (key !== "default") {
|
|
70729
|
-
target =
|
|
70757
|
+
target = AST3.memberExpression(target, AST3.identifier(key));
|
|
70730
70758
|
}
|
|
70731
|
-
return
|
|
70759
|
+
return AST3.expressionStatement(AST3.assignmentExpression("=", target, value));
|
|
70732
70760
|
}
|
|
70733
|
-
return key === "default" ?
|
|
70734
|
-
|
|
70735
|
-
|
|
70761
|
+
return key === "default" ? AST3.exportDefaultDeclaration(value) : AST3.exportNamedDeclaration(
|
|
70762
|
+
AST3.variableDeclaration("const", [
|
|
70763
|
+
AST3.variableDeclarator(AST3.identifier(key), value)
|
|
70736
70764
|
])
|
|
70737
70765
|
);
|
|
70738
70766
|
}
|
|
@@ -70989,7 +71017,7 @@ var serialize = (value, { json, lossy } = {}) => {
|
|
|
70989
71017
|
var esm_default = typeof structuredClone === "function" ? (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any) : (any, options) => deserialize(serialize(any, options));
|
|
70990
71018
|
|
|
70991
71019
|
// src/codegen/transforms/fragmentVariables.ts
|
|
70992
|
-
var
|
|
71020
|
+
var graphql8 = __toESM(require("graphql"), 1);
|
|
70993
71021
|
|
|
70994
71022
|
// src/codegen/utils/stripLoc.ts
|
|
70995
71023
|
function stripLoc(value) {
|
|
@@ -71010,13 +71038,13 @@ function stripLoc(value) {
|
|
|
71010
71038
|
}
|
|
71011
71039
|
|
|
71012
71040
|
// src/codegen/transforms/collectDefinitions.ts
|
|
71013
|
-
var
|
|
71014
|
-
var
|
|
71041
|
+
var graphql7 = __toESM(require("graphql"), 1);
|
|
71042
|
+
var import_graphql32 = require("graphql");
|
|
71015
71043
|
async function includeFragmentDefinitions(config2, documents) {
|
|
71016
71044
|
const fragments = collectDefinitions(config2, documents);
|
|
71017
71045
|
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
71018
71046
|
const operation = document.definitions.find(
|
|
71019
|
-
(def) => def.kind ===
|
|
71047
|
+
(def) => def.kind === import_graphql32.Kind.OPERATION_DEFINITION || def.kind === "FragmentDefinition"
|
|
71020
71048
|
);
|
|
71021
71049
|
if (!operation) {
|
|
71022
71050
|
continue;
|
|
@@ -71060,10 +71088,10 @@ function collectDefinitions(config2, docs) {
|
|
|
71060
71088
|
}
|
|
71061
71089
|
function findRequiredFragments(config2, definition) {
|
|
71062
71090
|
const referencedFragments = [];
|
|
71063
|
-
const typeInfo = new
|
|
71064
|
-
definition.selectionSet =
|
|
71091
|
+
const typeInfo = new graphql7.TypeInfo(config2.schema);
|
|
71092
|
+
definition.selectionSet = graphql7.visit(
|
|
71065
71093
|
definition,
|
|
71066
|
-
|
|
71094
|
+
graphql7.visitWithTypeInfo(typeInfo, {
|
|
71067
71095
|
FragmentSpread(node) {
|
|
71068
71096
|
referencedFragments.push(node.name.value);
|
|
71069
71097
|
}
|
|
@@ -71097,7 +71125,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
71097
71125
|
}
|
|
71098
71126
|
|
|
71099
71127
|
// src/codegen/transforms/fragmentVariables.ts
|
|
71100
|
-
var GraphqlKinds2 =
|
|
71128
|
+
var GraphqlKinds2 = graphql8.Kind;
|
|
71101
71129
|
async function fragmentVariables(config2, documents) {
|
|
71102
71130
|
const fragments = collectDefinitions(config2, documents);
|
|
71103
71131
|
const generatedFragments = {};
|
|
@@ -71120,7 +71148,7 @@ async function fragmentVariables(config2, documents) {
|
|
|
71120
71148
|
});
|
|
71121
71149
|
}
|
|
71122
71150
|
const doc = {
|
|
71123
|
-
kind:
|
|
71151
|
+
kind: graphql8.Kind.DOCUMENT,
|
|
71124
71152
|
definitions: Object.values(generatedFragments)
|
|
71125
71153
|
};
|
|
71126
71154
|
documents.push({
|
|
@@ -71191,7 +71219,7 @@ function inlineFragmentArgs({
|
|
|
71191
71219
|
return null;
|
|
71192
71220
|
};
|
|
71193
71221
|
const result = esm_default(
|
|
71194
|
-
|
|
71222
|
+
graphql8.visit(document, {
|
|
71195
71223
|
FragmentSpread(node) {
|
|
71196
71224
|
if (!fragmentDefinitions[node.name.value]) {
|
|
71197
71225
|
throw new Error("Could not find definition for fragment" + node.name.value);
|
|
@@ -71277,7 +71305,7 @@ function inlineFragmentArgs({
|
|
|
71277
71305
|
);
|
|
71278
71306
|
if (newName) {
|
|
71279
71307
|
result.name = {
|
|
71280
|
-
kind:
|
|
71308
|
+
kind: graphql8.Kind.NAME,
|
|
71281
71309
|
value: newName
|
|
71282
71310
|
};
|
|
71283
71311
|
}
|
|
@@ -71444,8 +71472,8 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
|
|
|
71444
71472
|
}
|
|
71445
71473
|
|
|
71446
71474
|
// src/codegen/generators/artifacts/inputs.ts
|
|
71447
|
-
var
|
|
71448
|
-
function inputObject(config2, inputs) {
|
|
71475
|
+
var graphql9 = __toESM(require("graphql"), 1);
|
|
71476
|
+
function inputObject(config2, inputs, runtimeScalars) {
|
|
71449
71477
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
71450
71478
|
const inputObj = {
|
|
71451
71479
|
fields: inputs.reduce((fields, input) => {
|
|
@@ -71461,7 +71489,8 @@ function inputObject(config2, inputs) {
|
|
|
71461
71489
|
...fields,
|
|
71462
71490
|
[input.variable.name.value]: input.defaultValue ? variableValue(input.defaultValue, {}) : void 0
|
|
71463
71491
|
};
|
|
71464
|
-
}, {})
|
|
71492
|
+
}, {}),
|
|
71493
|
+
runtimeScalars
|
|
71465
71494
|
};
|
|
71466
71495
|
for (const input of inputs) {
|
|
71467
71496
|
walkInputs(config2, visitedTypes, inputObj, input.type);
|
|
@@ -71473,10 +71502,10 @@ function walkInputs(config2, visitedTypes, inputObj, rootType) {
|
|
|
71473
71502
|
if (visitedTypes.has(type.name)) {
|
|
71474
71503
|
return;
|
|
71475
71504
|
}
|
|
71476
|
-
if (
|
|
71505
|
+
if (graphql9.isEnumType(type) || graphql9.isScalarType(type)) {
|
|
71477
71506
|
return;
|
|
71478
71507
|
}
|
|
71479
|
-
if (
|
|
71508
|
+
if (graphql9.isUnionType(type)) {
|
|
71480
71509
|
return;
|
|
71481
71510
|
}
|
|
71482
71511
|
visitedTypes.add(type.name);
|
|
@@ -71494,50 +71523,50 @@ function walkInputs(config2, visitedTypes, inputObj, rootType) {
|
|
|
71494
71523
|
}
|
|
71495
71524
|
|
|
71496
71525
|
// src/codegen/generators/artifacts/operations.ts
|
|
71497
|
-
var
|
|
71526
|
+
var graphql11 = __toESM(require("graphql"), 1);
|
|
71498
71527
|
|
|
71499
71528
|
// src/codegen/generators/artifacts/utils.ts
|
|
71500
|
-
var
|
|
71501
|
-
var
|
|
71502
|
-
var
|
|
71529
|
+
var graphql10 = __toESM(require("graphql"), 1);
|
|
71530
|
+
var recast4 = __toESM(require_main2(), 1);
|
|
71531
|
+
var AST4 = recast4.types.builders;
|
|
71503
71532
|
function serializeValue(value) {
|
|
71504
71533
|
if (Array.isArray(value)) {
|
|
71505
|
-
return
|
|
71534
|
+
return AST4.arrayExpression(value.map(serializeValue));
|
|
71506
71535
|
}
|
|
71507
71536
|
if (typeof value === "object" && value !== null) {
|
|
71508
|
-
return
|
|
71537
|
+
return AST4.objectExpression(
|
|
71509
71538
|
Object.entries(value).filter(([key, value2]) => typeof value2 !== "undefined").map(([key, val]) => {
|
|
71510
|
-
return
|
|
71539
|
+
return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
|
|
71511
71540
|
})
|
|
71512
71541
|
);
|
|
71513
71542
|
}
|
|
71514
71543
|
if (typeof value === "string") {
|
|
71515
71544
|
if (value.indexOf("\n") !== -1) {
|
|
71516
|
-
return
|
|
71517
|
-
[
|
|
71545
|
+
return AST4.templateLiteral(
|
|
71546
|
+
[AST4.templateElement({ raw: value, cooked: value }, true)],
|
|
71518
71547
|
[]
|
|
71519
71548
|
);
|
|
71520
71549
|
}
|
|
71521
|
-
return
|
|
71550
|
+
return AST4.stringLiteral(value);
|
|
71522
71551
|
}
|
|
71523
|
-
return
|
|
71552
|
+
return AST4.literal(value);
|
|
71524
71553
|
}
|
|
71525
71554
|
function convertValue(config2, val) {
|
|
71526
71555
|
let value;
|
|
71527
71556
|
let kind;
|
|
71528
|
-
if (val.kind ===
|
|
71557
|
+
if (val.kind === graphql10.Kind.INT) {
|
|
71529
71558
|
value = parseInt(val.value, 10);
|
|
71530
71559
|
kind = "Int";
|
|
71531
|
-
} else if (val.kind ===
|
|
71560
|
+
} else if (val.kind === graphql10.Kind.FLOAT) {
|
|
71532
71561
|
value = parseFloat(val.value);
|
|
71533
71562
|
kind = "Float";
|
|
71534
|
-
} else if (val.kind ===
|
|
71563
|
+
} else if (val.kind === graphql10.Kind.BOOLEAN) {
|
|
71535
71564
|
value = val.value;
|
|
71536
71565
|
kind = "Boolean";
|
|
71537
|
-
} else if (val.kind ===
|
|
71566
|
+
} else if (val.kind === graphql10.Kind.VARIABLE) {
|
|
71538
71567
|
value = val.name.value;
|
|
71539
71568
|
kind = "Variable";
|
|
71540
|
-
} else if (val.kind ===
|
|
71569
|
+
} else if (val.kind === graphql10.Kind.STRING) {
|
|
71541
71570
|
value = val.value;
|
|
71542
71571
|
kind = "String";
|
|
71543
71572
|
}
|
|
@@ -71550,7 +71579,7 @@ function operationsByPath(config2, filepath, definition, filterTypes) {
|
|
|
71550
71579
|
return {};
|
|
71551
71580
|
}
|
|
71552
71581
|
const pathOperations = {};
|
|
71553
|
-
|
|
71582
|
+
graphql11.visit(definition, {
|
|
71554
71583
|
FragmentSpread(node, _, __, ___, ancestors) {
|
|
71555
71584
|
if (!config2.isListFragment(node.name.value)) {
|
|
71556
71585
|
return;
|
|
@@ -71709,19 +71738,19 @@ function ancestorKey(ancestors) {
|
|
|
71709
71738
|
}
|
|
71710
71739
|
|
|
71711
71740
|
// src/codegen/generators/artifacts/selection.ts
|
|
71712
|
-
var
|
|
71741
|
+
var graphql16 = __toESM(require("graphql"), 1);
|
|
71713
71742
|
|
|
71714
71743
|
// src/codegen/transforms/list.ts
|
|
71715
|
-
var
|
|
71744
|
+
var graphql14 = __toESM(require("graphql"), 1);
|
|
71716
71745
|
|
|
71717
71746
|
// src/codegen/utils/objectIdentificationSelection.ts
|
|
71718
|
-
var
|
|
71747
|
+
var graphql12 = __toESM(require("graphql"), 1);
|
|
71719
71748
|
var objectIdentificationSelection = (config2, type) => {
|
|
71720
71749
|
return config2.keyFieldsForType(type.name).map((key) => {
|
|
71721
71750
|
return {
|
|
71722
|
-
kind:
|
|
71751
|
+
kind: graphql12.Kind.FIELD,
|
|
71723
71752
|
name: {
|
|
71724
|
-
kind:
|
|
71753
|
+
kind: graphql12.Kind.NAME,
|
|
71725
71754
|
value: key
|
|
71726
71755
|
}
|
|
71727
71756
|
};
|
|
@@ -71729,7 +71758,7 @@ var objectIdentificationSelection = (config2, type) => {
|
|
|
71729
71758
|
};
|
|
71730
71759
|
|
|
71731
71760
|
// src/codegen/transforms/paginate.ts
|
|
71732
|
-
var
|
|
71761
|
+
var graphql13 = __toESM(require("graphql"), 1);
|
|
71733
71762
|
async function paginate(config2, documents) {
|
|
71734
71763
|
const newDocs = [];
|
|
71735
71764
|
for (const doc of documents) {
|
|
@@ -71762,7 +71791,7 @@ async function paginate(config2, documents) {
|
|
|
71762
71791
|
};
|
|
71763
71792
|
let cursorType = "String";
|
|
71764
71793
|
let paginationPath = [];
|
|
71765
|
-
doc.document =
|
|
71794
|
+
doc.document = graphql13.visit(doc.document, {
|
|
71766
71795
|
Field(node, _, __, ___, ancestors) {
|
|
71767
71796
|
const paginateDirective = node.directives?.find(
|
|
71768
71797
|
(directive) => directive.name.value === config2.paginateDirective
|
|
@@ -71788,7 +71817,7 @@ async function paginate(config2, documents) {
|
|
|
71788
71817
|
flags.offset.enabled = offsetPagination;
|
|
71789
71818
|
flags.limit.enabled = offsetPagination;
|
|
71790
71819
|
paginationPath = ancestors.filter(
|
|
71791
|
-
(ancestor) => !Array.isArray(ancestor) && ancestor.kind ===
|
|
71820
|
+
(ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql13.Kind.FIELD
|
|
71792
71821
|
).concat(node).map((field) => field.alias?.value || field.name.value);
|
|
71793
71822
|
return {
|
|
71794
71823
|
...node,
|
|
@@ -71807,7 +71836,7 @@ async function paginate(config2, documents) {
|
|
|
71807
71836
|
let fragment2 = "";
|
|
71808
71837
|
let paginateMode = config2.defaultPaginateMode;
|
|
71809
71838
|
const requiredArgs = [];
|
|
71810
|
-
doc.document =
|
|
71839
|
+
doc.document = graphql13.visit(doc.document, {
|
|
71811
71840
|
OperationDefinition(node) {
|
|
71812
71841
|
if (node.operation !== "query") {
|
|
71813
71842
|
throw new HoudiniError({
|
|
@@ -71866,9 +71895,9 @@ async function paginate(config2, documents) {
|
|
|
71866
71895
|
directives: [
|
|
71867
71896
|
...node.directives || [],
|
|
71868
71897
|
{
|
|
71869
|
-
kind:
|
|
71898
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
71870
71899
|
name: {
|
|
71871
|
-
kind:
|
|
71900
|
+
kind: graphql13.Kind.NAME,
|
|
71872
71901
|
value: config2.argumentsDirective
|
|
71873
71902
|
}
|
|
71874
71903
|
}
|
|
@@ -71938,22 +71967,22 @@ async function paginate(config2, documents) {
|
|
|
71938
71967
|
const paginationArgs = Object.entries(flags).filter(([_, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
|
|
71939
71968
|
const fragmentSpreadSelection = [
|
|
71940
71969
|
{
|
|
71941
|
-
kind:
|
|
71970
|
+
kind: graphql13.Kind.FRAGMENT_SPREAD,
|
|
71942
71971
|
name: {
|
|
71943
|
-
kind:
|
|
71972
|
+
kind: graphql13.Kind.NAME,
|
|
71944
71973
|
value: fragmentName
|
|
71945
71974
|
},
|
|
71946
71975
|
directives: [
|
|
71947
71976
|
{
|
|
71948
|
-
kind:
|
|
71977
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
71949
71978
|
name: {
|
|
71950
|
-
kind:
|
|
71979
|
+
kind: graphql13.Kind.NAME,
|
|
71951
71980
|
value: config2.withDirective
|
|
71952
71981
|
},
|
|
71953
71982
|
["arguments"]: requiredArgs.map((arg) => variableAsArgument(arg.name)).concat(paginationArgs.map(({ name }) => variableAsArgument(name)))
|
|
71954
71983
|
},
|
|
71955
71984
|
{
|
|
71956
|
-
kind:
|
|
71985
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
71957
71986
|
name: {
|
|
71958
71987
|
kind: "Name",
|
|
71959
71988
|
value: config2.maskDisableDirective
|
|
@@ -71980,23 +72009,23 @@ async function paginate(config2, documents) {
|
|
|
71980
72009
|
});
|
|
71981
72010
|
const typeConfig = config2.typeConfig?.[fragment2];
|
|
71982
72011
|
const queryDoc = {
|
|
71983
|
-
kind:
|
|
72012
|
+
kind: graphql13.Kind.DOCUMENT,
|
|
71984
72013
|
definitions: [
|
|
71985
72014
|
{
|
|
71986
|
-
kind:
|
|
72015
|
+
kind: graphql13.Kind.OPERATION_DEFINITION,
|
|
71987
72016
|
name: {
|
|
71988
|
-
kind:
|
|
72017
|
+
kind: graphql13.Kind.NAME,
|
|
71989
72018
|
value: refetchQueryName
|
|
71990
72019
|
},
|
|
71991
72020
|
operation: "query",
|
|
71992
72021
|
variableDefinitions: requiredArgs.map(
|
|
71993
72022
|
(arg) => ({
|
|
71994
|
-
kind:
|
|
72023
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
71995
72024
|
type: arg.type,
|
|
71996
72025
|
variable: {
|
|
71997
|
-
kind:
|
|
72026
|
+
kind: graphql13.Kind.VARIABLE,
|
|
71998
72027
|
name: {
|
|
71999
|
-
kind:
|
|
72028
|
+
kind: graphql13.Kind.NAME,
|
|
72000
72029
|
value: arg.name
|
|
72001
72030
|
}
|
|
72002
72031
|
}
|
|
@@ -72004,18 +72033,18 @@ async function paginate(config2, documents) {
|
|
|
72004
72033
|
).concat(
|
|
72005
72034
|
paginationArgs.map(
|
|
72006
72035
|
(arg) => ({
|
|
72007
|
-
kind:
|
|
72036
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
72008
72037
|
type: {
|
|
72009
|
-
kind:
|
|
72038
|
+
kind: graphql13.Kind.NAMED_TYPE,
|
|
72010
72039
|
name: {
|
|
72011
|
-
kind:
|
|
72040
|
+
kind: graphql13.Kind.NAME,
|
|
72012
72041
|
value: arg.type
|
|
72013
72042
|
}
|
|
72014
72043
|
},
|
|
72015
72044
|
variable: {
|
|
72016
|
-
kind:
|
|
72045
|
+
kind: graphql13.Kind.VARIABLE,
|
|
72017
72046
|
name: {
|
|
72018
|
-
kind:
|
|
72047
|
+
kind: graphql13.Kind.NAME,
|
|
72019
72048
|
value: arg.name
|
|
72020
72049
|
}
|
|
72021
72050
|
},
|
|
@@ -72027,12 +72056,12 @@ async function paginate(config2, documents) {
|
|
|
72027
72056
|
).concat(
|
|
72028
72057
|
!nodeQuery ? [] : keys2.map(
|
|
72029
72058
|
(key) => ({
|
|
72030
|
-
kind:
|
|
72059
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
72031
72060
|
type: key.type,
|
|
72032
72061
|
variable: {
|
|
72033
|
-
kind:
|
|
72062
|
+
kind: graphql13.Kind.VARIABLE,
|
|
72034
72063
|
name: {
|
|
72035
|
-
kind:
|
|
72064
|
+
kind: graphql13.Kind.NAME,
|
|
72036
72065
|
value: key.name
|
|
72037
72066
|
}
|
|
72038
72067
|
}
|
|
@@ -72041,42 +72070,42 @@ async function paginate(config2, documents) {
|
|
|
72041
72070
|
)
|
|
72042
72071
|
),
|
|
72043
72072
|
selectionSet: {
|
|
72044
|
-
kind:
|
|
72073
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
72045
72074
|
selections: !nodeQuery ? fragmentSpreadSelection : [
|
|
72046
72075
|
{
|
|
72047
|
-
kind:
|
|
72076
|
+
kind: graphql13.Kind.FIELD,
|
|
72048
72077
|
name: {
|
|
72049
|
-
kind:
|
|
72078
|
+
kind: graphql13.Kind.NAME,
|
|
72050
72079
|
value: typeConfig?.resolve?.queryField || "node"
|
|
72051
72080
|
},
|
|
72052
72081
|
["arguments"]: keys2.map((key) => ({
|
|
72053
|
-
kind:
|
|
72082
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
72054
72083
|
name: {
|
|
72055
|
-
kind:
|
|
72084
|
+
kind: graphql13.Kind.NAME,
|
|
72056
72085
|
value: key.name
|
|
72057
72086
|
},
|
|
72058
72087
|
value: {
|
|
72059
|
-
kind:
|
|
72088
|
+
kind: graphql13.Kind.VARIABLE,
|
|
72060
72089
|
name: {
|
|
72061
|
-
kind:
|
|
72090
|
+
kind: graphql13.Kind.NAME,
|
|
72062
72091
|
value: key.name
|
|
72063
72092
|
}
|
|
72064
72093
|
}
|
|
72065
72094
|
})),
|
|
72066
72095
|
selectionSet: {
|
|
72067
|
-
kind:
|
|
72096
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
72068
72097
|
selections: [
|
|
72069
72098
|
{
|
|
72070
|
-
kind:
|
|
72099
|
+
kind: graphql13.Kind.FIELD,
|
|
72071
72100
|
name: {
|
|
72072
|
-
kind:
|
|
72101
|
+
kind: graphql13.Kind.NAME,
|
|
72073
72102
|
value: "__typename"
|
|
72074
72103
|
}
|
|
72075
72104
|
},
|
|
72076
72105
|
...(typeConfig?.keys || [config2.defaultKeys[0]]).map((key) => ({
|
|
72077
|
-
kind:
|
|
72106
|
+
kind: graphql13.Kind.FIELD,
|
|
72078
72107
|
name: {
|
|
72079
|
-
kind:
|
|
72108
|
+
kind: graphql13.Kind.NAME,
|
|
72080
72109
|
value: key
|
|
72081
72110
|
}
|
|
72082
72111
|
})),
|
|
@@ -72133,15 +72162,15 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
72133
72162
|
}
|
|
72134
72163
|
function variableAsArgument(name, variable) {
|
|
72135
72164
|
return {
|
|
72136
|
-
kind:
|
|
72165
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
72137
72166
|
name: {
|
|
72138
|
-
kind:
|
|
72167
|
+
kind: graphql13.Kind.NAME,
|
|
72139
72168
|
value: name
|
|
72140
72169
|
},
|
|
72141
72170
|
value: {
|
|
72142
|
-
kind:
|
|
72171
|
+
kind: graphql13.Kind.VARIABLE,
|
|
72143
72172
|
name: {
|
|
72144
|
-
kind:
|
|
72173
|
+
kind: graphql13.Kind.NAME,
|
|
72145
72174
|
value: variable ?? name
|
|
72146
72175
|
}
|
|
72147
72176
|
}
|
|
@@ -72149,18 +72178,18 @@ function variableAsArgument(name, variable) {
|
|
|
72149
72178
|
}
|
|
72150
72179
|
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
72151
72180
|
return {
|
|
72152
|
-
kind:
|
|
72181
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
72153
72182
|
type: {
|
|
72154
|
-
kind:
|
|
72183
|
+
kind: graphql13.Kind.NAMED_TYPE,
|
|
72155
72184
|
name: {
|
|
72156
|
-
kind:
|
|
72185
|
+
kind: graphql13.Kind.NAME,
|
|
72157
72186
|
value: type
|
|
72158
72187
|
}
|
|
72159
72188
|
},
|
|
72160
72189
|
variable: {
|
|
72161
|
-
kind:
|
|
72190
|
+
kind: graphql13.Kind.VARIABLE,
|
|
72162
72191
|
name: {
|
|
72163
|
-
kind:
|
|
72192
|
+
kind: graphql13.Kind.NAME,
|
|
72164
72193
|
value: variableName ?? name
|
|
72165
72194
|
}
|
|
72166
72195
|
},
|
|
@@ -72172,9 +72201,9 @@ function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
|
72172
72201
|
}
|
|
72173
72202
|
function argumentNode(name, value) {
|
|
72174
72203
|
return {
|
|
72175
|
-
kind:
|
|
72204
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
72176
72205
|
name: {
|
|
72177
|
-
kind:
|
|
72206
|
+
kind: graphql13.Kind.NAME,
|
|
72178
72207
|
value: name
|
|
72179
72208
|
},
|
|
72180
72209
|
value: objectNode(value)
|
|
@@ -72182,16 +72211,16 @@ function argumentNode(name, value) {
|
|
|
72182
72211
|
}
|
|
72183
72212
|
function objectNode([type, defaultValue]) {
|
|
72184
72213
|
const node = {
|
|
72185
|
-
kind:
|
|
72214
|
+
kind: graphql13.Kind.OBJECT,
|
|
72186
72215
|
fields: [
|
|
72187
72216
|
{
|
|
72188
|
-
kind:
|
|
72217
|
+
kind: graphql13.Kind.OBJECT_FIELD,
|
|
72189
72218
|
name: {
|
|
72190
|
-
kind:
|
|
72219
|
+
kind: graphql13.Kind.NAME,
|
|
72191
72220
|
value: "type"
|
|
72192
72221
|
},
|
|
72193
72222
|
value: {
|
|
72194
|
-
kind:
|
|
72223
|
+
kind: graphql13.Kind.STRING,
|
|
72195
72224
|
value: type
|
|
72196
72225
|
}
|
|
72197
72226
|
}
|
|
@@ -72199,8 +72228,8 @@ function objectNode([type, defaultValue]) {
|
|
|
72199
72228
|
};
|
|
72200
72229
|
if (defaultValue) {
|
|
72201
72230
|
node.fields.push({
|
|
72202
|
-
kind:
|
|
72203
|
-
name: { kind:
|
|
72231
|
+
kind: graphql13.Kind.OBJECT_FIELD,
|
|
72232
|
+
name: { kind: graphql13.Kind.NAME, value: "default" },
|
|
72204
72233
|
value: {
|
|
72205
72234
|
kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
|
|
72206
72235
|
value: defaultValue.toString()
|
|
@@ -72211,34 +72240,34 @@ function objectNode([type, defaultValue]) {
|
|
|
72211
72240
|
}
|
|
72212
72241
|
var pageInfoSelection = [
|
|
72213
72242
|
{
|
|
72214
|
-
kind:
|
|
72243
|
+
kind: graphql13.Kind.FIELD,
|
|
72215
72244
|
name: {
|
|
72216
|
-
kind:
|
|
72245
|
+
kind: graphql13.Kind.NAME,
|
|
72217
72246
|
value: "edges"
|
|
72218
72247
|
},
|
|
72219
72248
|
selectionSet: {
|
|
72220
|
-
kind:
|
|
72249
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
72221
72250
|
selections: [
|
|
72222
72251
|
{
|
|
72223
|
-
kind:
|
|
72252
|
+
kind: graphql13.Kind.FIELD,
|
|
72224
72253
|
name: {
|
|
72225
|
-
kind:
|
|
72254
|
+
kind: graphql13.Kind.NAME,
|
|
72226
72255
|
value: "cursor"
|
|
72227
72256
|
}
|
|
72228
72257
|
},
|
|
72229
72258
|
{
|
|
72230
|
-
kind:
|
|
72259
|
+
kind: graphql13.Kind.FIELD,
|
|
72231
72260
|
name: {
|
|
72232
|
-
kind:
|
|
72261
|
+
kind: graphql13.Kind.NAME,
|
|
72233
72262
|
value: "node"
|
|
72234
72263
|
},
|
|
72235
72264
|
selectionSet: {
|
|
72236
|
-
kind:
|
|
72265
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
72237
72266
|
selections: [
|
|
72238
72267
|
{
|
|
72239
|
-
kind:
|
|
72268
|
+
kind: graphql13.Kind.FIELD,
|
|
72240
72269
|
name: {
|
|
72241
|
-
kind:
|
|
72270
|
+
kind: graphql13.Kind.NAME,
|
|
72242
72271
|
value: "__typename"
|
|
72243
72272
|
}
|
|
72244
72273
|
}
|
|
@@ -72249,39 +72278,39 @@ var pageInfoSelection = [
|
|
|
72249
72278
|
}
|
|
72250
72279
|
},
|
|
72251
72280
|
{
|
|
72252
|
-
kind:
|
|
72281
|
+
kind: graphql13.Kind.FIELD,
|
|
72253
72282
|
name: {
|
|
72254
|
-
kind:
|
|
72283
|
+
kind: graphql13.Kind.NAME,
|
|
72255
72284
|
value: "pageInfo"
|
|
72256
72285
|
},
|
|
72257
72286
|
selectionSet: {
|
|
72258
|
-
kind:
|
|
72287
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
72259
72288
|
selections: [
|
|
72260
72289
|
{
|
|
72261
|
-
kind:
|
|
72290
|
+
kind: graphql13.Kind.FIELD,
|
|
72262
72291
|
name: {
|
|
72263
|
-
kind:
|
|
72292
|
+
kind: graphql13.Kind.NAME,
|
|
72264
72293
|
value: "hasPreviousPage"
|
|
72265
72294
|
}
|
|
72266
72295
|
},
|
|
72267
72296
|
{
|
|
72268
|
-
kind:
|
|
72297
|
+
kind: graphql13.Kind.FIELD,
|
|
72269
72298
|
name: {
|
|
72270
|
-
kind:
|
|
72299
|
+
kind: graphql13.Kind.NAME,
|
|
72271
72300
|
value: "hasNextPage"
|
|
72272
72301
|
}
|
|
72273
72302
|
},
|
|
72274
72303
|
{
|
|
72275
|
-
kind:
|
|
72304
|
+
kind: graphql13.Kind.FIELD,
|
|
72276
72305
|
name: {
|
|
72277
|
-
kind:
|
|
72306
|
+
kind: graphql13.Kind.NAME,
|
|
72278
72307
|
value: "startCursor"
|
|
72279
72308
|
}
|
|
72280
72309
|
},
|
|
72281
72310
|
{
|
|
72282
|
-
kind:
|
|
72311
|
+
kind: graphql13.Kind.FIELD,
|
|
72283
72312
|
name: {
|
|
72284
|
-
kind:
|
|
72313
|
+
kind: graphql13.Kind.NAME,
|
|
72285
72314
|
value: "endCursor"
|
|
72286
72315
|
}
|
|
72287
72316
|
}
|
|
@@ -72295,17 +72324,17 @@ async function addListFragments(config2, documents) {
|
|
|
72295
72324
|
const lists = {};
|
|
72296
72325
|
const errors = [];
|
|
72297
72326
|
for (const doc of documents) {
|
|
72298
|
-
doc.document =
|
|
72327
|
+
doc.document = graphql14.visit(doc.document, {
|
|
72299
72328
|
Directive(node, key, parent2, path3, ancestors) {
|
|
72300
72329
|
if ([config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
|
|
72301
72330
|
const nameArg = node.arguments?.find(
|
|
72302
72331
|
(arg) => arg.name.value === config2.listOrPaginateNameArg
|
|
72303
72332
|
);
|
|
72304
72333
|
let error = {
|
|
72305
|
-
...new
|
|
72334
|
+
...new graphql14.GraphQLError(
|
|
72306
72335
|
"",
|
|
72307
72336
|
node,
|
|
72308
|
-
new
|
|
72337
|
+
new graphql14.Source(""),
|
|
72309
72338
|
node.loc ? [node.loc.start, node.loc.end] : null,
|
|
72310
72339
|
path3
|
|
72311
72340
|
),
|
|
@@ -72357,7 +72386,7 @@ async function addListFragments(config2, documents) {
|
|
|
72357
72386
|
{
|
|
72358
72387
|
kind: "Argument",
|
|
72359
72388
|
name: {
|
|
72360
|
-
kind:
|
|
72389
|
+
kind: graphql14.Kind.NAME,
|
|
72361
72390
|
value: "connection"
|
|
72362
72391
|
},
|
|
72363
72392
|
value: {
|
|
@@ -72407,7 +72436,7 @@ async function addListFragments(config2, documents) {
|
|
|
72407
72436
|
const validDeletes = [
|
|
72408
72437
|
...new Set(
|
|
72409
72438
|
Object.values(lists).map(({ type }) => {
|
|
72410
|
-
if (!(type instanceof
|
|
72439
|
+
if (!(type instanceof graphql14.GraphQLObjectType)) {
|
|
72411
72440
|
return "";
|
|
72412
72441
|
}
|
|
72413
72442
|
if (config2.keyFieldsForType(type.name).length !== 1) {
|
|
@@ -72421,7 +72450,7 @@ async function addListFragments(config2, documents) {
|
|
|
72421
72450
|
return;
|
|
72422
72451
|
}
|
|
72423
72452
|
const generatedDoc = {
|
|
72424
|
-
kind:
|
|
72453
|
+
kind: graphql14.Kind.DOCUMENT,
|
|
72425
72454
|
definitions: Object.entries(lists).flatMap(
|
|
72426
72455
|
([name, { selection, type }]) => {
|
|
72427
72456
|
const schemaType = config2.schema.getType(type.name);
|
|
@@ -72429,7 +72458,7 @@ async function addListFragments(config2, documents) {
|
|
|
72429
72458
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
72430
72459
|
}
|
|
72431
72460
|
const fragmentSelection = {
|
|
72432
|
-
kind:
|
|
72461
|
+
kind: graphql14.Kind.SELECTION_SET,
|
|
72433
72462
|
selections: [...selection.selections]
|
|
72434
72463
|
};
|
|
72435
72464
|
if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
|
|
@@ -72444,14 +72473,14 @@ async function addListFragments(config2, documents) {
|
|
|
72444
72473
|
{
|
|
72445
72474
|
name: {
|
|
72446
72475
|
value: config2.listInsertFragment(name),
|
|
72447
|
-
kind:
|
|
72476
|
+
kind: graphql14.Kind.NAME
|
|
72448
72477
|
},
|
|
72449
|
-
kind:
|
|
72478
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
72450
72479
|
selectionSet: fragmentSelection,
|
|
72451
72480
|
typeCondition: {
|
|
72452
|
-
kind:
|
|
72481
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
72453
72482
|
name: {
|
|
72454
|
-
kind:
|
|
72483
|
+
kind: graphql14.Kind.NAME,
|
|
72455
72484
|
value: type.name
|
|
72456
72485
|
}
|
|
72457
72486
|
}
|
|
@@ -72459,32 +72488,32 @@ async function addListFragments(config2, documents) {
|
|
|
72459
72488
|
{
|
|
72460
72489
|
name: {
|
|
72461
72490
|
value: config2.listToggleFragment(name),
|
|
72462
|
-
kind:
|
|
72491
|
+
kind: graphql14.Kind.NAME
|
|
72463
72492
|
},
|
|
72464
|
-
kind:
|
|
72493
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
72465
72494
|
selectionSet: fragmentSelection,
|
|
72466
72495
|
typeCondition: {
|
|
72467
|
-
kind:
|
|
72496
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
72468
72497
|
name: {
|
|
72469
|
-
kind:
|
|
72498
|
+
kind: graphql14.Kind.NAME,
|
|
72470
72499
|
value: type.name
|
|
72471
72500
|
}
|
|
72472
72501
|
}
|
|
72473
72502
|
},
|
|
72474
72503
|
{
|
|
72475
|
-
kind:
|
|
72504
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
72476
72505
|
name: {
|
|
72477
72506
|
value: config2.listRemoveFragment(name),
|
|
72478
|
-
kind:
|
|
72507
|
+
kind: graphql14.Kind.NAME
|
|
72479
72508
|
},
|
|
72480
72509
|
selectionSet: {
|
|
72481
|
-
kind:
|
|
72510
|
+
kind: graphql14.Kind.SELECTION_SET,
|
|
72482
72511
|
selections: [...objectIdentificationSelection(config2, type)]
|
|
72483
72512
|
},
|
|
72484
72513
|
typeCondition: {
|
|
72485
|
-
kind:
|
|
72514
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
72486
72515
|
name: {
|
|
72487
|
-
kind:
|
|
72516
|
+
kind: graphql14.Kind.NAME,
|
|
72488
72517
|
value: type.name
|
|
72489
72518
|
}
|
|
72490
72519
|
}
|
|
@@ -72493,14 +72522,14 @@ async function addListFragments(config2, documents) {
|
|
|
72493
72522
|
}
|
|
72494
72523
|
).concat(
|
|
72495
72524
|
...validDeletes.map((typeName) => ({
|
|
72496
|
-
kind:
|
|
72525
|
+
kind: graphql14.Kind.DIRECTIVE_DEFINITION,
|
|
72497
72526
|
name: {
|
|
72498
|
-
kind:
|
|
72527
|
+
kind: graphql14.Kind.NAME,
|
|
72499
72528
|
value: config2.listDeleteDirective(typeName)
|
|
72500
72529
|
},
|
|
72501
72530
|
locations: [
|
|
72502
72531
|
{
|
|
72503
|
-
kind:
|
|
72532
|
+
kind: graphql14.Kind.NAME,
|
|
72504
72533
|
value: "FIELD"
|
|
72505
72534
|
}
|
|
72506
72535
|
],
|
|
@@ -72508,8 +72537,8 @@ async function addListFragments(config2, documents) {
|
|
|
72508
72537
|
}))
|
|
72509
72538
|
)
|
|
72510
72539
|
};
|
|
72511
|
-
config2.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(
|
|
72512
|
-
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(
|
|
72540
|
+
config2.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(graphql14.print).join("\n\n");
|
|
72541
|
+
config2.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql14.print).join("\n\n");
|
|
72513
72542
|
documents.push({
|
|
72514
72543
|
name: "generated::lists",
|
|
72515
72544
|
kind: ArtifactKind.Fragment,
|
|
@@ -72595,11 +72624,11 @@ var nodeNotDefinedMessage = (config2) => `Looks like you are trying to use the $
|
|
|
72595
72624
|
For more information, visit this link: ${siteURL}/guides/pagination`;
|
|
72596
72625
|
|
|
72597
72626
|
// src/codegen/generators/artifacts/fieldKey.ts
|
|
72598
|
-
var
|
|
72627
|
+
var graphql15 = __toESM(require("graphql"), 1);
|
|
72599
72628
|
function fieldKey(config2, field) {
|
|
72600
72629
|
const attributeName = field.alias?.value || field.name.value;
|
|
72601
|
-
const printed =
|
|
72602
|
-
const secondParse =
|
|
72630
|
+
const printed = graphql15.print(field);
|
|
72631
|
+
const secondParse = graphql15.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
|
|
72603
72632
|
let paginateMode = config2.defaultPaginateMode;
|
|
72604
72633
|
const paginatedDirective = field.directives?.find(
|
|
72605
72634
|
(directive) => directive.name.value === config2.paginateDirective
|
|
@@ -72722,13 +72751,13 @@ function prepareSelection({
|
|
|
72722
72751
|
} else if ("getFields" in type) {
|
|
72723
72752
|
let typeRef = type.getFields()[field.name.value].type;
|
|
72724
72753
|
fieldType = getRootType(typeRef);
|
|
72725
|
-
nullable = !
|
|
72726
|
-
} else if (
|
|
72754
|
+
nullable = !graphql16.isNonNullType(typeRef);
|
|
72755
|
+
} else if (graphql16.isAbstractType(type)) {
|
|
72727
72756
|
for (const possible of config2.schema.getPossibleTypes(type)) {
|
|
72728
|
-
if (
|
|
72757
|
+
if (graphql16.isObjectType(possible)) {
|
|
72729
72758
|
if (possible.getFields()[field.name.value]) {
|
|
72730
72759
|
fieldType = possible.getFields()[field.name.value].type;
|
|
72731
|
-
nullable = !
|
|
72760
|
+
nullable = !graphql16.isNonNullType(fieldType);
|
|
72732
72761
|
break;
|
|
72733
72762
|
}
|
|
72734
72763
|
}
|
|
@@ -72865,7 +72894,7 @@ function prepareSelection({
|
|
|
72865
72894
|
kind: "value"
|
|
72866
72895
|
} : { kind: "continue" };
|
|
72867
72896
|
const parentType = config2.schema.getType(rootType);
|
|
72868
|
-
if (
|
|
72897
|
+
if (graphql16.isObjectType(parentType) || graphql16.isInterfaceType(parentType)) {
|
|
72869
72898
|
const fieldType2 = parentType.getFields()[field.name.value]?.type;
|
|
72870
72899
|
if (fieldType2) {
|
|
72871
72900
|
const listCount = unwrapType(config2, fieldType2).wrappers.filter(
|
|
@@ -72888,7 +72917,7 @@ function prepareSelection({
|
|
|
72888
72917
|
}
|
|
72889
72918
|
fieldObj.loading = loadingValue;
|
|
72890
72919
|
}
|
|
72891
|
-
if (
|
|
72920
|
+
if (graphql16.isInterfaceType(fieldType) || graphql16.isUnionType(fieldType)) {
|
|
72892
72921
|
fieldObj.abstract = true;
|
|
72893
72922
|
if (Object.values(fieldObj.selection?.abstractFields?.fields ?? {}).some(
|
|
72894
72923
|
(fields) => Object.values(fields ?? {}).some((field2) => field2.required)
|
|
@@ -72970,7 +72999,7 @@ function mergeSelection({
|
|
|
72970
72999
|
typeSelection,
|
|
72971
73000
|
abstractSelection.fields[typeName] ?? {}
|
|
72972
73001
|
);
|
|
72973
|
-
if (
|
|
73002
|
+
if (graphql16.isAbstractType(gqlType)) {
|
|
72974
73003
|
for (const possible of config2.schema.getPossibleTypes(gqlType)) {
|
|
72975
73004
|
if (!possibleSelectionTypes[typeName]) {
|
|
72976
73005
|
possibleSelectionTypes[typeName] = [];
|
|
@@ -73005,7 +73034,7 @@ function mergeSelection({
|
|
|
73005
73034
|
}
|
|
73006
73035
|
}
|
|
73007
73036
|
const parentType = config2.schema.getType(rootType);
|
|
73008
|
-
const possibleParents =
|
|
73037
|
+
const possibleParents = graphql16.isAbstractType(parentType) ? config2.schema.getPossibleTypes(parentType)?.map((t3) => t3.name) : [parentType.name];
|
|
73009
73038
|
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
73010
73039
|
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
73011
73040
|
delete abstractSelection.typeMap[key];
|
|
@@ -73062,12 +73091,12 @@ function mergeSelection({
|
|
|
73062
73091
|
}
|
|
73063
73092
|
|
|
73064
73093
|
// src/codegen/generators/artifacts/index.ts
|
|
73065
|
-
var
|
|
73094
|
+
var AST5 = recast5.types.builders;
|
|
73066
73095
|
function artifactGenerator(stats) {
|
|
73067
73096
|
return async function(config2, docs) {
|
|
73068
73097
|
const filterTypes = {};
|
|
73069
73098
|
for (const doc of docs) {
|
|
73070
|
-
|
|
73099
|
+
graphql17.visit(doc.document, {
|
|
73071
73100
|
Directive(node, _, __, ___, ancestors) {
|
|
73072
73101
|
if (node.name.value !== config2.listDirective) {
|
|
73073
73102
|
return;
|
|
@@ -73127,7 +73156,7 @@ function artifactGenerator(stats) {
|
|
|
73127
73156
|
return;
|
|
73128
73157
|
}
|
|
73129
73158
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
73130
|
-
let documentWithoutInternalDirectives =
|
|
73159
|
+
let documentWithoutInternalDirectives = graphql17.visit(document, {
|
|
73131
73160
|
Directive(node) {
|
|
73132
73161
|
if (config2.isInternalDirective(node.name.value)) {
|
|
73133
73162
|
return null;
|
|
@@ -73140,7 +73169,7 @@ function artifactGenerator(stats) {
|
|
|
73140
73169
|
}
|
|
73141
73170
|
}
|
|
73142
73171
|
});
|
|
73143
|
-
let documentWithoutExtraVariables =
|
|
73172
|
+
let documentWithoutExtraVariables = graphql17.visit(
|
|
73144
73173
|
documentWithoutInternalDirectives,
|
|
73145
73174
|
{
|
|
73146
73175
|
VariableDefinition(variableDefinitionNode) {
|
|
@@ -73151,13 +73180,13 @@ function artifactGenerator(stats) {
|
|
|
73151
73180
|
}
|
|
73152
73181
|
}
|
|
73153
73182
|
);
|
|
73154
|
-
let rawString =
|
|
73183
|
+
let rawString = graphql17.print(documentWithoutExtraVariables);
|
|
73155
73184
|
let docKind = doc.kind;
|
|
73156
73185
|
const operations = document.definitions.filter(
|
|
73157
|
-
({ kind }) => kind ===
|
|
73186
|
+
({ kind }) => kind === graphql17.Kind.OPERATION_DEFINITION
|
|
73158
73187
|
);
|
|
73159
73188
|
const fragments = document.definitions.filter(
|
|
73160
|
-
({ kind }) => kind ===
|
|
73189
|
+
({ kind }) => kind === graphql17.Kind.FRAGMENT_DEFINITION
|
|
73161
73190
|
);
|
|
73162
73191
|
let rootType = "";
|
|
73163
73192
|
let selectionSet;
|
|
@@ -73304,7 +73333,21 @@ function artifactGenerator(stats) {
|
|
|
73304
73333
|
artifact.pluginData[plugin2.name] = plugin2.artifactData({ config: config2, document: doc }) ?? {};
|
|
73305
73334
|
}
|
|
73306
73335
|
if (inputs && inputs.length > 0) {
|
|
73307
|
-
|
|
73336
|
+
const runtimeScalars = inputs.reduce((prev, input) => {
|
|
73337
|
+
const runtimeScalarDirective = input.directives?.find(
|
|
73338
|
+
(directive2) => directive2.name.value === config2.runtimeScalarDirective
|
|
73339
|
+
);
|
|
73340
|
+
if (!runtimeScalarDirective) {
|
|
73341
|
+
return prev;
|
|
73342
|
+
}
|
|
73343
|
+
return {
|
|
73344
|
+
...prev,
|
|
73345
|
+
[input.variable.name.value]: runtimeScalarDirective.arguments?.find(
|
|
73346
|
+
(arg) => arg.name.value === "type"
|
|
73347
|
+
)?.value?.value
|
|
73348
|
+
};
|
|
73349
|
+
}, {});
|
|
73350
|
+
artifact.input = inputObject(config2, inputs, runtimeScalars);
|
|
73308
73351
|
}
|
|
73309
73352
|
if (artifact.kind === "HoudiniQuery") {
|
|
73310
73353
|
const cacheDirective = operations[0].directives?.find(
|
|
@@ -73343,9 +73386,9 @@ function artifactGenerator(stats) {
|
|
|
73343
73386
|
plugin2.artifactEnd({ config: config2, document: doc });
|
|
73344
73387
|
}
|
|
73345
73388
|
const _houdiniHash = hashOriginal({ document: doc });
|
|
73346
|
-
const file =
|
|
73389
|
+
const file = AST5.program([
|
|
73347
73390
|
moduleExport(config2, "default", serializeValue(artifact)),
|
|
73348
|
-
|
|
73391
|
+
AST5.expressionStatement(AST5.stringLiteral(`HoudiniHash=${_houdiniHash}`))
|
|
73349
73392
|
]);
|
|
73350
73393
|
const artifactPath = config2.artifactPath(document);
|
|
73351
73394
|
const countDocument = doc.generateStore;
|
|
@@ -73403,7 +73446,7 @@ function applyMask(config2, target, mask) {
|
|
|
73403
73446
|
if (!targetType) {
|
|
73404
73447
|
continue;
|
|
73405
73448
|
}
|
|
73406
|
-
if (
|
|
73449
|
+
if (graphql17.isAbstractType(targetType)) {
|
|
73407
73450
|
for (const possible of config2.schema.getPossibleTypes(targetType)) {
|
|
73408
73451
|
if (target.abstractFields?.fields[possible.name]) {
|
|
73409
73452
|
applyMask(
|
|
@@ -73426,8 +73469,8 @@ function applyMask(config2, target, mask) {
|
|
|
73426
73469
|
}
|
|
73427
73470
|
|
|
73428
73471
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
73429
|
-
var
|
|
73430
|
-
var
|
|
73472
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
73473
|
+
var AST6 = recast6.types.builders;
|
|
73431
73474
|
async function generateGraphqlReturnTypes(config2, docs) {
|
|
73432
73475
|
const indexPath = path_exports.join(config2.runtimeDirectory, "index.d.ts");
|
|
73433
73476
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -73462,18 +73505,18 @@ async function generateGraphqlReturnTypes(config2, docs) {
|
|
|
73462
73505
|
continue;
|
|
73463
73506
|
}
|
|
73464
73507
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
73465
|
-
const input =
|
|
73466
|
-
input.typeAnnotation =
|
|
73467
|
-
|
|
73508
|
+
const input = AST6.identifier("str");
|
|
73509
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
73510
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
73468
73511
|
);
|
|
73469
73512
|
script.body.splice(
|
|
73470
73513
|
i2,
|
|
73471
73514
|
0,
|
|
73472
|
-
|
|
73473
|
-
|
|
73474
|
-
|
|
73515
|
+
AST6.exportNamedDeclaration(
|
|
73516
|
+
AST6.tsDeclareFunction(
|
|
73517
|
+
AST6.identifier("graphql"),
|
|
73475
73518
|
[input],
|
|
73476
|
-
|
|
73519
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
73477
73520
|
)
|
|
73478
73521
|
)
|
|
73479
73522
|
);
|
|
@@ -73648,165 +73691,22 @@ function moduleStatments(config2) {
|
|
|
73648
73691
|
var recast11 = __toESM(require_main2(), 1);
|
|
73649
73692
|
|
|
73650
73693
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
73651
|
-
var graphql19 = __toESM(require("graphql"), 1);
|
|
73652
|
-
var recast8 = __toESM(require_main2(), 1);
|
|
73653
|
-
|
|
73654
|
-
// src/codegen/generators/typescript/typeReference.ts
|
|
73655
73694
|
var graphql18 = __toESM(require("graphql"), 1);
|
|
73656
73695
|
var recast7 = __toESM(require_main2(), 1);
|
|
73657
|
-
|
|
73658
|
-
// src/codegen/generators/typescript/types.ts
|
|
73659
|
-
var graphql17 = __toESM(require("graphql"), 1);
|
|
73660
|
-
var recast6 = __toESM(require_main2(), 1);
|
|
73661
|
-
var AST6 = recast6.types.builders;
|
|
73662
|
-
function readonlyProperty(prop, enable = true) {
|
|
73663
|
-
if (enable) {
|
|
73664
|
-
prop.readonly = true;
|
|
73665
|
-
}
|
|
73666
|
-
return prop;
|
|
73667
|
-
}
|
|
73668
|
-
function nullableField(inner, input = false) {
|
|
73669
|
-
const members = [inner, AST6.tsNullKeyword()];
|
|
73670
|
-
if (input) {
|
|
73671
|
-
members.push(AST6.tsUndefinedKeyword());
|
|
73672
|
-
}
|
|
73673
|
-
return AST6.tsUnionType(members);
|
|
73674
|
-
}
|
|
73675
|
-
function scalarPropertyValue(config2, filepath, missingScalars, target, body, field) {
|
|
73676
|
-
if (config2.configFile.features?.componentFields && target.name === config2.componentScalar) {
|
|
73677
|
-
if (!field) {
|
|
73678
|
-
return AST6.tsNeverKeyword();
|
|
73679
|
-
}
|
|
73680
|
-
const component = config2.componentFields[field.parent][field.field];
|
|
73681
|
-
const sourcePathRelative = path_exports.relative(
|
|
73682
|
-
path_exports.join(config2.projectRoot, "src"),
|
|
73683
|
-
component.filepath
|
|
73684
|
-
);
|
|
73685
|
-
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
73686
|
-
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
73687
|
-
const localImport = ensureImports({
|
|
73688
|
-
config: config2,
|
|
73689
|
-
body,
|
|
73690
|
-
import: "__component__" + component.fragment,
|
|
73691
|
-
sourceModule: path_exports.join(
|
|
73692
|
-
path_exports.relative(path_exports.dirname(filepath), config2.projectRoot),
|
|
73693
|
-
"src",
|
|
73694
|
-
sourcePath
|
|
73695
|
-
)
|
|
73696
|
-
});
|
|
73697
|
-
const parameters = AST6.tsTypeReference(AST6.identifier("Parameters"));
|
|
73698
|
-
parameters.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
73699
|
-
AST6.tsTypeQuery(AST6.identifier(localImport))
|
|
73700
|
-
]);
|
|
73701
|
-
const indexed = AST6.tsIndexedAccessType(
|
|
73702
|
-
parameters,
|
|
73703
|
-
AST6.tsLiteralType(AST6.numericLiteral(0))
|
|
73704
|
-
);
|
|
73705
|
-
const omit = AST6.tsTypeReference(AST6.identifier("Omit"));
|
|
73706
|
-
omit.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
73707
|
-
indexed,
|
|
73708
|
-
AST6.tsLiteralType(AST6.stringLiteral(component.prop))
|
|
73709
|
-
]);
|
|
73710
|
-
const arg = AST6.identifier("props");
|
|
73711
|
-
arg.typeAnnotation = AST6.tsTypeAnnotation(omit);
|
|
73712
|
-
const returnType = AST6.tsTypeReference(AST6.identifier("ReturnType"));
|
|
73713
|
-
returnType.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
73714
|
-
AST6.tsTypeQuery(AST6.identifier(localImport))
|
|
73715
|
-
]);
|
|
73716
|
-
const fnType = AST6.tsFunctionType([arg]);
|
|
73717
|
-
fnType.typeAnnotation = AST6.tsTypeAnnotation(returnType);
|
|
73718
|
-
return fnType;
|
|
73719
|
-
}
|
|
73720
|
-
switch (target.name) {
|
|
73721
|
-
case "String": {
|
|
73722
|
-
return AST6.tsStringKeyword();
|
|
73723
|
-
}
|
|
73724
|
-
case "Int": {
|
|
73725
|
-
return AST6.tsNumberKeyword();
|
|
73726
|
-
}
|
|
73727
|
-
case "Float": {
|
|
73728
|
-
return AST6.tsNumberKeyword();
|
|
73729
|
-
}
|
|
73730
|
-
case "Boolean": {
|
|
73731
|
-
return AST6.tsBooleanKeyword();
|
|
73732
|
-
}
|
|
73733
|
-
case "ID": {
|
|
73734
|
-
return AST6.tsStringKeyword();
|
|
73735
|
-
}
|
|
73736
|
-
default: {
|
|
73737
|
-
if (graphql17.isNonNullType(target) && "ofType" in target) {
|
|
73738
|
-
return scalarPropertyValue(
|
|
73739
|
-
config2,
|
|
73740
|
-
filepath,
|
|
73741
|
-
missingScalars,
|
|
73742
|
-
target.ofType,
|
|
73743
|
-
body,
|
|
73744
|
-
field
|
|
73745
|
-
);
|
|
73746
|
-
}
|
|
73747
|
-
if (config2.scalars?.[target.name]) {
|
|
73748
|
-
return AST6.tsTypeReference(AST6.identifier(config2.scalars?.[target.name].type));
|
|
73749
|
-
}
|
|
73750
|
-
if (target.name !== config2.componentScalar) {
|
|
73751
|
-
missingScalars.add(target.name);
|
|
73752
|
-
}
|
|
73753
|
-
return AST6.tsAnyKeyword();
|
|
73754
|
-
}
|
|
73755
|
-
}
|
|
73756
|
-
}
|
|
73757
|
-
|
|
73758
|
-
// src/codegen/generators/typescript/typeReference.ts
|
|
73759
73696
|
var AST7 = recast7.types.builders;
|
|
73760
|
-
function tsTypeReference(config2, filepath, missingScalars, definition, body) {
|
|
73761
|
-
const { type, wrappers } = unwrapType(config2, definition.type);
|
|
73762
|
-
let result;
|
|
73763
|
-
if (graphql18.isScalarType(type)) {
|
|
73764
|
-
result = scalarPropertyValue(config2, filepath, missingScalars, type, body, null);
|
|
73765
|
-
} else if (graphql18.isEnumType(type)) {
|
|
73766
|
-
result = enumReference(config2, body, type.name);
|
|
73767
|
-
} else {
|
|
73768
|
-
result = AST7.tsTypeReference(AST7.identifier(type.name));
|
|
73769
|
-
}
|
|
73770
|
-
for (const toWrap of wrappers) {
|
|
73771
|
-
if (toWrap === "NonNull" /* NonNull */) {
|
|
73772
|
-
continue;
|
|
73773
|
-
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
73774
|
-
result = nullableField(result, true);
|
|
73775
|
-
} else if (toWrap === "List" /* List */) {
|
|
73776
|
-
result = AST7.tsArrayType(AST7.tsParenthesizedType(result));
|
|
73777
|
-
}
|
|
73778
|
-
}
|
|
73779
|
-
return result;
|
|
73780
|
-
}
|
|
73781
|
-
function enumReference(config2, body, name) {
|
|
73782
|
-
ensureImports({
|
|
73783
|
-
config: config2,
|
|
73784
|
-
body,
|
|
73785
|
-
import: ["ValueOf"],
|
|
73786
|
-
importKind: "type",
|
|
73787
|
-
sourceModule: "$houdini/runtime/lib/types"
|
|
73788
|
-
});
|
|
73789
|
-
return AST7.tsTypeReference(
|
|
73790
|
-
AST7.identifier("ValueOf"),
|
|
73791
|
-
AST7.tsTypeParameterInstantiation([AST7.tsTypeQuery(AST7.identifier(name))])
|
|
73792
|
-
);
|
|
73793
|
-
}
|
|
73794
|
-
|
|
73795
|
-
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
73796
|
-
var AST8 = recast8.types.builders;
|
|
73797
73697
|
function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
73798
73698
|
const { type } = unwrapType(config2, rootType);
|
|
73799
|
-
if (
|
|
73699
|
+
if (graphql18.isScalarType(type)) {
|
|
73800
73700
|
return;
|
|
73801
73701
|
}
|
|
73802
73702
|
if (visitedTypes.has(type.name)) {
|
|
73803
73703
|
return;
|
|
73804
73704
|
}
|
|
73805
|
-
if (
|
|
73705
|
+
if (graphql18.isUnionType(type)) {
|
|
73806
73706
|
throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
|
|
73807
73707
|
}
|
|
73808
73708
|
visitedTypes.add(type.name);
|
|
73809
|
-
if (
|
|
73709
|
+
if (graphql18.isEnumType(type)) {
|
|
73810
73710
|
ensureImports({
|
|
73811
73711
|
config: config2,
|
|
73812
73712
|
body,
|
|
@@ -73820,21 +73720,37 @@ function addReferencedInputTypes(config2, filepath, body, visitedTypes, missingS
|
|
|
73820
73720
|
for (const field of Object.values(type.getFields())) {
|
|
73821
73721
|
addReferencedInputTypes(config2, filepath, body, visitedTypes, missingScalars, field.type);
|
|
73822
73722
|
members.push(
|
|
73823
|
-
|
|
73824
|
-
|
|
73825
|
-
|
|
73723
|
+
AST7.tsPropertySignature(
|
|
73724
|
+
AST7.identifier(field.name),
|
|
73725
|
+
AST7.tsTypeAnnotation(
|
|
73826
73726
|
tsTypeReference(config2, filepath, missingScalars, field, body)
|
|
73827
73727
|
),
|
|
73828
|
-
|
|
73728
|
+
graphql18.isNullableType(field.type)
|
|
73829
73729
|
)
|
|
73830
73730
|
);
|
|
73831
73731
|
}
|
|
73832
|
-
body.push(
|
|
73732
|
+
body.push(AST7.tsTypeAliasDeclaration(AST7.identifier(type.name), AST7.tsTypeLiteral(members)));
|
|
73833
73733
|
}
|
|
73834
73734
|
|
|
73835
73735
|
// src/codegen/generators/typescript/inlineType.ts
|
|
73836
|
-
var
|
|
73736
|
+
var graphql19 = __toESM(require("graphql"), 1);
|
|
73837
73737
|
var recast9 = __toESM(require_main2(), 1);
|
|
73738
|
+
|
|
73739
|
+
// src/codegen/generators/comments/jsdoc.ts
|
|
73740
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
73741
|
+
var AST8 = recast8.types.builders;
|
|
73742
|
+
function jsdocComment(text, deprecated) {
|
|
73743
|
+
let commentContent = `*
|
|
73744
|
+
* ${text}
|
|
73745
|
+
`;
|
|
73746
|
+
if (deprecated) {
|
|
73747
|
+
commentContent = `${commentContent} * @deprecated ${deprecated}
|
|
73748
|
+
`;
|
|
73749
|
+
}
|
|
73750
|
+
return AST8.commentBlock(commentContent, true);
|
|
73751
|
+
}
|
|
73752
|
+
|
|
73753
|
+
// src/codegen/generators/typescript/inlineType.ts
|
|
73838
73754
|
var AST9 = recast9.types.builders;
|
|
73839
73755
|
var fragmentKey2 = " $fragments";
|
|
73840
73756
|
function inlineType({
|
|
@@ -73855,7 +73771,7 @@ function inlineType({
|
|
|
73855
73771
|
const { type, wrappers } = unwrapType(config2, rootType);
|
|
73856
73772
|
let result;
|
|
73857
73773
|
let forceNullable = false;
|
|
73858
|
-
if (
|
|
73774
|
+
if (graphql19.isScalarType(type)) {
|
|
73859
73775
|
result = scalarPropertyValue(
|
|
73860
73776
|
config2,
|
|
73861
73777
|
filepath,
|
|
@@ -73864,7 +73780,7 @@ function inlineType({
|
|
|
73864
73780
|
body,
|
|
73865
73781
|
field
|
|
73866
73782
|
);
|
|
73867
|
-
} else if (
|
|
73783
|
+
} else if (graphql19.isEnumType(type)) {
|
|
73868
73784
|
ensureImports({
|
|
73869
73785
|
config: config2,
|
|
73870
73786
|
body,
|
|
@@ -73889,11 +73805,11 @@ function inlineType({
|
|
|
73889
73805
|
for (const selection of selections) {
|
|
73890
73806
|
if (selection.kind === "InlineFragment" && selection.typeCondition) {
|
|
73891
73807
|
const fragmentType = config2.schema.getType(selection.typeCondition.name.value);
|
|
73892
|
-
if (!
|
|
73808
|
+
if (!graphql19.isInterfaceType(type) && !graphql19.isUnionType(type)) {
|
|
73893
73809
|
selectedFields.push(...selection.selectionSet.selections);
|
|
73894
73810
|
continue;
|
|
73895
73811
|
}
|
|
73896
|
-
if (!
|
|
73812
|
+
if (!graphql19.isInterfaceType(fragmentType) && !graphql19.isUnionType(fragmentType)) {
|
|
73897
73813
|
if (!inlineFragments[fragmentType.name]) {
|
|
73898
73814
|
inlineFragments[fragmentType.name] = [];
|
|
73899
73815
|
}
|
|
@@ -73985,6 +73901,11 @@ function inlineType({
|
|
|
73985
73901
|
if (allOptional) {
|
|
73986
73902
|
prop.optional = true;
|
|
73987
73903
|
}
|
|
73904
|
+
if (field2.description || field2.deprecationReason) {
|
|
73905
|
+
prop.comments = [
|
|
73906
|
+
jsdocComment(field2.description ?? "", field2.deprecationReason ?? void 0)
|
|
73907
|
+
];
|
|
73908
|
+
}
|
|
73988
73909
|
return prop;
|
|
73989
73910
|
})
|
|
73990
73911
|
]);
|
|
@@ -74036,7 +73957,7 @@ function inlineType({
|
|
|
74036
73957
|
}
|
|
74037
73958
|
}
|
|
74038
73959
|
}
|
|
74039
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
73960
|
+
if (objectType.type === "TSTypeLiteral" && !graphql19.isInterfaceType(fragmentRootType) && !graphql19.isUnionType(fragmentRootType)) {
|
|
74040
73961
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
74041
73962
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
74042
73963
|
);
|
|
@@ -74061,11 +73982,11 @@ function inlineType({
|
|
|
74061
73982
|
];
|
|
74062
73983
|
}
|
|
74063
73984
|
let coveredTypenames;
|
|
74064
|
-
if (
|
|
73985
|
+
if (graphql19.isInterfaceType(fragmentRootType)) {
|
|
74065
73986
|
coveredTypenames = interfaceCoveredTypenames(fragmentRootType);
|
|
74066
|
-
} else if (
|
|
73987
|
+
} else if (graphql19.isUnionType(fragmentRootType)) {
|
|
74067
73988
|
coveredTypenames = fragmentRootType.getTypes().map((type2) => type2.name);
|
|
74068
|
-
} else if (
|
|
73989
|
+
} else if (graphql19.isObjectType(fragmentRootType)) {
|
|
74069
73990
|
coveredTypenames = [fragmentRootType.name];
|
|
74070
73991
|
} else {
|
|
74071
73992
|
throw Error("unreachable code");
|
|
@@ -74101,7 +74022,7 @@ function inlineType({
|
|
|
74101
74022
|
);
|
|
74102
74023
|
}
|
|
74103
74024
|
);
|
|
74104
|
-
const parentIsUnionOrInterface = !
|
|
74025
|
+
const parentIsUnionOrInterface = !graphql19.isInterfaceType(type) && !graphql19.isUnionType(type);
|
|
74105
74026
|
const possibleTypenames = parentIsUnionOrInterface ? [parent.name] : config2.schema.getPossibleTypes(type).map((type2) => type2.name);
|
|
74106
74027
|
const coveredTypenames = new Set(
|
|
74107
74028
|
Object.values(inlineFragmentSelections).flatMap((sel) => sel.coveredTypenames)
|
|
@@ -74168,7 +74089,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
74168
74089
|
},
|
|
74169
74090
|
type: schema.getType("String")
|
|
74170
74091
|
};
|
|
74171
|
-
} else if (
|
|
74092
|
+
} else if (graphql19.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
74172
74093
|
fields = rootType.ofType.getFields();
|
|
74173
74094
|
} else {
|
|
74174
74095
|
fields = rootType.getFields();
|
|
@@ -74180,7 +74101,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
74180
74101
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
74181
74102
|
});
|
|
74182
74103
|
}
|
|
74183
|
-
const fieldType =
|
|
74104
|
+
const fieldType = graphql19.getNamedType(field.type);
|
|
74184
74105
|
if (!fieldType) {
|
|
74185
74106
|
throw new HoudiniError({
|
|
74186
74107
|
filepath,
|
|
@@ -74396,17 +74317,20 @@ export * from "${module2}"
|
|
|
74396
74317
|
}
|
|
74397
74318
|
}
|
|
74398
74319
|
await fs_exports.writeFile(config2.typeIndexPath, indexContent);
|
|
74399
|
-
|
|
74400
|
-
|
|
74401
|
-
|
|
74402
|
-
|
|
74320
|
+
const missingScalarNames = [...missingScalars].filter(
|
|
74321
|
+
(scalar) => !config2.configFile.features?.runtimeScalars?.[scalar]
|
|
74322
|
+
);
|
|
74323
|
+
if (missingScalarNames.length > 0) {
|
|
74324
|
+
console.warn(`\u26A0\uFE0F Missing definitions for the following scalars: ${[
|
|
74325
|
+
...missingScalarNames
|
|
74326
|
+
].join(", ")}
|
|
74403
74327
|
Generated types will contain an any type in place of these values. To fix this, provide an equivalent
|
|
74404
74328
|
type in your config file:
|
|
74405
74329
|
|
|
74406
74330
|
{
|
|
74407
74331
|
scalars: {
|
|
74408
74332
|
${cyan3(`/* in your case, something like */`)}
|
|
74409
|
-
${[...
|
|
74333
|
+
${[...missingScalarNames].map(
|
|
74410
74334
|
(c) => ` ${c}: { ${green3(`// <- The GraphQL Scalar`)}
|
|
74411
74335
|
type: "${cyan3(`YourType_${c}`)}" ${green3(`// <- The TypeScript type`)}
|
|
74412
74336
|
}`
|
|
@@ -74685,7 +74609,7 @@ async function generateFragmentTypeDefs(config2, filepath, body, selections, def
|
|
|
74685
74609
|
}
|
|
74686
74610
|
|
|
74687
74611
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
74688
|
-
var
|
|
74612
|
+
var graphql20 = __toESM(require("graphql"), 1);
|
|
74689
74613
|
var recast12 = __toESM(require_main2(), 1);
|
|
74690
74614
|
var AST12 = recast12.types.builders;
|
|
74691
74615
|
async function imperativeCacheTypef(config2, docs) {
|
|
@@ -74737,7 +74661,7 @@ function typeDefinitions(config2, filepath, body, docs, returnType) {
|
|
|
74737
74661
|
const operationTypes = [config2.schema.getMutationType(), config2.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
74738
74662
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
74739
74663
|
const types17 = Object.values(config2.schema.getTypeMap()).filter(
|
|
74740
|
-
(type) => !
|
|
74664
|
+
(type) => !graphql20.isAbstractType(type) && !graphql20.isScalarType(type) && !graphql20.isEnumType(type) && !graphql20.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
74741
74665
|
);
|
|
74742
74666
|
const fragmentMap = fragmentListMap(
|
|
74743
74667
|
config2,
|
|
@@ -74754,7 +74678,7 @@ function typeDefinitions(config2, filepath, body, docs, returnType) {
|
|
|
74754
74678
|
}
|
|
74755
74679
|
let idFields = AST12.tsNeverKeyword();
|
|
74756
74680
|
const keys2 = keyFieldsForType(config2.configFile, type.name);
|
|
74757
|
-
if (
|
|
74681
|
+
if (graphql20.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
74758
74682
|
idFields = AST12.tsTypeLiteral(
|
|
74759
74683
|
keys2.map((key) => {
|
|
74760
74684
|
const fieldType = type.getFields()[key];
|
|
@@ -74781,13 +74705,13 @@ function typeDefinitions(config2, filepath, body, docs, returnType) {
|
|
|
74781
74705
|
idFields = AST12.tsTypeLiteral([]);
|
|
74782
74706
|
}
|
|
74783
74707
|
let fields = AST12.tsTypeLiteral([]);
|
|
74784
|
-
if (
|
|
74708
|
+
if (graphql20.isObjectType(type)) {
|
|
74785
74709
|
fields = AST12.tsTypeLiteral(
|
|
74786
74710
|
Object.entries(type.getFields()).map(
|
|
74787
74711
|
([key, fieldType]) => {
|
|
74788
74712
|
const unwrapped = unwrapType(config2, fieldType.type);
|
|
74789
74713
|
let typeOptions = AST12.tsUnionType([]);
|
|
74790
|
-
if (
|
|
74714
|
+
if (graphql20.isScalarType(unwrapped.type)) {
|
|
74791
74715
|
typeOptions.types.push(
|
|
74792
74716
|
scalarPropertyValue(
|
|
74793
74717
|
config2,
|
|
@@ -74801,11 +74725,11 @@ function typeDefinitions(config2, filepath, body, docs, returnType) {
|
|
|
74801
74725
|
}
|
|
74802
74726
|
)
|
|
74803
74727
|
);
|
|
74804
|
-
} else if (
|
|
74728
|
+
} else if (graphql20.isEnumType(unwrapped.type)) {
|
|
74805
74729
|
typeOptions.types.push(
|
|
74806
74730
|
AST12.tsTypeReference(AST12.identifier(unwrapped.type.name))
|
|
74807
74731
|
);
|
|
74808
|
-
} else if (!
|
|
74732
|
+
} else if (!graphql20.isAbstractType(unwrapped.type)) {
|
|
74809
74733
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
74810
74734
|
} else {
|
|
74811
74735
|
typeOptions.types.push(
|
|
@@ -74901,7 +74825,7 @@ function listDefinitions(config2, filepath, body, docs) {
|
|
|
74901
74825
|
const lists = [];
|
|
74902
74826
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
74903
74827
|
for (const doc of docs) {
|
|
74904
|
-
|
|
74828
|
+
graphql20.visit(doc.document, {
|
|
74905
74829
|
Directive(node, key, parent2, path3, ancestors) {
|
|
74906
74830
|
if (![config2.listDirective, config2.paginateDirective].includes(node.name.value)) {
|
|
74907
74831
|
return;
|
|
@@ -74923,7 +74847,7 @@ function listDefinitions(config2, filepath, body, docs) {
|
|
|
74923
74847
|
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
74924
74848
|
const { type: listType } = unwrapType(config2, targetFieldDefinition.type);
|
|
74925
74849
|
const possibleTypes = [];
|
|
74926
|
-
if (
|
|
74850
|
+
if (graphql20.isAbstractType(listType)) {
|
|
74927
74851
|
possibleTypes.push(
|
|
74928
74852
|
...config2.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
74929
74853
|
);
|
|
@@ -75085,7 +75009,7 @@ async function typescriptGenerator(config2, docs) {
|
|
|
75085
75009
|
}
|
|
75086
75010
|
|
|
75087
75011
|
// src/codegen/generators/persistedQueries/index.ts
|
|
75088
|
-
var
|
|
75012
|
+
var graphql21 = __toESM(require("graphql"), 1);
|
|
75089
75013
|
async function persistOutputGenerator(config2, docs) {
|
|
75090
75014
|
if (!config2.persistedQueriesPath.endsWith(".json")) {
|
|
75091
75015
|
throw new Error('Can write Persisted Queries only in a ".json" file.');
|
|
@@ -75095,8 +75019,8 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
75095
75019
|
if (!generateArtifact) {
|
|
75096
75020
|
return acc;
|
|
75097
75021
|
}
|
|
75098
|
-
let rawString =
|
|
75099
|
-
|
|
75022
|
+
let rawString = graphql21.print(
|
|
75023
|
+
graphql21.visit(document, {
|
|
75100
75024
|
Directive(node) {
|
|
75101
75025
|
if (config2.isInternalDirective(node.name.value)) {
|
|
75102
75026
|
return null;
|
|
@@ -75105,7 +75029,7 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
75105
75029
|
})
|
|
75106
75030
|
);
|
|
75107
75031
|
const operations = document.definitions.filter(
|
|
75108
|
-
({ kind }) => kind ===
|
|
75032
|
+
({ kind }) => kind === graphql21.Kind.OPERATION_DEFINITION
|
|
75109
75033
|
);
|
|
75110
75034
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
75111
75035
|
if (artifact) {
|
|
@@ -75120,33 +75044,45 @@ async function persistOutputGenerator(config2, docs) {
|
|
|
75120
75044
|
}
|
|
75121
75045
|
|
|
75122
75046
|
// src/codegen/generators/definitions/index.ts
|
|
75123
|
-
var
|
|
75047
|
+
var graphql23 = __toESM(require("graphql"), 1);
|
|
75124
75048
|
|
|
75125
75049
|
// src/codegen/generators/definitions/enums.ts
|
|
75126
|
-
var
|
|
75050
|
+
var graphql22 = __toESM(require("graphql"), 1);
|
|
75127
75051
|
var recast13 = __toESM(require_main2(), 1);
|
|
75128
75052
|
var AST13 = recast13.types.builders;
|
|
75129
75053
|
async function definitionsGenerator(config2) {
|
|
75130
|
-
const enums =
|
|
75054
|
+
const enums = graphql22.parse(graphql22.printSchema(config2.schema)).definitions.filter(
|
|
75131
75055
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
75132
75056
|
).filter((def) => !config2.isInternalEnum(def));
|
|
75133
75057
|
const { code: runtimeDefinitions } = await printJS(
|
|
75134
75058
|
AST13.program(
|
|
75135
75059
|
enums.map((defn) => {
|
|
75136
75060
|
const name = defn.name.value;
|
|
75137
|
-
|
|
75061
|
+
const declaration = moduleExport(
|
|
75138
75062
|
config2,
|
|
75139
75063
|
name,
|
|
75140
75064
|
AST13.objectExpression(
|
|
75141
75065
|
defn.values?.map((value) => {
|
|
75142
75066
|
const str = value.name.value;
|
|
75143
|
-
|
|
75067
|
+
const prop = AST13.objectProperty(
|
|
75144
75068
|
AST13.stringLiteral(str),
|
|
75145
75069
|
AST13.stringLiteral(str)
|
|
75146
75070
|
);
|
|
75071
|
+
const deprecationReason = value.directives?.find((d) => d.name.value === "deprecated")?.arguments?.find((a) => a.name.value === "reason")?.value?.value;
|
|
75072
|
+
if (value.description || deprecationReason)
|
|
75073
|
+
prop.comments = [
|
|
75074
|
+
jsdocComment(value.description?.value ?? "", deprecationReason)
|
|
75075
|
+
];
|
|
75076
|
+
return prop;
|
|
75147
75077
|
}) || []
|
|
75148
75078
|
)
|
|
75149
75079
|
);
|
|
75080
|
+
if (defn.description) {
|
|
75081
|
+
declaration.comments = [
|
|
75082
|
+
AST13.commentBlock(`* ${defn.description.value} `, true, false)
|
|
75083
|
+
];
|
|
75084
|
+
}
|
|
75085
|
+
return declaration;
|
|
75150
75086
|
})
|
|
75151
75087
|
)
|
|
75152
75088
|
);
|
|
@@ -75155,11 +75091,19 @@ type ValuesOf<T> = T[keyof T]
|
|
|
75155
75091
|
` + enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map((definition) => {
|
|
75156
75092
|
const name = definition.name.value;
|
|
75157
75093
|
const values = definition.values;
|
|
75158
|
-
|
|
75094
|
+
let jsdoc = "";
|
|
75095
|
+
if (definition.description) {
|
|
75096
|
+
jsdoc = `
|
|
75097
|
+
/** ${definition.description.value} */`;
|
|
75098
|
+
}
|
|
75099
|
+
return `${jsdoc}
|
|
75159
75100
|
export declare const ${name}: {
|
|
75160
|
-
${values?.map(
|
|
75101
|
+
${values?.map(
|
|
75102
|
+
(value) => (value.description ? ` /** ${value.description.value} */
|
|
75103
|
+
` : "") + ` readonly ${value.name.value}: "${value.name.value}";`
|
|
75104
|
+
).join("\n")}
|
|
75161
75105
|
}
|
|
75162
|
-
|
|
75106
|
+
${jsdoc}
|
|
75163
75107
|
export type ${name}$options = ValuesOf<typeof ${name}>
|
|
75164
75108
|
`;
|
|
75165
75109
|
}).join("");
|
|
@@ -75179,7 +75123,7 @@ async function schemaGenerator(config2) {
|
|
|
75179
75123
|
await Promise.all([
|
|
75180
75124
|
fs_exports.writeFile(
|
|
75181
75125
|
config2.definitionsSchemaPath,
|
|
75182
|
-
config2.localSchema ?
|
|
75126
|
+
config2.localSchema ? graphql23.printSchema(config2.schema) : config2.newSchema
|
|
75183
75127
|
),
|
|
75184
75128
|
fs_exports.writeFile(config2.definitionsDocumentsPath, config2.newDocuments),
|
|
75185
75129
|
definitionsGenerator(config2)
|
|
@@ -75224,7 +75168,7 @@ async function writeIndexFile2(config2, docs) {
|
|
|
75224
75168
|
}
|
|
75225
75169
|
|
|
75226
75170
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/helpers.js
|
|
75227
|
-
var
|
|
75171
|
+
var import_graphql33 = require("graphql");
|
|
75228
75172
|
function compareStrings2(a, b) {
|
|
75229
75173
|
if (String(a) < String(b)) {
|
|
75230
75174
|
return -1;
|
|
@@ -75260,7 +75204,7 @@ function isSome2(input) {
|
|
|
75260
75204
|
}
|
|
75261
75205
|
|
|
75262
75206
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/inspect.js
|
|
75263
|
-
var
|
|
75207
|
+
var import_graphql34 = require("graphql");
|
|
75264
75208
|
var MAX_RECURSIVE_DEPTH2 = 3;
|
|
75265
75209
|
function inspect2(value) {
|
|
75266
75210
|
return formatValue2(value, []);
|
|
@@ -75278,7 +75222,7 @@ function formatValue2(value, seenValues) {
|
|
|
75278
75222
|
}
|
|
75279
75223
|
}
|
|
75280
75224
|
function formatError2(value) {
|
|
75281
|
-
if (value instanceof
|
|
75225
|
+
if (value instanceof import_graphql34.GraphQLError) {
|
|
75282
75226
|
return value.toString();
|
|
75283
75227
|
}
|
|
75284
75228
|
return `${value.name}: ${value.message};
|
|
@@ -75361,43 +75305,43 @@ function getDirectivesInExtensions2(node, pathToDirectivesInExtensions = ["direc
|
|
|
75361
75305
|
}
|
|
75362
75306
|
|
|
75363
75307
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js
|
|
75364
|
-
var
|
|
75308
|
+
var import_graphql38 = require("graphql");
|
|
75365
75309
|
|
|
75366
75310
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromType.js
|
|
75367
|
-
var
|
|
75311
|
+
var import_graphql35 = require("graphql");
|
|
75368
75312
|
function astFromType2(type) {
|
|
75369
|
-
if ((0,
|
|
75313
|
+
if ((0, import_graphql35.isNonNullType)(type)) {
|
|
75370
75314
|
const innerType = astFromType2(type.ofType);
|
|
75371
|
-
if (innerType.kind ===
|
|
75315
|
+
if (innerType.kind === import_graphql35.Kind.NON_NULL_TYPE) {
|
|
75372
75316
|
throw new Error(`Invalid type node ${inspect2(type)}. Inner type of non-null type cannot be a non-null type.`);
|
|
75373
75317
|
}
|
|
75374
75318
|
return {
|
|
75375
|
-
kind:
|
|
75319
|
+
kind: import_graphql35.Kind.NON_NULL_TYPE,
|
|
75376
75320
|
type: innerType
|
|
75377
75321
|
};
|
|
75378
|
-
} else if ((0,
|
|
75322
|
+
} else if ((0, import_graphql35.isListType)(type)) {
|
|
75379
75323
|
return {
|
|
75380
|
-
kind:
|
|
75324
|
+
kind: import_graphql35.Kind.LIST_TYPE,
|
|
75381
75325
|
type: astFromType2(type.ofType)
|
|
75382
75326
|
};
|
|
75383
75327
|
}
|
|
75384
75328
|
return {
|
|
75385
|
-
kind:
|
|
75329
|
+
kind: import_graphql35.Kind.NAMED_TYPE,
|
|
75386
75330
|
name: {
|
|
75387
|
-
kind:
|
|
75331
|
+
kind: import_graphql35.Kind.NAME,
|
|
75388
75332
|
value: type.name
|
|
75389
75333
|
}
|
|
75390
75334
|
};
|
|
75391
75335
|
}
|
|
75392
75336
|
|
|
75393
75337
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
|
|
75394
|
-
var
|
|
75338
|
+
var import_graphql37 = require("graphql");
|
|
75395
75339
|
|
|
75396
75340
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js
|
|
75397
|
-
var
|
|
75341
|
+
var import_graphql36 = require("graphql");
|
|
75398
75342
|
function astFromValueUntyped2(value) {
|
|
75399
75343
|
if (value === null) {
|
|
75400
|
-
return { kind:
|
|
75344
|
+
return { kind: import_graphql36.Kind.NULL };
|
|
75401
75345
|
}
|
|
75402
75346
|
if (value === void 0) {
|
|
75403
75347
|
return null;
|
|
@@ -75410,7 +75354,7 @@ function astFromValueUntyped2(value) {
|
|
|
75410
75354
|
valuesNodes.push(itemNode);
|
|
75411
75355
|
}
|
|
75412
75356
|
}
|
|
75413
|
-
return { kind:
|
|
75357
|
+
return { kind: import_graphql36.Kind.LIST, values: valuesNodes };
|
|
75414
75358
|
}
|
|
75415
75359
|
if (typeof value === "object") {
|
|
75416
75360
|
const fieldNodes = [];
|
|
@@ -75419,26 +75363,26 @@ function astFromValueUntyped2(value) {
|
|
|
75419
75363
|
const ast = astFromValueUntyped2(fieldValue);
|
|
75420
75364
|
if (ast) {
|
|
75421
75365
|
fieldNodes.push({
|
|
75422
|
-
kind:
|
|
75423
|
-
name: { kind:
|
|
75366
|
+
kind: import_graphql36.Kind.OBJECT_FIELD,
|
|
75367
|
+
name: { kind: import_graphql36.Kind.NAME, value: fieldName },
|
|
75424
75368
|
value: ast
|
|
75425
75369
|
});
|
|
75426
75370
|
}
|
|
75427
75371
|
}
|
|
75428
|
-
return { kind:
|
|
75372
|
+
return { kind: import_graphql36.Kind.OBJECT, fields: fieldNodes };
|
|
75429
75373
|
}
|
|
75430
75374
|
if (typeof value === "boolean") {
|
|
75431
|
-
return { kind:
|
|
75375
|
+
return { kind: import_graphql36.Kind.BOOLEAN, value };
|
|
75432
75376
|
}
|
|
75433
75377
|
if (typeof value === "bigint") {
|
|
75434
|
-
return { kind:
|
|
75378
|
+
return { kind: import_graphql36.Kind.INT, value: String(value) };
|
|
75435
75379
|
}
|
|
75436
75380
|
if (typeof value === "number" && isFinite(value)) {
|
|
75437
75381
|
const stringNum = String(value);
|
|
75438
|
-
return integerStringRegExp2.test(stringNum) ? { kind:
|
|
75382
|
+
return integerStringRegExp2.test(stringNum) ? { kind: import_graphql36.Kind.INT, value: stringNum } : { kind: import_graphql36.Kind.FLOAT, value: stringNum };
|
|
75439
75383
|
}
|
|
75440
75384
|
if (typeof value === "string") {
|
|
75441
|
-
return { kind:
|
|
75385
|
+
return { kind: import_graphql36.Kind.STRING, value };
|
|
75442
75386
|
}
|
|
75443
75387
|
throw new TypeError(`Cannot convert value to AST: ${value}.`);
|
|
75444
75388
|
}
|
|
@@ -75446,20 +75390,20 @@ var integerStringRegExp2 = /^-?(?:0|[1-9][0-9]*)$/;
|
|
|
75446
75390
|
|
|
75447
75391
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
|
|
75448
75392
|
function astFromValue2(value, type) {
|
|
75449
|
-
if ((0,
|
|
75393
|
+
if ((0, import_graphql37.isNonNullType)(type)) {
|
|
75450
75394
|
const astValue = astFromValue2(value, type.ofType);
|
|
75451
|
-
if (astValue?.kind ===
|
|
75395
|
+
if (astValue?.kind === import_graphql37.Kind.NULL) {
|
|
75452
75396
|
return null;
|
|
75453
75397
|
}
|
|
75454
75398
|
return astValue;
|
|
75455
75399
|
}
|
|
75456
75400
|
if (value === null) {
|
|
75457
|
-
return { kind:
|
|
75401
|
+
return { kind: import_graphql37.Kind.NULL };
|
|
75458
75402
|
}
|
|
75459
75403
|
if (value === void 0) {
|
|
75460
75404
|
return null;
|
|
75461
75405
|
}
|
|
75462
|
-
if ((0,
|
|
75406
|
+
if ((0, import_graphql37.isListType)(type)) {
|
|
75463
75407
|
const itemType = type.ofType;
|
|
75464
75408
|
if (isIterableObject(value)) {
|
|
75465
75409
|
const valuesNodes = [];
|
|
@@ -75469,11 +75413,11 @@ function astFromValue2(value, type) {
|
|
|
75469
75413
|
valuesNodes.push(itemNode);
|
|
75470
75414
|
}
|
|
75471
75415
|
}
|
|
75472
|
-
return { kind:
|
|
75416
|
+
return { kind: import_graphql37.Kind.LIST, values: valuesNodes };
|
|
75473
75417
|
}
|
|
75474
75418
|
return astFromValue2(value, itemType);
|
|
75475
75419
|
}
|
|
75476
|
-
if ((0,
|
|
75420
|
+
if ((0, import_graphql37.isInputObjectType)(type)) {
|
|
75477
75421
|
if (!isObjectLike(value)) {
|
|
75478
75422
|
return null;
|
|
75479
75423
|
}
|
|
@@ -75482,24 +75426,24 @@ function astFromValue2(value, type) {
|
|
|
75482
75426
|
const fieldValue = astFromValue2(value[field.name], field.type);
|
|
75483
75427
|
if (fieldValue) {
|
|
75484
75428
|
fieldNodes.push({
|
|
75485
|
-
kind:
|
|
75486
|
-
name: { kind:
|
|
75429
|
+
kind: import_graphql37.Kind.OBJECT_FIELD,
|
|
75430
|
+
name: { kind: import_graphql37.Kind.NAME, value: field.name },
|
|
75487
75431
|
value: fieldValue
|
|
75488
75432
|
});
|
|
75489
75433
|
}
|
|
75490
75434
|
}
|
|
75491
|
-
return { kind:
|
|
75435
|
+
return { kind: import_graphql37.Kind.OBJECT, fields: fieldNodes };
|
|
75492
75436
|
}
|
|
75493
|
-
if ((0,
|
|
75437
|
+
if ((0, import_graphql37.isLeafType)(type)) {
|
|
75494
75438
|
const serialized = type.serialize(value);
|
|
75495
75439
|
if (serialized == null) {
|
|
75496
75440
|
return null;
|
|
75497
75441
|
}
|
|
75498
|
-
if ((0,
|
|
75499
|
-
return { kind:
|
|
75442
|
+
if ((0, import_graphql37.isEnumType)(type)) {
|
|
75443
|
+
return { kind: import_graphql37.Kind.ENUM, value: serialized };
|
|
75500
75444
|
}
|
|
75501
75445
|
if (type.name === "ID" && typeof serialized === "string" && integerStringRegExp3.test(serialized)) {
|
|
75502
|
-
return { kind:
|
|
75446
|
+
return { kind: import_graphql37.Kind.INT, value: serialized };
|
|
75503
75447
|
}
|
|
75504
75448
|
return astFromValueUntyped2(serialized);
|
|
75505
75449
|
}
|
|
@@ -75555,36 +75499,36 @@ function getDocumentNodeFromSchema2(schema, options = {}) {
|
|
|
75555
75499
|
const definitions = schemaNode != null ? [schemaNode] : [];
|
|
75556
75500
|
const directives = schema.getDirectives();
|
|
75557
75501
|
for (const directive of directives) {
|
|
75558
|
-
if ((0,
|
|
75502
|
+
if ((0, import_graphql38.isSpecifiedDirective)(directive)) {
|
|
75559
75503
|
continue;
|
|
75560
75504
|
}
|
|
75561
75505
|
definitions.push(astFromDirective2(directive, schema, pathToDirectivesInExtensions));
|
|
75562
75506
|
}
|
|
75563
75507
|
for (const typeName in typesMap) {
|
|
75564
75508
|
const type = typesMap[typeName];
|
|
75565
|
-
const isPredefinedScalar = (0,
|
|
75566
|
-
const isIntrospection = (0,
|
|
75509
|
+
const isPredefinedScalar = (0, import_graphql38.isSpecifiedScalarType)(type);
|
|
75510
|
+
const isIntrospection = (0, import_graphql38.isIntrospectionType)(type);
|
|
75567
75511
|
if (isPredefinedScalar || isIntrospection) {
|
|
75568
75512
|
continue;
|
|
75569
75513
|
}
|
|
75570
|
-
if ((0,
|
|
75514
|
+
if ((0, import_graphql38.isObjectType)(type)) {
|
|
75571
75515
|
definitions.push(astFromObjectType2(type, schema, pathToDirectivesInExtensions));
|
|
75572
|
-
} else if ((0,
|
|
75516
|
+
} else if ((0, import_graphql38.isInterfaceType)(type)) {
|
|
75573
75517
|
definitions.push(astFromInterfaceType2(type, schema, pathToDirectivesInExtensions));
|
|
75574
|
-
} else if ((0,
|
|
75518
|
+
} else if ((0, import_graphql38.isUnionType)(type)) {
|
|
75575
75519
|
definitions.push(astFromUnionType2(type, schema, pathToDirectivesInExtensions));
|
|
75576
|
-
} else if ((0,
|
|
75520
|
+
} else if ((0, import_graphql38.isInputObjectType)(type)) {
|
|
75577
75521
|
definitions.push(astFromInputObjectType2(type, schema, pathToDirectivesInExtensions));
|
|
75578
|
-
} else if ((0,
|
|
75522
|
+
} else if ((0, import_graphql38.isEnumType)(type)) {
|
|
75579
75523
|
definitions.push(astFromEnumType2(type, schema, pathToDirectivesInExtensions));
|
|
75580
|
-
} else if ((0,
|
|
75524
|
+
} else if ((0, import_graphql38.isScalarType)(type)) {
|
|
75581
75525
|
definitions.push(astFromScalarType2(type, schema, pathToDirectivesInExtensions));
|
|
75582
75526
|
} else {
|
|
75583
75527
|
throw new Error(`Unknown type ${type}.`);
|
|
75584
75528
|
}
|
|
75585
75529
|
}
|
|
75586
75530
|
return {
|
|
75587
|
-
kind:
|
|
75531
|
+
kind: import_graphql38.Kind.DOCUMENT,
|
|
75588
75532
|
definitions
|
|
75589
75533
|
};
|
|
75590
75534
|
}
|
|
@@ -75619,7 +75563,7 @@ function astFromSchema2(schema, pathToDirectivesInExtensions) {
|
|
|
75619
75563
|
operationTypeDefinitionNode.type = rootTypeAST;
|
|
75620
75564
|
} else {
|
|
75621
75565
|
operationTypeMap.set(operationTypeNode, {
|
|
75622
|
-
kind:
|
|
75566
|
+
kind: import_graphql38.Kind.OPERATION_TYPE_DEFINITION,
|
|
75623
75567
|
operation: operationTypeNode,
|
|
75624
75568
|
type: rootTypeAST
|
|
75625
75569
|
});
|
|
@@ -75632,12 +75576,12 @@ function astFromSchema2(schema, pathToDirectivesInExtensions) {
|
|
|
75632
75576
|
return null;
|
|
75633
75577
|
}
|
|
75634
75578
|
const schemaNode = {
|
|
75635
|
-
kind: operationTypes != null ?
|
|
75579
|
+
kind: operationTypes != null ? import_graphql38.Kind.SCHEMA_DEFINITION : import_graphql38.Kind.SCHEMA_EXTENSION,
|
|
75636
75580
|
operationTypes,
|
|
75637
75581
|
directives
|
|
75638
75582
|
};
|
|
75639
75583
|
schemaNode.description = schema.astNode?.description ?? schema.description != null ? {
|
|
75640
|
-
kind:
|
|
75584
|
+
kind: import_graphql38.Kind.STRING,
|
|
75641
75585
|
value: schema.description,
|
|
75642
75586
|
block: true
|
|
75643
75587
|
} : void 0;
|
|
@@ -75645,19 +75589,19 @@ function astFromSchema2(schema, pathToDirectivesInExtensions) {
|
|
|
75645
75589
|
}
|
|
75646
75590
|
function astFromDirective2(directive, schema, pathToDirectivesInExtensions) {
|
|
75647
75591
|
return {
|
|
75648
|
-
kind:
|
|
75592
|
+
kind: import_graphql38.Kind.DIRECTIVE_DEFINITION,
|
|
75649
75593
|
description: directive.astNode?.description ?? (directive.description ? {
|
|
75650
|
-
kind:
|
|
75594
|
+
kind: import_graphql38.Kind.STRING,
|
|
75651
75595
|
value: directive.description
|
|
75652
75596
|
} : void 0),
|
|
75653
75597
|
name: {
|
|
75654
|
-
kind:
|
|
75598
|
+
kind: import_graphql38.Kind.NAME,
|
|
75655
75599
|
value: directive.name
|
|
75656
75600
|
},
|
|
75657
75601
|
arguments: directive.args?.map((arg) => astFromArg2(arg, schema, pathToDirectivesInExtensions)),
|
|
75658
75602
|
repeatable: directive.isRepeatable,
|
|
75659
75603
|
locations: directive.locations?.map((location) => ({
|
|
75660
|
-
kind:
|
|
75604
|
+
kind: import_graphql38.Kind.NAME,
|
|
75661
75605
|
value: location
|
|
75662
75606
|
})) || []
|
|
75663
75607
|
};
|
|
@@ -75707,14 +75651,14 @@ function getDeprecatableDirectiveNodes2(entity, schema, pathToDirectivesInExtens
|
|
|
75707
75651
|
}
|
|
75708
75652
|
function astFromArg2(arg, schema, pathToDirectivesInExtensions) {
|
|
75709
75653
|
return {
|
|
75710
|
-
kind:
|
|
75654
|
+
kind: import_graphql38.Kind.INPUT_VALUE_DEFINITION,
|
|
75711
75655
|
description: arg.astNode?.description ?? (arg.description ? {
|
|
75712
|
-
kind:
|
|
75656
|
+
kind: import_graphql38.Kind.STRING,
|
|
75713
75657
|
value: arg.description,
|
|
75714
75658
|
block: true
|
|
75715
75659
|
} : void 0),
|
|
75716
75660
|
name: {
|
|
75717
|
-
kind:
|
|
75661
|
+
kind: import_graphql38.Kind.NAME,
|
|
75718
75662
|
value: arg.name
|
|
75719
75663
|
},
|
|
75720
75664
|
type: astFromType2(arg.type),
|
|
@@ -75724,14 +75668,14 @@ function astFromArg2(arg, schema, pathToDirectivesInExtensions) {
|
|
|
75724
75668
|
}
|
|
75725
75669
|
function astFromObjectType2(type, schema, pathToDirectivesInExtensions) {
|
|
75726
75670
|
return {
|
|
75727
|
-
kind:
|
|
75671
|
+
kind: import_graphql38.Kind.OBJECT_TYPE_DEFINITION,
|
|
75728
75672
|
description: type.astNode?.description ?? (type.description ? {
|
|
75729
|
-
kind:
|
|
75673
|
+
kind: import_graphql38.Kind.STRING,
|
|
75730
75674
|
value: type.description,
|
|
75731
75675
|
block: true
|
|
75732
75676
|
} : void 0),
|
|
75733
75677
|
name: {
|
|
75734
|
-
kind:
|
|
75678
|
+
kind: import_graphql38.Kind.NAME,
|
|
75735
75679
|
value: type.name
|
|
75736
75680
|
},
|
|
75737
75681
|
fields: Object.values(type.getFields()).map((field) => astFromField2(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -75741,14 +75685,14 @@ function astFromObjectType2(type, schema, pathToDirectivesInExtensions) {
|
|
|
75741
75685
|
}
|
|
75742
75686
|
function astFromInterfaceType2(type, schema, pathToDirectivesInExtensions) {
|
|
75743
75687
|
const node = {
|
|
75744
|
-
kind:
|
|
75688
|
+
kind: import_graphql38.Kind.INTERFACE_TYPE_DEFINITION,
|
|
75745
75689
|
description: type.astNode?.description ?? (type.description ? {
|
|
75746
|
-
kind:
|
|
75690
|
+
kind: import_graphql38.Kind.STRING,
|
|
75747
75691
|
value: type.description,
|
|
75748
75692
|
block: true
|
|
75749
75693
|
} : void 0),
|
|
75750
75694
|
name: {
|
|
75751
|
-
kind:
|
|
75695
|
+
kind: import_graphql38.Kind.NAME,
|
|
75752
75696
|
value: type.name
|
|
75753
75697
|
},
|
|
75754
75698
|
fields: Object.values(type.getFields()).map((field) => astFromField2(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -75761,14 +75705,14 @@ function astFromInterfaceType2(type, schema, pathToDirectivesInExtensions) {
|
|
|
75761
75705
|
}
|
|
75762
75706
|
function astFromUnionType2(type, schema, pathToDirectivesInExtensions) {
|
|
75763
75707
|
return {
|
|
75764
|
-
kind:
|
|
75708
|
+
kind: import_graphql38.Kind.UNION_TYPE_DEFINITION,
|
|
75765
75709
|
description: type.astNode?.description ?? (type.description ? {
|
|
75766
|
-
kind:
|
|
75710
|
+
kind: import_graphql38.Kind.STRING,
|
|
75767
75711
|
value: type.description,
|
|
75768
75712
|
block: true
|
|
75769
75713
|
} : void 0),
|
|
75770
75714
|
name: {
|
|
75771
|
-
kind:
|
|
75715
|
+
kind: import_graphql38.Kind.NAME,
|
|
75772
75716
|
value: type.name
|
|
75773
75717
|
},
|
|
75774
75718
|
directives: getDirectiveNodes2(type, schema, pathToDirectivesInExtensions),
|
|
@@ -75777,14 +75721,14 @@ function astFromUnionType2(type, schema, pathToDirectivesInExtensions) {
|
|
|
75777
75721
|
}
|
|
75778
75722
|
function astFromInputObjectType2(type, schema, pathToDirectivesInExtensions) {
|
|
75779
75723
|
return {
|
|
75780
|
-
kind:
|
|
75724
|
+
kind: import_graphql38.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
75781
75725
|
description: type.astNode?.description ?? (type.description ? {
|
|
75782
|
-
kind:
|
|
75726
|
+
kind: import_graphql38.Kind.STRING,
|
|
75783
75727
|
value: type.description,
|
|
75784
75728
|
block: true
|
|
75785
75729
|
} : void 0),
|
|
75786
75730
|
name: {
|
|
75787
|
-
kind:
|
|
75731
|
+
kind: import_graphql38.Kind.NAME,
|
|
75788
75732
|
value: type.name
|
|
75789
75733
|
},
|
|
75790
75734
|
fields: Object.values(type.getFields()).map((field) => astFromInputField2(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -75793,14 +75737,14 @@ function astFromInputObjectType2(type, schema, pathToDirectivesInExtensions) {
|
|
|
75793
75737
|
}
|
|
75794
75738
|
function astFromEnumType2(type, schema, pathToDirectivesInExtensions) {
|
|
75795
75739
|
return {
|
|
75796
|
-
kind:
|
|
75740
|
+
kind: import_graphql38.Kind.ENUM_TYPE_DEFINITION,
|
|
75797
75741
|
description: type.astNode?.description ?? (type.description ? {
|
|
75798
|
-
kind:
|
|
75742
|
+
kind: import_graphql38.Kind.STRING,
|
|
75799
75743
|
value: type.description,
|
|
75800
75744
|
block: true
|
|
75801
75745
|
} : void 0),
|
|
75802
75746
|
name: {
|
|
75803
|
-
kind:
|
|
75747
|
+
kind: import_graphql38.Kind.NAME,
|
|
75804
75748
|
value: type.name
|
|
75805
75749
|
},
|
|
75806
75750
|
values: Object.values(type.getValues()).map((value) => astFromEnumValue2(value, schema, pathToDirectivesInExtensions)),
|
|
@@ -75818,14 +75762,14 @@ function astFromScalarType2(type, schema, pathToDirectivesInExtensions) {
|
|
|
75818
75762
|
directives.push(makeDirectiveNode2("specifiedBy", specifiedByArgs));
|
|
75819
75763
|
}
|
|
75820
75764
|
return {
|
|
75821
|
-
kind:
|
|
75765
|
+
kind: import_graphql38.Kind.SCALAR_TYPE_DEFINITION,
|
|
75822
75766
|
description: type.astNode?.description ?? (type.description ? {
|
|
75823
|
-
kind:
|
|
75767
|
+
kind: import_graphql38.Kind.STRING,
|
|
75824
75768
|
value: type.description,
|
|
75825
75769
|
block: true
|
|
75826
75770
|
} : void 0),
|
|
75827
75771
|
name: {
|
|
75828
|
-
kind:
|
|
75772
|
+
kind: import_graphql38.Kind.NAME,
|
|
75829
75773
|
value: type.name
|
|
75830
75774
|
},
|
|
75831
75775
|
directives
|
|
@@ -75833,14 +75777,14 @@ function astFromScalarType2(type, schema, pathToDirectivesInExtensions) {
|
|
|
75833
75777
|
}
|
|
75834
75778
|
function astFromField2(field, schema, pathToDirectivesInExtensions) {
|
|
75835
75779
|
return {
|
|
75836
|
-
kind:
|
|
75780
|
+
kind: import_graphql38.Kind.FIELD_DEFINITION,
|
|
75837
75781
|
description: field.astNode?.description ?? (field.description ? {
|
|
75838
|
-
kind:
|
|
75782
|
+
kind: import_graphql38.Kind.STRING,
|
|
75839
75783
|
value: field.description,
|
|
75840
75784
|
block: true
|
|
75841
75785
|
} : void 0),
|
|
75842
75786
|
name: {
|
|
75843
|
-
kind:
|
|
75787
|
+
kind: import_graphql38.Kind.NAME,
|
|
75844
75788
|
value: field.name
|
|
75845
75789
|
},
|
|
75846
75790
|
arguments: field.args.map((arg) => astFromArg2(arg, schema, pathToDirectivesInExtensions)),
|
|
@@ -75850,14 +75794,14 @@ function astFromField2(field, schema, pathToDirectivesInExtensions) {
|
|
|
75850
75794
|
}
|
|
75851
75795
|
function astFromInputField2(field, schema, pathToDirectivesInExtensions) {
|
|
75852
75796
|
return {
|
|
75853
|
-
kind:
|
|
75797
|
+
kind: import_graphql38.Kind.INPUT_VALUE_DEFINITION,
|
|
75854
75798
|
description: field.astNode?.description ?? (field.description ? {
|
|
75855
|
-
kind:
|
|
75799
|
+
kind: import_graphql38.Kind.STRING,
|
|
75856
75800
|
value: field.description,
|
|
75857
75801
|
block: true
|
|
75858
75802
|
} : void 0),
|
|
75859
75803
|
name: {
|
|
75860
|
-
kind:
|
|
75804
|
+
kind: import_graphql38.Kind.NAME,
|
|
75861
75805
|
value: field.name
|
|
75862
75806
|
},
|
|
75863
75807
|
type: astFromType2(field.type),
|
|
@@ -75867,21 +75811,21 @@ function astFromInputField2(field, schema, pathToDirectivesInExtensions) {
|
|
|
75867
75811
|
}
|
|
75868
75812
|
function astFromEnumValue2(value, schema, pathToDirectivesInExtensions) {
|
|
75869
75813
|
return {
|
|
75870
|
-
kind:
|
|
75814
|
+
kind: import_graphql38.Kind.ENUM_VALUE_DEFINITION,
|
|
75871
75815
|
description: value.astNode?.description ?? (value.description ? {
|
|
75872
|
-
kind:
|
|
75816
|
+
kind: import_graphql38.Kind.STRING,
|
|
75873
75817
|
value: value.description,
|
|
75874
75818
|
block: true
|
|
75875
75819
|
} : void 0),
|
|
75876
75820
|
name: {
|
|
75877
|
-
kind:
|
|
75821
|
+
kind: import_graphql38.Kind.NAME,
|
|
75878
75822
|
value: value.name
|
|
75879
75823
|
},
|
|
75880
75824
|
directives: getDeprecatableDirectiveNodes2(value, schema, pathToDirectivesInExtensions)
|
|
75881
75825
|
};
|
|
75882
75826
|
}
|
|
75883
75827
|
function makeDeprecatedDirective2(deprecationReason) {
|
|
75884
|
-
return makeDirectiveNode2("deprecated", { reason: deprecationReason },
|
|
75828
|
+
return makeDirectiveNode2("deprecated", { reason: deprecationReason }, import_graphql38.GraphQLDeprecatedDirective);
|
|
75885
75829
|
}
|
|
75886
75830
|
function makeDirectiveNode2(name, args, directive) {
|
|
75887
75831
|
const directiveArguments = [];
|
|
@@ -75893,9 +75837,9 @@ function makeDirectiveNode2(name, args, directive) {
|
|
|
75893
75837
|
const value = astFromValue2(argValue, arg.type);
|
|
75894
75838
|
if (value) {
|
|
75895
75839
|
directiveArguments.push({
|
|
75896
|
-
kind:
|
|
75840
|
+
kind: import_graphql38.Kind.ARGUMENT,
|
|
75897
75841
|
name: {
|
|
75898
|
-
kind:
|
|
75842
|
+
kind: import_graphql38.Kind.NAME,
|
|
75899
75843
|
value: argName
|
|
75900
75844
|
},
|
|
75901
75845
|
value
|
|
@@ -75909,9 +75853,9 @@ function makeDirectiveNode2(name, args, directive) {
|
|
|
75909
75853
|
const value = astFromValueUntyped2(argValue);
|
|
75910
75854
|
if (value) {
|
|
75911
75855
|
directiveArguments.push({
|
|
75912
|
-
kind:
|
|
75856
|
+
kind: import_graphql38.Kind.ARGUMENT,
|
|
75913
75857
|
name: {
|
|
75914
|
-
kind:
|
|
75858
|
+
kind: import_graphql38.Kind.NAME,
|
|
75915
75859
|
value: argName
|
|
75916
75860
|
},
|
|
75917
75861
|
value
|
|
@@ -75920,9 +75864,9 @@ function makeDirectiveNode2(name, args, directive) {
|
|
|
75920
75864
|
}
|
|
75921
75865
|
}
|
|
75922
75866
|
return {
|
|
75923
|
-
kind:
|
|
75867
|
+
kind: import_graphql38.Kind.DIRECTIVE,
|
|
75924
75868
|
name: {
|
|
75925
|
-
kind:
|
|
75869
|
+
kind: import_graphql38.Kind.NAME,
|
|
75926
75870
|
value: name
|
|
75927
75871
|
},
|
|
75928
75872
|
arguments: directiveArguments
|
|
@@ -75945,7 +75889,7 @@ function makeDirectiveNodes2(schema, directiveValues) {
|
|
|
75945
75889
|
}
|
|
75946
75890
|
|
|
75947
75891
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/comments.js
|
|
75948
|
-
var
|
|
75892
|
+
var import_graphql39 = require("graphql");
|
|
75949
75893
|
var MAX_LINE_LENGTH2 = 80;
|
|
75950
75894
|
var commentsRegistry2 = {};
|
|
75951
75895
|
function resetComments2() {
|
|
@@ -76190,7 +76134,7 @@ var printDocASTReducerWithComments2 = Object.keys(printDocASTReducer2).reduce((p
|
|
|
76190
76134
|
}
|
|
76191
76135
|
}), {});
|
|
76192
76136
|
function printWithComments2(ast) {
|
|
76193
|
-
return (0,
|
|
76137
|
+
return (0, import_graphql39.visit)(ast, printDocASTReducerWithComments2);
|
|
76194
76138
|
}
|
|
76195
76139
|
function isFieldDefinitionNode2(node) {
|
|
76196
76140
|
return node.kind === "FieldDefinition";
|
|
@@ -76209,7 +76153,7 @@ function getLeadingCommentBlock2(node) {
|
|
|
76209
76153
|
}
|
|
76210
76154
|
const comments = [];
|
|
76211
76155
|
let token = loc.startToken.prev;
|
|
76212
|
-
while (token != null && token.kind ===
|
|
76156
|
+
while (token != null && token.kind === import_graphql39.TokenKind.COMMENT && token.next != null && token.prev != null && token.line + 1 === token.next.line && token.line !== token.prev.line) {
|
|
76213
76157
|
const value = String(token.value);
|
|
76214
76158
|
comments.push(value);
|
|
76215
76159
|
token = token.prev;
|
|
@@ -76261,9 +76205,9 @@ function isBlank2(str) {
|
|
|
76261
76205
|
}
|
|
76262
76206
|
|
|
76263
76207
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/isDocumentNode.js
|
|
76264
|
-
var
|
|
76208
|
+
var import_graphql40 = require("graphql");
|
|
76265
76209
|
function isDocumentNode2(object) {
|
|
76266
|
-
return object && typeof object === "object" && "kind" in object && object.kind ===
|
|
76210
|
+
return object && typeof object === "object" && "kind" in object && object.kind === import_graphql40.Kind.DOCUMENT;
|
|
76267
76211
|
}
|
|
76268
76212
|
|
|
76269
76213
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js
|
|
@@ -76287,7 +76231,7 @@ function deduplicateArguments2(args, config2) {
|
|
|
76287
76231
|
}
|
|
76288
76232
|
|
|
76289
76233
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js
|
|
76290
|
-
var
|
|
76234
|
+
var import_graphql41 = require("graphql");
|
|
76291
76235
|
function directiveAlreadyExists2(directivesArr, otherDirective) {
|
|
76292
76236
|
return !!directivesArr.find((directive) => directive.name.value === otherDirective.name.value);
|
|
76293
76237
|
}
|
|
@@ -76347,11 +76291,11 @@ function mergeDirectives2(d1 = [], d2 = [], config2, directives) {
|
|
|
76347
76291
|
return result;
|
|
76348
76292
|
}
|
|
76349
76293
|
function validateInputs2(node, existingNode) {
|
|
76350
|
-
const printedNode = (0,
|
|
76294
|
+
const printedNode = (0, import_graphql41.print)({
|
|
76351
76295
|
...node,
|
|
76352
76296
|
description: void 0
|
|
76353
76297
|
});
|
|
76354
|
-
const printedExistingNode = (0,
|
|
76298
|
+
const printedExistingNode = (0, import_graphql41.print)({
|
|
76355
76299
|
...existingNode,
|
|
76356
76300
|
description: void 0
|
|
76357
76301
|
});
|
|
@@ -76418,7 +76362,7 @@ function mergeEnumValues2(first, second, config2, directives) {
|
|
|
76418
76362
|
}
|
|
76419
76363
|
|
|
76420
76364
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js
|
|
76421
|
-
var
|
|
76365
|
+
var import_graphql42 = require("graphql");
|
|
76422
76366
|
function mergeEnum2(e1, e2, config2, directives) {
|
|
76423
76367
|
if (e2) {
|
|
76424
76368
|
return {
|
|
@@ -76432,33 +76376,33 @@ function mergeEnum2(e1, e2, config2, directives) {
|
|
|
76432
76376
|
}
|
|
76433
76377
|
return config2?.convertExtensions ? {
|
|
76434
76378
|
...e1,
|
|
76435
|
-
kind:
|
|
76379
|
+
kind: import_graphql42.Kind.ENUM_TYPE_DEFINITION
|
|
76436
76380
|
} : e1;
|
|
76437
76381
|
}
|
|
76438
76382
|
|
|
76439
76383
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
76440
|
-
var
|
|
76384
|
+
var import_graphql43 = require("graphql");
|
|
76441
76385
|
function isStringTypes2(types17) {
|
|
76442
76386
|
return typeof types17 === "string";
|
|
76443
76387
|
}
|
|
76444
76388
|
function isSourceTypes2(types17) {
|
|
76445
|
-
return types17 instanceof
|
|
76389
|
+
return types17 instanceof import_graphql43.Source;
|
|
76446
76390
|
}
|
|
76447
76391
|
function extractType2(type) {
|
|
76448
76392
|
let visitedType = type;
|
|
76449
|
-
while (visitedType.kind ===
|
|
76393
|
+
while (visitedType.kind === import_graphql43.Kind.LIST_TYPE || visitedType.kind === "NonNullType") {
|
|
76450
76394
|
visitedType = visitedType.type;
|
|
76451
76395
|
}
|
|
76452
76396
|
return visitedType;
|
|
76453
76397
|
}
|
|
76454
76398
|
function isWrappingTypeNode2(type) {
|
|
76455
|
-
return type.kind !==
|
|
76399
|
+
return type.kind !== import_graphql43.Kind.NAMED_TYPE;
|
|
76456
76400
|
}
|
|
76457
76401
|
function isListTypeNode2(type) {
|
|
76458
|
-
return type.kind ===
|
|
76402
|
+
return type.kind === import_graphql43.Kind.LIST_TYPE;
|
|
76459
76403
|
}
|
|
76460
76404
|
function isNonNullTypeNode2(type) {
|
|
76461
|
-
return type.kind ===
|
|
76405
|
+
return type.kind === import_graphql43.Kind.NON_NULL_TYPE;
|
|
76462
76406
|
}
|
|
76463
76407
|
function printTypeNode2(type) {
|
|
76464
76408
|
if (isListTypeNode2(type)) {
|
|
@@ -76561,7 +76505,7 @@ function safeChangeForFieldType2(oldType, newType, ignoreNullability = false) {
|
|
|
76561
76505
|
}
|
|
76562
76506
|
|
|
76563
76507
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js
|
|
76564
|
-
var
|
|
76508
|
+
var import_graphql44 = require("graphql");
|
|
76565
76509
|
function mergeInputType2(node, existingNode, config2, directives) {
|
|
76566
76510
|
if (existingNode) {
|
|
76567
76511
|
try {
|
|
@@ -76579,12 +76523,12 @@ function mergeInputType2(node, existingNode, config2, directives) {
|
|
|
76579
76523
|
}
|
|
76580
76524
|
return config2?.convertExtensions ? {
|
|
76581
76525
|
...node,
|
|
76582
|
-
kind:
|
|
76526
|
+
kind: import_graphql44.Kind.INPUT_OBJECT_TYPE_DEFINITION
|
|
76583
76527
|
} : node;
|
|
76584
76528
|
}
|
|
76585
76529
|
|
|
76586
76530
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js
|
|
76587
|
-
var
|
|
76531
|
+
var import_graphql45 = require("graphql");
|
|
76588
76532
|
|
|
76589
76533
|
// ../../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
|
|
76590
76534
|
function alreadyExists2(arr, other) {
|
|
@@ -76617,15 +76561,15 @@ function mergeInterface2(node, existingNode, config2, directives) {
|
|
|
76617
76561
|
}
|
|
76618
76562
|
return config2?.convertExtensions ? {
|
|
76619
76563
|
...node,
|
|
76620
|
-
kind:
|
|
76564
|
+
kind: import_graphql45.Kind.INTERFACE_TYPE_DEFINITION
|
|
76621
76565
|
} : node;
|
|
76622
76566
|
}
|
|
76623
76567
|
|
|
76624
76568
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js
|
|
76625
|
-
var
|
|
76569
|
+
var import_graphql50 = require("graphql");
|
|
76626
76570
|
|
|
76627
76571
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js
|
|
76628
|
-
var
|
|
76572
|
+
var import_graphql46 = require("graphql");
|
|
76629
76573
|
function mergeType2(node, existingNode, config2, directives) {
|
|
76630
76574
|
if (existingNode) {
|
|
76631
76575
|
try {
|
|
@@ -76644,12 +76588,12 @@ function mergeType2(node, existingNode, config2, directives) {
|
|
|
76644
76588
|
}
|
|
76645
76589
|
return config2?.convertExtensions ? {
|
|
76646
76590
|
...node,
|
|
76647
|
-
kind:
|
|
76591
|
+
kind: import_graphql46.Kind.OBJECT_TYPE_DEFINITION
|
|
76648
76592
|
} : node;
|
|
76649
76593
|
}
|
|
76650
76594
|
|
|
76651
76595
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js
|
|
76652
|
-
var
|
|
76596
|
+
var import_graphql47 = require("graphql");
|
|
76653
76597
|
function mergeScalar2(node, existingNode, config2, directives) {
|
|
76654
76598
|
if (existingNode) {
|
|
76655
76599
|
return {
|
|
@@ -76662,31 +76606,31 @@ function mergeScalar2(node, existingNode, config2, directives) {
|
|
|
76662
76606
|
}
|
|
76663
76607
|
return config2?.convertExtensions ? {
|
|
76664
76608
|
...node,
|
|
76665
|
-
kind:
|
|
76609
|
+
kind: import_graphql47.Kind.SCALAR_TYPE_DEFINITION
|
|
76666
76610
|
} : node;
|
|
76667
76611
|
}
|
|
76668
76612
|
|
|
76669
76613
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js
|
|
76670
|
-
var
|
|
76614
|
+
var import_graphql48 = require("graphql");
|
|
76671
76615
|
function mergeUnion2(first, second, config2, directives) {
|
|
76672
76616
|
if (second) {
|
|
76673
76617
|
return {
|
|
76674
76618
|
name: first.name,
|
|
76675
76619
|
description: first["description"] || second["description"],
|
|
76676
76620
|
directives: mergeDirectives2(first.directives, second.directives, config2, directives),
|
|
76677
|
-
kind: config2?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ?
|
|
76621
|
+
kind: config2?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql48.Kind.UNION_TYPE_DEFINITION : import_graphql48.Kind.UNION_TYPE_EXTENSION,
|
|
76678
76622
|
loc: first.loc,
|
|
76679
76623
|
types: mergeNamedTypeArray2(first.types, second.types, config2)
|
|
76680
76624
|
};
|
|
76681
76625
|
}
|
|
76682
76626
|
return config2?.convertExtensions ? {
|
|
76683
76627
|
...first,
|
|
76684
|
-
kind:
|
|
76628
|
+
kind: import_graphql48.Kind.UNION_TYPE_DEFINITION
|
|
76685
76629
|
} : first;
|
|
76686
76630
|
}
|
|
76687
76631
|
|
|
76688
76632
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js
|
|
76689
|
-
var
|
|
76633
|
+
var import_graphql49 = require("graphql");
|
|
76690
76634
|
var DEFAULT_OPERATION_TYPE_NAME_MAP2 = {
|
|
76691
76635
|
query: "Query",
|
|
76692
76636
|
mutation: "Mutation",
|
|
@@ -76705,7 +76649,7 @@ function mergeOperationTypes2(opNodeList = [], existingOpNodeList = []) {
|
|
|
76705
76649
|
function mergeSchemaDefs2(node, existingNode, config2, directives) {
|
|
76706
76650
|
if (existingNode) {
|
|
76707
76651
|
return {
|
|
76708
|
-
kind: node.kind ===
|
|
76652
|
+
kind: node.kind === import_graphql49.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql49.Kind.SCHEMA_DEFINITION ? import_graphql49.Kind.SCHEMA_DEFINITION : import_graphql49.Kind.SCHEMA_EXTENSION,
|
|
76709
76653
|
description: node["description"] || existingNode["description"],
|
|
76710
76654
|
directives: mergeDirectives2(node.directives, existingNode.directives, config2, directives),
|
|
76711
76655
|
operationTypes: mergeOperationTypes2(node.operationTypes, existingNode.operationTypes)
|
|
@@ -76713,7 +76657,7 @@ function mergeSchemaDefs2(node, existingNode, config2, directives) {
|
|
|
76713
76657
|
}
|
|
76714
76658
|
return config2?.convertExtensions ? {
|
|
76715
76659
|
...node,
|
|
76716
|
-
kind:
|
|
76660
|
+
kind: import_graphql49.Kind.SCHEMA_DEFINITION
|
|
76717
76661
|
} : node;
|
|
76718
76662
|
}
|
|
76719
76663
|
|
|
@@ -76737,36 +76681,36 @@ function mergeGraphQLNodes2(nodes, config2, directives = {}) {
|
|
|
76737
76681
|
delete mergedResultMap[name];
|
|
76738
76682
|
} else {
|
|
76739
76683
|
switch (nodeDefinition.kind) {
|
|
76740
|
-
case
|
|
76741
|
-
case
|
|
76684
|
+
case import_graphql50.Kind.OBJECT_TYPE_DEFINITION:
|
|
76685
|
+
case import_graphql50.Kind.OBJECT_TYPE_EXTENSION:
|
|
76742
76686
|
mergedResultMap[name] = mergeType2(nodeDefinition, mergedResultMap[name], config2, directives);
|
|
76743
76687
|
break;
|
|
76744
|
-
case
|
|
76745
|
-
case
|
|
76688
|
+
case import_graphql50.Kind.ENUM_TYPE_DEFINITION:
|
|
76689
|
+
case import_graphql50.Kind.ENUM_TYPE_EXTENSION:
|
|
76746
76690
|
mergedResultMap[name] = mergeEnum2(nodeDefinition, mergedResultMap[name], config2, directives);
|
|
76747
76691
|
break;
|
|
76748
|
-
case
|
|
76749
|
-
case
|
|
76692
|
+
case import_graphql50.Kind.UNION_TYPE_DEFINITION:
|
|
76693
|
+
case import_graphql50.Kind.UNION_TYPE_EXTENSION:
|
|
76750
76694
|
mergedResultMap[name] = mergeUnion2(nodeDefinition, mergedResultMap[name], config2, directives);
|
|
76751
76695
|
break;
|
|
76752
|
-
case
|
|
76753
|
-
case
|
|
76696
|
+
case import_graphql50.Kind.SCALAR_TYPE_DEFINITION:
|
|
76697
|
+
case import_graphql50.Kind.SCALAR_TYPE_EXTENSION:
|
|
76754
76698
|
mergedResultMap[name] = mergeScalar2(nodeDefinition, mergedResultMap[name], config2, directives);
|
|
76755
76699
|
break;
|
|
76756
|
-
case
|
|
76757
|
-
case
|
|
76700
|
+
case import_graphql50.Kind.INPUT_OBJECT_TYPE_DEFINITION:
|
|
76701
|
+
case import_graphql50.Kind.INPUT_OBJECT_TYPE_EXTENSION:
|
|
76758
76702
|
mergedResultMap[name] = mergeInputType2(nodeDefinition, mergedResultMap[name], config2, directives);
|
|
76759
76703
|
break;
|
|
76760
|
-
case
|
|
76761
|
-
case
|
|
76704
|
+
case import_graphql50.Kind.INTERFACE_TYPE_DEFINITION:
|
|
76705
|
+
case import_graphql50.Kind.INTERFACE_TYPE_EXTENSION:
|
|
76762
76706
|
mergedResultMap[name] = mergeInterface2(nodeDefinition, mergedResultMap[name], config2, directives);
|
|
76763
76707
|
break;
|
|
76764
|
-
case
|
|
76708
|
+
case import_graphql50.Kind.DIRECTIVE_DEFINITION:
|
|
76765
76709
|
mergedResultMap[name] = mergeDirective2(nodeDefinition, mergedResultMap[name]);
|
|
76766
76710
|
break;
|
|
76767
76711
|
}
|
|
76768
76712
|
}
|
|
76769
|
-
} else if (nodeDefinition.kind ===
|
|
76713
|
+
} else if (nodeDefinition.kind === import_graphql50.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql50.Kind.SCHEMA_EXTENSION) {
|
|
76770
76714
|
mergedResultMap[schemaDefSymbol2] = mergeSchemaDefs2(nodeDefinition, mergedResultMap[schemaDefSymbol2], config2);
|
|
76771
76715
|
}
|
|
76772
76716
|
}
|
|
@@ -76774,11 +76718,11 @@ function mergeGraphQLNodes2(nodes, config2, directives = {}) {
|
|
|
76774
76718
|
}
|
|
76775
76719
|
|
|
76776
76720
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js
|
|
76777
|
-
var
|
|
76721
|
+
var import_graphql51 = require("graphql");
|
|
76778
76722
|
function mergeTypeDefs2(typeSource, config2) {
|
|
76779
76723
|
resetComments2();
|
|
76780
76724
|
const doc = {
|
|
76781
|
-
kind:
|
|
76725
|
+
kind: import_graphql51.Kind.DOCUMENT,
|
|
76782
76726
|
definitions: mergeGraphQLTypes2(typeSource, {
|
|
76783
76727
|
useSchemaDefinition: true,
|
|
76784
76728
|
forceSchemaDefinition: false,
|
|
@@ -76805,14 +76749,14 @@ function visitTypeSources2(typeSource, options, allDirectives = [], allNodes = [
|
|
|
76805
76749
|
for (const type of typeSource) {
|
|
76806
76750
|
visitTypeSources2(type, options, allDirectives, allNodes, visitedTypeSources);
|
|
76807
76751
|
}
|
|
76808
|
-
} else if ((0,
|
|
76752
|
+
} else if ((0, import_graphql51.isSchema)(typeSource)) {
|
|
76809
76753
|
const documentNode = getDocumentNodeFromSchema2(typeSource, options);
|
|
76810
76754
|
visitTypeSources2(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
|
|
76811
76755
|
} else if (isStringTypes2(typeSource) || isSourceTypes2(typeSource)) {
|
|
76812
|
-
const documentNode = (0,
|
|
76756
|
+
const documentNode = (0, import_graphql51.parse)(typeSource, options);
|
|
76813
76757
|
visitTypeSources2(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
|
|
76814
|
-
} else if (typeof typeSource === "object" && (0,
|
|
76815
|
-
if (typeSource.kind ===
|
|
76758
|
+
} else if (typeof typeSource === "object" && (0, import_graphql51.isDefinitionNode)(typeSource)) {
|
|
76759
|
+
if (typeSource.kind === import_graphql51.Kind.DIRECTIVE_DEFINITION) {
|
|
76816
76760
|
allDirectives.push(typeSource);
|
|
76817
76761
|
} else {
|
|
76818
76762
|
allNodes.push(typeSource);
|
|
@@ -76832,7 +76776,7 @@ function mergeGraphQLTypes2(typeSource, config2) {
|
|
|
76832
76776
|
const mergedNodes = mergeGraphQLNodes2(allNodes, config2, mergedDirectives);
|
|
76833
76777
|
if (config2?.useSchemaDefinition) {
|
|
76834
76778
|
const schemaDef = mergedNodes[schemaDefSymbol2] || {
|
|
76835
|
-
kind:
|
|
76779
|
+
kind: import_graphql51.Kind.SCHEMA_DEFINITION,
|
|
76836
76780
|
operationTypes: []
|
|
76837
76781
|
};
|
|
76838
76782
|
const operationTypes = schemaDef.operationTypes;
|
|
@@ -76843,9 +76787,9 @@ function mergeGraphQLTypes2(typeSource, config2) {
|
|
|
76843
76787
|
const existingPossibleRootType = mergedNodes[possibleRootTypeName];
|
|
76844
76788
|
if (existingPossibleRootType != null && existingPossibleRootType.name != null) {
|
|
76845
76789
|
operationTypes.push({
|
|
76846
|
-
kind:
|
|
76790
|
+
kind: import_graphql51.Kind.OPERATION_TYPE_DEFINITION,
|
|
76847
76791
|
type: {
|
|
76848
|
-
kind:
|
|
76792
|
+
kind: import_graphql51.Kind.NAMED_TYPE,
|
|
76849
76793
|
name: existingPossibleRootType.name
|
|
76850
76794
|
},
|
|
76851
76795
|
operation: opTypeDefNodeType
|
|
@@ -76859,15 +76803,15 @@ function mergeGraphQLTypes2(typeSource, config2) {
|
|
|
76859
76803
|
}
|
|
76860
76804
|
if (config2?.forceSchemaDefinition && !mergedNodes[schemaDefSymbol2]?.operationTypes?.length) {
|
|
76861
76805
|
mergedNodes[schemaDefSymbol2] = {
|
|
76862
|
-
kind:
|
|
76806
|
+
kind: import_graphql51.Kind.SCHEMA_DEFINITION,
|
|
76863
76807
|
operationTypes: [
|
|
76864
76808
|
{
|
|
76865
|
-
kind:
|
|
76809
|
+
kind: import_graphql51.Kind.OPERATION_TYPE_DEFINITION,
|
|
76866
76810
|
operation: "query",
|
|
76867
76811
|
type: {
|
|
76868
|
-
kind:
|
|
76812
|
+
kind: import_graphql51.Kind.NAMED_TYPE,
|
|
76869
76813
|
name: {
|
|
76870
|
-
kind:
|
|
76814
|
+
kind: import_graphql51.Kind.NAME,
|
|
76871
76815
|
value: "Query"
|
|
76872
76816
|
}
|
|
76873
76817
|
}
|
|
@@ -76884,7 +76828,7 @@ function mergeGraphQLTypes2(typeSource, config2) {
|
|
|
76884
76828
|
}
|
|
76885
76829
|
|
|
76886
76830
|
// src/codegen/transforms/schema.ts
|
|
76887
|
-
var
|
|
76831
|
+
var graphql24 = __toESM(require("graphql"), 1);
|
|
76888
76832
|
async function graphqlExtensions(config2, documents) {
|
|
76889
76833
|
let internalSchema = `
|
|
76890
76834
|
enum CachePolicy {
|
|
@@ -76988,7 +76932,7 @@ ${config2.configFile.features?.componentFields ? `
|
|
|
76988
76932
|
"""
|
|
76989
76933
|
@${config2.componentFieldDirective} marks an inline fragment as the selection for a component field
|
|
76990
76934
|
"""
|
|
76991
|
-
directive @${config2.componentFieldDirective}(field: String!, prop: String, export: String, raw: String) on FRAGMENT_DEFINITION | INLINE_FRAGMENT
|
|
76935
|
+
directive @${config2.componentFieldDirective}(field: String!, prop: String, export: String, raw: String) on FRAGMENT_DEFINITION | INLINE_FRAGMENT | FIELD_DEFINITION
|
|
76992
76936
|
|
|
76993
76937
|
` : ""}
|
|
76994
76938
|
|
|
@@ -76999,7 +76943,7 @@ directive @${config2.componentFieldDirective}(field: String!, prop: String, expo
|
|
|
76999
76943
|
}
|
|
77000
76944
|
internalSchema += plugin2.schema({ config: config2 });
|
|
77001
76945
|
}
|
|
77002
|
-
|
|
76946
|
+
let extensions = Object.entries(config2.componentFields).map(([parent2, fields]) => {
|
|
77003
76947
|
return `
|
|
77004
76948
|
extend type ${parent2} {
|
|
77005
76949
|
${Object.entries(fields).map(([fieldName, field]) => {
|
|
@@ -77007,29 +76951,30 @@ directive @${config2.componentFieldDirective}(field: String!, prop: String, expo
|
|
|
77007
76951
|
const args = fragmentArguments(config2, "", field.parent);
|
|
77008
76952
|
if (args.length > 0) {
|
|
77009
76953
|
argString = "(" + args.map((arg) => {
|
|
77010
|
-
const typeName =
|
|
76954
|
+
const typeName = graphql24.print(arg.type);
|
|
77011
76955
|
return `${arg.name}:${typeName}${arg.required ? "!" : ""}`;
|
|
77012
76956
|
}).join("\n") + ")";
|
|
77013
76957
|
}
|
|
77014
|
-
return `${fieldName}${argString}: ${config2.componentScalar}
|
|
76958
|
+
return `${fieldName}${argString}: ${config2.componentScalar}! @componentField(field: "${fieldName}")`;
|
|
77015
76959
|
}).join("\n")}
|
|
77016
76960
|
}
|
|
77017
76961
|
`;
|
|
77018
76962
|
}).join("\n");
|
|
77019
|
-
config2.
|
|
76963
|
+
extensions += `${Object.keys(config2.configFile.features?.runtimeScalars ?? {}).map((scalar) => `scalar ${scalar}`).join("\n")}`;
|
|
76964
|
+
config2.newSchema = graphql24.print(mergeTypeDefs2([internalSchema, config2.newSchema]));
|
|
77020
76965
|
config2.schemaString += extensions;
|
|
77021
|
-
config2.schema =
|
|
77022
|
-
|
|
77023
|
-
mergeTypeDefs2([
|
|
76966
|
+
config2.schema = graphql24.buildSchema(
|
|
76967
|
+
graphql24.print(
|
|
76968
|
+
mergeTypeDefs2([graphql24.printSchema(config2.schema), internalSchema, extensions])
|
|
77024
76969
|
)
|
|
77025
76970
|
);
|
|
77026
76971
|
}
|
|
77027
76972
|
|
|
77028
76973
|
// src/codegen/transforms/typename.ts
|
|
77029
|
-
var
|
|
76974
|
+
var graphql25 = __toESM(require("graphql"), 1);
|
|
77030
76975
|
async function addTypename(config2, documents) {
|
|
77031
76976
|
for (const doc of documents) {
|
|
77032
|
-
doc.document =
|
|
76977
|
+
doc.document = graphql25.visit(doc.document, {
|
|
77033
76978
|
Field(node, key, parent2, path3, ancestors) {
|
|
77034
76979
|
if (!node.selectionSet) {
|
|
77035
76980
|
return;
|
|
@@ -77041,7 +76986,7 @@ async function addTypename(config2, documents) {
|
|
|
77041
76986
|
);
|
|
77042
76987
|
const field = type.getFields()[node.name.value];
|
|
77043
76988
|
const fieldType = unwrapType(config2, field.type).type;
|
|
77044
|
-
if (
|
|
76989
|
+
if (graphql25.isInterfaceType(fieldType) || graphql25.isUnionType(fieldType)) {
|
|
77045
76990
|
return {
|
|
77046
76991
|
...node,
|
|
77047
76992
|
selectionSet: {
|
|
@@ -77049,9 +76994,9 @@ async function addTypename(config2, documents) {
|
|
|
77049
76994
|
selections: [
|
|
77050
76995
|
...node.selectionSet.selections,
|
|
77051
76996
|
{
|
|
77052
|
-
kind:
|
|
76997
|
+
kind: graphql25.Kind.FIELD,
|
|
77053
76998
|
name: {
|
|
77054
|
-
kind:
|
|
76999
|
+
kind: graphql25.Kind.NAME,
|
|
77055
77000
|
value: "__typename"
|
|
77056
77001
|
}
|
|
77057
77002
|
}
|
|
@@ -77068,9 +77013,9 @@ async function addTypename(config2, documents) {
|
|
|
77068
77013
|
selections: [
|
|
77069
77014
|
...node.selectionSet.selections,
|
|
77070
77015
|
{
|
|
77071
|
-
kind:
|
|
77016
|
+
kind: graphql25.Kind.FIELD,
|
|
77072
77017
|
name: {
|
|
77073
|
-
kind:
|
|
77018
|
+
kind: graphql25.Kind.NAME,
|
|
77074
77019
|
value: "__typename"
|
|
77075
77020
|
}
|
|
77076
77021
|
}
|
|
@@ -77083,10 +77028,10 @@ async function addTypename(config2, documents) {
|
|
|
77083
77028
|
}
|
|
77084
77029
|
|
|
77085
77030
|
// src/codegen/transforms/addID.ts
|
|
77086
|
-
var
|
|
77031
|
+
var graphql26 = __toESM(require("graphql"), 1);
|
|
77087
77032
|
async function addID(config2, documents) {
|
|
77088
77033
|
for (const doc of documents) {
|
|
77089
|
-
doc.document =
|
|
77034
|
+
doc.document = graphql26.visit(doc.document, {
|
|
77090
77035
|
Field(node, key, parent2, path3, ancestors) {
|
|
77091
77036
|
if (!node.selectionSet) {
|
|
77092
77037
|
return;
|
|
@@ -77124,7 +77069,7 @@ function addKeysToSelection(config2, node, fieldType) {
|
|
|
77124
77069
|
if (!node.selectionSet || node.selectionSet.selections.length == 0) {
|
|
77125
77070
|
return;
|
|
77126
77071
|
}
|
|
77127
|
-
if (!
|
|
77072
|
+
if (!graphql26.isObjectType(fieldType) && !graphql26.isInterfaceType(fieldType)) {
|
|
77128
77073
|
return;
|
|
77129
77074
|
}
|
|
77130
77075
|
const keyFields = config2.keyFieldsForType(fieldType.name);
|
|
@@ -77139,9 +77084,9 @@ function addKeysToSelection(config2, node, fieldType) {
|
|
|
77139
77084
|
continue;
|
|
77140
77085
|
}
|
|
77141
77086
|
selections.push({
|
|
77142
|
-
kind:
|
|
77087
|
+
kind: graphql26.Kind.FIELD,
|
|
77143
77088
|
name: {
|
|
77144
|
-
kind:
|
|
77089
|
+
kind: graphql26.Kind.NAME,
|
|
77145
77090
|
value: keyField
|
|
77146
77091
|
}
|
|
77147
77092
|
});
|
|
@@ -77156,13 +77101,13 @@ function addKeysToSelection(config2, node, fieldType) {
|
|
|
77156
77101
|
}
|
|
77157
77102
|
|
|
77158
77103
|
// src/codegen/transforms/componentFields.ts
|
|
77159
|
-
var
|
|
77104
|
+
var graphql27 = __toESM(require("graphql"), 1);
|
|
77160
77105
|
async function componentFields(config2, documents) {
|
|
77161
77106
|
for (const document of documents) {
|
|
77162
|
-
const typeInfo = new
|
|
77163
|
-
document.document =
|
|
77107
|
+
const typeInfo = new graphql27.TypeInfo(config2.schema);
|
|
77108
|
+
document.document = graphql27.visit(
|
|
77164
77109
|
document.document,
|
|
77165
|
-
|
|
77110
|
+
graphql27.visitWithTypeInfo(typeInfo, {
|
|
77166
77111
|
Field(node) {
|
|
77167
77112
|
const parentType = typeInfo.getParentType();
|
|
77168
77113
|
if (!parentType) {
|
|
@@ -77210,6 +77155,48 @@ async function componentFields(config2, documents) {
|
|
|
77210
77155
|
}
|
|
77211
77156
|
}
|
|
77212
77157
|
|
|
77158
|
+
// src/codegen/transforms/runtimeScalars.ts
|
|
77159
|
+
var graphql28 = __toESM(require("graphql"), 1);
|
|
77160
|
+
async function addTypename2(config2, documents) {
|
|
77161
|
+
for (const doc of documents) {
|
|
77162
|
+
doc.document = graphql28.visit(doc.document, {
|
|
77163
|
+
VariableDefinition(node) {
|
|
77164
|
+
const { type, wrappers } = unwrapType(config2, node.type);
|
|
77165
|
+
const runtimeScalar = config2.configFile.features?.runtimeScalars?.[type.name];
|
|
77166
|
+
if (runtimeScalar) {
|
|
77167
|
+
return {
|
|
77168
|
+
...node,
|
|
77169
|
+
type: wrapType({
|
|
77170
|
+
type: config2.schema.getType(runtimeScalar.type),
|
|
77171
|
+
wrappers
|
|
77172
|
+
}),
|
|
77173
|
+
directives: [
|
|
77174
|
+
...node.directives ?? [],
|
|
77175
|
+
{
|
|
77176
|
+
kind: "Directive",
|
|
77177
|
+
name: {
|
|
77178
|
+
kind: "Name",
|
|
77179
|
+
value: config2.runtimeScalarDirective
|
|
77180
|
+
},
|
|
77181
|
+
arguments: [
|
|
77182
|
+
{
|
|
77183
|
+
kind: "Argument",
|
|
77184
|
+
name: { kind: "Name", value: "type" },
|
|
77185
|
+
value: {
|
|
77186
|
+
kind: "StringValue",
|
|
77187
|
+
value: type.name
|
|
77188
|
+
}
|
|
77189
|
+
}
|
|
77190
|
+
]
|
|
77191
|
+
}
|
|
77192
|
+
]
|
|
77193
|
+
};
|
|
77194
|
+
}
|
|
77195
|
+
}
|
|
77196
|
+
});
|
|
77197
|
+
}
|
|
77198
|
+
}
|
|
77199
|
+
|
|
77213
77200
|
// src/codegen/validators/typeCheck.ts
|
|
77214
77201
|
var graphql29 = __toESM(require("graphql"), 1);
|
|
77215
77202
|
async function typeCheck(config2, docs) {
|
|
@@ -78211,10 +78198,22 @@ async function componentFields2(config2, docs) {
|
|
|
78211
78198
|
}
|
|
78212
78199
|
const fieldValue = fieldArg.value?.kind === "StringValue" ? fieldArg.value.value : void 0;
|
|
78213
78200
|
const propValue = propArg.value?.kind === "StringValue" ? propArg.value.value : void 0;
|
|
78201
|
+
const existingField = fieldValue && config2.componentFields[parent2]?.[fieldValue];
|
|
78214
78202
|
const parentType = config2.schema.getType(parent2);
|
|
78215
|
-
|
|
78203
|
+
let conflict = false;
|
|
78204
|
+
if (existingField && existingField.filepath !== filepath) {
|
|
78205
|
+
conflict = true;
|
|
78206
|
+
} else if (parentType && fieldValue) {
|
|
78207
|
+
const fieldDef = graphql31.isObjectType(parentType) && parentType.getFields()[fieldValue];
|
|
78208
|
+
if (fieldDef && !fieldDef.astNode?.directives?.find(
|
|
78209
|
+
(dir) => dir.name.value === config2.componentFieldDirective
|
|
78210
|
+
)) {
|
|
78211
|
+
conflict = true;
|
|
78212
|
+
}
|
|
78213
|
+
}
|
|
78214
|
+
if (conflict) {
|
|
78216
78215
|
errors.push({
|
|
78217
|
-
message: `Duplicate component field definition for ${parent2}.${fieldValue}
|
|
78216
|
+
message: `Duplicate component field definition for ${parent2}.${fieldValue}.` + (existingField ? "The conflicting component field was defined in " + existingField.filepath : ""),
|
|
78218
78217
|
filepath
|
|
78219
78218
|
});
|
|
78220
78219
|
}
|
|
@@ -78284,6 +78283,7 @@ async function runPipeline2(config2, docs) {
|
|
|
78284
78283
|
[
|
|
78285
78284
|
componentFields2,
|
|
78286
78285
|
graphqlExtensions,
|
|
78286
|
+
addTypename2,
|
|
78287
78287
|
...wrapHook(beforeValidate),
|
|
78288
78288
|
typeCheck,
|
|
78289
78289
|
uniqueDocumentNames,
|