houdini 1.2.44 → 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 +651 -844
- package/build/cmd-esm/index.js +501 -694
- package/build/codegen/generators/comments/jsdoc.d.ts +2 -0
- package/build/codegen-cjs/index.js +649 -842
- package/build/codegen-esm/index.js +499 -692
- 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 +667 -464
- package/build/lib-esm/index.js +661 -464
- 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/scalars.d.ts +1 -1
- package/build/runtime/lib/types.d.ts +13 -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 +4 -11
- 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 +13 -2
- 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 +1 -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 +13 -2
- package/build/runtime-esm/router/types.d.ts +3 -1
- package/build/test-cjs/index.js +664 -840
- package/build/test-esm/index.js +514 -690
- package/build/vite-cjs/index.js +761 -852
- package/build/vite-esm/index.js +611 -702
- 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/cmd-esm/index.js
CHANGED
|
@@ -63311,47 +63311,6 @@ function deepMerge(...objects) {
|
|
|
63311
63311
|
return mergedObj;
|
|
63312
63312
|
}
|
|
63313
63313
|
|
|
63314
|
-
// src/runtime/lib/scalars.ts
|
|
63315
|
-
async function marshalSelection({
|
|
63316
|
-
selection,
|
|
63317
|
-
data
|
|
63318
|
-
}) {
|
|
63319
|
-
const config = getCurrentConfig();
|
|
63320
|
-
if (data === null || typeof data === "undefined") {
|
|
63321
|
-
return data;
|
|
63322
|
-
}
|
|
63323
|
-
if (Array.isArray(data)) {
|
|
63324
|
-
return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
|
|
63325
|
-
}
|
|
63326
|
-
const targetSelection = getFieldsForType(selection, data["__typename"], false);
|
|
63327
|
-
return Object.fromEntries(
|
|
63328
|
-
await Promise.all(
|
|
63329
|
-
Object.entries(data).map(async ([fieldName, value]) => {
|
|
63330
|
-
const { type, selection: selection2 } = targetSelection[fieldName];
|
|
63331
|
-
if (!type) {
|
|
63332
|
-
return [fieldName, value];
|
|
63333
|
-
}
|
|
63334
|
-
if (selection2) {
|
|
63335
|
-
return [fieldName, await marshalSelection({ selection: selection2, data: value })];
|
|
63336
|
-
}
|
|
63337
|
-
if (config.scalars?.[type]) {
|
|
63338
|
-
const marshalFn = config.scalars[type].marshal;
|
|
63339
|
-
if (!marshalFn) {
|
|
63340
|
-
throw new Error(
|
|
63341
|
-
`scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
|
|
63342
|
-
);
|
|
63343
|
-
}
|
|
63344
|
-
if (Array.isArray(value)) {
|
|
63345
|
-
return [fieldName, value.map(marshalFn)];
|
|
63346
|
-
}
|
|
63347
|
-
return [fieldName, marshalFn(value)];
|
|
63348
|
-
}
|
|
63349
|
-
return [fieldName, value];
|
|
63350
|
-
})
|
|
63351
|
-
)
|
|
63352
|
-
);
|
|
63353
|
-
}
|
|
63354
|
-
|
|
63355
63314
|
// src/runtime/lib/types.ts
|
|
63356
63315
|
var CachePolicy = {
|
|
63357
63316
|
CacheOrNetwork: "CacheOrNetwork",
|
|
@@ -63379,11 +63338,6 @@ var RefetchUpdateMode = {
|
|
|
63379
63338
|
prepend: "prepend",
|
|
63380
63339
|
replace: "replace"
|
|
63381
63340
|
};
|
|
63382
|
-
var DataSource = {
|
|
63383
|
-
Cache: "cache",
|
|
63384
|
-
Network: "network",
|
|
63385
|
-
Ssr: "ssr"
|
|
63386
|
-
};
|
|
63387
63341
|
var fragmentKey = " $fragments";
|
|
63388
63342
|
var PendingValue = Symbol("houdini_loading");
|
|
63389
63343
|
|
|
@@ -67291,202 +67245,6 @@ var cache_default = new Cache();
|
|
|
67291
67245
|
// src/runtime/client/plugins/cache.ts
|
|
67292
67246
|
var serverSide = typeof globalThis.window === "undefined";
|
|
67293
67247
|
|
|
67294
|
-
// src/runtime/client/utils/documentPlugins.ts
|
|
67295
|
-
var documentPlugin = (kind, source) => {
|
|
67296
|
-
return () => {
|
|
67297
|
-
const sourceHandlers = source();
|
|
67298
|
-
const enterWrapper = (handler) => {
|
|
67299
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
67300
|
-
if (ctx.artifact.kind !== kind) {
|
|
67301
|
-
return handlers.next(ctx);
|
|
67302
|
-
}
|
|
67303
|
-
return handler(ctx, handlers);
|
|
67304
|
-
};
|
|
67305
|
-
};
|
|
67306
|
-
const exitWrapper = (handler) => {
|
|
67307
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
67308
|
-
if (ctx.artifact.kind !== kind) {
|
|
67309
|
-
return handlers.resolve(ctx);
|
|
67310
|
-
}
|
|
67311
|
-
return handler(ctx, handlers);
|
|
67312
|
-
};
|
|
67313
|
-
};
|
|
67314
|
-
return {
|
|
67315
|
-
start: enterWrapper(sourceHandlers.start),
|
|
67316
|
-
network: enterWrapper(sourceHandlers.network),
|
|
67317
|
-
afterNetwork: exitWrapper(sourceHandlers.afterNetwork),
|
|
67318
|
-
end: exitWrapper(sourceHandlers.end),
|
|
67319
|
-
catch: sourceHandlers.catch ? (ctx, handlers) => sourceHandlers.catch(ctx, handlers) : void 0,
|
|
67320
|
-
cleanup: (...args) => sourceHandlers.cleanup?.(...args)
|
|
67321
|
-
};
|
|
67322
|
-
};
|
|
67323
|
-
};
|
|
67324
|
-
|
|
67325
|
-
// src/runtime/client/plugins/query.ts
|
|
67326
|
-
var query = documentPlugin(ArtifactKind.Query, function() {
|
|
67327
|
-
let subscriptionSpec = null;
|
|
67328
|
-
let lastVariables = null;
|
|
67329
|
-
return {
|
|
67330
|
-
start(ctx, { next }) {
|
|
67331
|
-
const runtimeScalarPayload = {
|
|
67332
|
-
session: ctx.session
|
|
67333
|
-
};
|
|
67334
|
-
ctx.variables = {
|
|
67335
|
-
...lastVariables,
|
|
67336
|
-
...Object.fromEntries(
|
|
67337
|
-
Object.entries(ctx.artifact.input?.runtimeScalars ?? {}).map(
|
|
67338
|
-
([field, type]) => {
|
|
67339
|
-
const runtimeScalar = ctx.config.features?.runtimeScalars?.[type];
|
|
67340
|
-
if (!runtimeScalar) {
|
|
67341
|
-
return [field, type];
|
|
67342
|
-
}
|
|
67343
|
-
return [field, runtimeScalar.resolve(runtimeScalarPayload)];
|
|
67344
|
-
}
|
|
67345
|
-
)
|
|
67346
|
-
),
|
|
67347
|
-
...ctx.variables
|
|
67348
|
-
};
|
|
67349
|
-
next(ctx);
|
|
67350
|
-
},
|
|
67351
|
-
end(ctx, { resolve: resolve2, marshalVariables, variablesChanged }) {
|
|
67352
|
-
if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
|
|
67353
|
-
if (subscriptionSpec) {
|
|
67354
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
67355
|
-
}
|
|
67356
|
-
lastVariables = { ...marshalVariables(ctx) };
|
|
67357
|
-
const variables = lastVariables;
|
|
67358
|
-
subscriptionSpec = {
|
|
67359
|
-
rootType: ctx.artifact.rootType,
|
|
67360
|
-
selection: ctx.artifact.selection,
|
|
67361
|
-
variables: () => variables,
|
|
67362
|
-
set: (newValue) => {
|
|
67363
|
-
resolve2(ctx, {
|
|
67364
|
-
data: newValue,
|
|
67365
|
-
errors: null,
|
|
67366
|
-
fetching: false,
|
|
67367
|
-
partial: false,
|
|
67368
|
-
stale: false,
|
|
67369
|
-
source: DataSource.Cache,
|
|
67370
|
-
variables: ctx.variables ?? {}
|
|
67371
|
-
});
|
|
67372
|
-
}
|
|
67373
|
-
};
|
|
67374
|
-
cache_default.subscribe(subscriptionSpec, lastVariables);
|
|
67375
|
-
}
|
|
67376
|
-
resolve2(ctx);
|
|
67377
|
-
},
|
|
67378
|
-
cleanup() {
|
|
67379
|
-
if (subscriptionSpec) {
|
|
67380
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
67381
|
-
lastVariables = null;
|
|
67382
|
-
}
|
|
67383
|
-
}
|
|
67384
|
-
};
|
|
67385
|
-
});
|
|
67386
|
-
|
|
67387
|
-
// src/runtime/client/plugins/fragment.ts
|
|
67388
|
-
var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
67389
|
-
let subscriptionSpec = null;
|
|
67390
|
-
let lastReference = null;
|
|
67391
|
-
return {
|
|
67392
|
-
start(ctx, { next, resolve: resolve2, variablesChanged, marshalVariables }) {
|
|
67393
|
-
if (!ctx.stuff.parentID) {
|
|
67394
|
-
return next(ctx);
|
|
67395
|
-
}
|
|
67396
|
-
const currentReference = {
|
|
67397
|
-
parent: ctx.stuff.parentID,
|
|
67398
|
-
variables: marshalVariables(ctx)
|
|
67399
|
-
};
|
|
67400
|
-
if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged(ctx))) {
|
|
67401
|
-
if (subscriptionSpec) {
|
|
67402
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
67403
|
-
}
|
|
67404
|
-
const variables = marshalVariables(ctx);
|
|
67405
|
-
subscriptionSpec = {
|
|
67406
|
-
rootType: ctx.artifact.rootType,
|
|
67407
|
-
selection: ctx.artifact.selection,
|
|
67408
|
-
variables: () => variables,
|
|
67409
|
-
parentID: ctx.stuff.parentID,
|
|
67410
|
-
set: (newValue) => {
|
|
67411
|
-
resolve2(ctx, {
|
|
67412
|
-
data: newValue,
|
|
67413
|
-
errors: null,
|
|
67414
|
-
fetching: false,
|
|
67415
|
-
partial: false,
|
|
67416
|
-
stale: false,
|
|
67417
|
-
source: DataSource.Cache,
|
|
67418
|
-
variables
|
|
67419
|
-
});
|
|
67420
|
-
}
|
|
67421
|
-
};
|
|
67422
|
-
cache_default.subscribe(subscriptionSpec, variables);
|
|
67423
|
-
lastReference = currentReference;
|
|
67424
|
-
}
|
|
67425
|
-
next(ctx);
|
|
67426
|
-
},
|
|
67427
|
-
cleanup() {
|
|
67428
|
-
if (subscriptionSpec) {
|
|
67429
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
67430
|
-
}
|
|
67431
|
-
}
|
|
67432
|
-
};
|
|
67433
|
-
});
|
|
67434
|
-
|
|
67435
|
-
// src/runtime/client/plugins/mutation.ts
|
|
67436
|
-
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
67437
|
-
return {
|
|
67438
|
-
async start(ctx, { next, marshalVariables }) {
|
|
67439
|
-
const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
|
|
67440
|
-
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
67441
|
-
let toNotify = [];
|
|
67442
|
-
if (optimisticResponse) {
|
|
67443
|
-
toNotify = cache_default.write({
|
|
67444
|
-
selection: ctx.artifact.selection,
|
|
67445
|
-
data: await marshalSelection({
|
|
67446
|
-
selection: ctx.artifact.selection,
|
|
67447
|
-
data: optimisticResponse
|
|
67448
|
-
}),
|
|
67449
|
-
variables: marshalVariables(ctx),
|
|
67450
|
-
layer: layerOptimistic.id
|
|
67451
|
-
});
|
|
67452
|
-
}
|
|
67453
|
-
ctx.cacheParams = {
|
|
67454
|
-
...ctx.cacheParams,
|
|
67455
|
-
layer: layerOptimistic,
|
|
67456
|
-
notifySubscribers: toNotify,
|
|
67457
|
-
forceNotify: true
|
|
67458
|
-
};
|
|
67459
|
-
next(ctx);
|
|
67460
|
-
},
|
|
67461
|
-
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
67462
|
-
if (ctx.cacheParams?.layer) {
|
|
67463
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
67464
|
-
}
|
|
67465
|
-
resolve2(ctx);
|
|
67466
|
-
},
|
|
67467
|
-
end(ctx, { resolve: resolve2, value }) {
|
|
67468
|
-
const hasErrors = value.errors && value.errors.length > 0;
|
|
67469
|
-
if (hasErrors) {
|
|
67470
|
-
if (ctx.cacheParams?.layer) {
|
|
67471
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
67472
|
-
}
|
|
67473
|
-
}
|
|
67474
|
-
if (ctx.cacheParams?.layer) {
|
|
67475
|
-
cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
67476
|
-
}
|
|
67477
|
-
resolve2(ctx);
|
|
67478
|
-
},
|
|
67479
|
-
catch(ctx, { error }) {
|
|
67480
|
-
if (ctx.cacheParams?.layer) {
|
|
67481
|
-
const { layer } = ctx.cacheParams;
|
|
67482
|
-
cache_default.clearLayer(layer.id);
|
|
67483
|
-
cache_default._internal_unstable.storage.resolveLayer(layer.id);
|
|
67484
|
-
}
|
|
67485
|
-
throw error;
|
|
67486
|
-
}
|
|
67487
|
-
};
|
|
67488
|
-
});
|
|
67489
|
-
|
|
67490
67248
|
// src/lib/types.ts
|
|
67491
67249
|
var LogLevel = {
|
|
67492
67250
|
Full: "full",
|
|
@@ -68499,7 +68257,7 @@ function formatErrors(e3, afterError) {
|
|
|
68499
68257
|
afterError?.(e3);
|
|
68500
68258
|
}
|
|
68501
68259
|
}
|
|
68502
|
-
function unwrapType(config, type, wrappers = []) {
|
|
68260
|
+
function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
|
|
68503
68261
|
if (type.kind === "NonNullType") {
|
|
68504
68262
|
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
68505
68263
|
}
|
|
@@ -68515,6 +68273,11 @@ function unwrapType(config, type, wrappers = []) {
|
|
|
68515
68273
|
if (type instanceof graphql3.GraphQLList) {
|
|
68516
68274
|
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
68517
68275
|
}
|
|
68276
|
+
if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
68277
|
+
type = config.schema.getType(
|
|
68278
|
+
config.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
68279
|
+
);
|
|
68280
|
+
}
|
|
68518
68281
|
const namedType = config.schema.getType(type.name.value || type.name);
|
|
68519
68282
|
if (!namedType) {
|
|
68520
68283
|
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
@@ -68709,6 +68472,152 @@ async function detectTools(cwd = process.cwd()) {
|
|
|
68709
68472
|
};
|
|
68710
68473
|
}
|
|
68711
68474
|
|
|
68475
|
+
// src/lib/typescript.ts
|
|
68476
|
+
var recast2 = __toESM(require_main2(), 1);
|
|
68477
|
+
import * as graphql4 from "graphql";
|
|
68478
|
+
var AST2 = recast2.types.builders;
|
|
68479
|
+
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
68480
|
+
type,
|
|
68481
|
+
wrappers
|
|
68482
|
+
}, body) {
|
|
68483
|
+
let result;
|
|
68484
|
+
if (graphql4.isScalarType(type)) {
|
|
68485
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
68486
|
+
} else if (graphql4.isEnumType(type)) {
|
|
68487
|
+
result = enumReference(config, body, type.name);
|
|
68488
|
+
} else {
|
|
68489
|
+
result = AST2.tsTypeReference(AST2.identifier(type.name));
|
|
68490
|
+
}
|
|
68491
|
+
for (const toWrap of wrappers) {
|
|
68492
|
+
if (toWrap === "NonNull" /* NonNull */) {
|
|
68493
|
+
continue;
|
|
68494
|
+
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
68495
|
+
result = nullableField(result, true);
|
|
68496
|
+
} else if (toWrap === "List" /* List */) {
|
|
68497
|
+
result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
|
|
68498
|
+
}
|
|
68499
|
+
}
|
|
68500
|
+
return result;
|
|
68501
|
+
}
|
|
68502
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
68503
|
+
const { type, wrappers } = unwrapType(config, definition.type);
|
|
68504
|
+
return unwrappedTsTypeReference(
|
|
68505
|
+
config,
|
|
68506
|
+
filepath,
|
|
68507
|
+
missingScalars,
|
|
68508
|
+
{ type, wrappers },
|
|
68509
|
+
body
|
|
68510
|
+
);
|
|
68511
|
+
}
|
|
68512
|
+
function enumReference(config, body, name) {
|
|
68513
|
+
ensureImports({
|
|
68514
|
+
config,
|
|
68515
|
+
body,
|
|
68516
|
+
import: ["ValueOf"],
|
|
68517
|
+
importKind: "type",
|
|
68518
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
68519
|
+
});
|
|
68520
|
+
return AST2.tsTypeReference(
|
|
68521
|
+
AST2.identifier("ValueOf"),
|
|
68522
|
+
AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
|
|
68523
|
+
);
|
|
68524
|
+
}
|
|
68525
|
+
function readonlyProperty(prop, enable = true) {
|
|
68526
|
+
if (enable) {
|
|
68527
|
+
prop.readonly = true;
|
|
68528
|
+
}
|
|
68529
|
+
return prop;
|
|
68530
|
+
}
|
|
68531
|
+
function nullableField(inner, input = false) {
|
|
68532
|
+
const members = [inner, AST2.tsNullKeyword()];
|
|
68533
|
+
if (input) {
|
|
68534
|
+
members.push(AST2.tsUndefinedKeyword());
|
|
68535
|
+
}
|
|
68536
|
+
return AST2.tsUnionType(members);
|
|
68537
|
+
}
|
|
68538
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
68539
|
+
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
68540
|
+
if (!field) {
|
|
68541
|
+
return AST2.tsNeverKeyword();
|
|
68542
|
+
}
|
|
68543
|
+
const component = config.componentFields[field.parent][field.field];
|
|
68544
|
+
const sourcePathRelative = path_exports.relative(
|
|
68545
|
+
path_exports.join(config.projectRoot, "src"),
|
|
68546
|
+
component.filepath
|
|
68547
|
+
);
|
|
68548
|
+
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
68549
|
+
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
68550
|
+
const localImport = ensureImports({
|
|
68551
|
+
config,
|
|
68552
|
+
body,
|
|
68553
|
+
import: "__component__" + component.fragment,
|
|
68554
|
+
sourceModule: path_exports.join(
|
|
68555
|
+
path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
|
|
68556
|
+
"src",
|
|
68557
|
+
sourcePath
|
|
68558
|
+
)
|
|
68559
|
+
}) ?? "__component__" + component.fragment;
|
|
68560
|
+
const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
|
|
68561
|
+
parameters.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68562
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
68563
|
+
]);
|
|
68564
|
+
const indexed = AST2.tsIndexedAccessType(
|
|
68565
|
+
parameters,
|
|
68566
|
+
AST2.tsLiteralType(AST2.numericLiteral(0))
|
|
68567
|
+
);
|
|
68568
|
+
const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
|
|
68569
|
+
omit.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68570
|
+
indexed,
|
|
68571
|
+
AST2.tsLiteralType(AST2.stringLiteral(component.prop))
|
|
68572
|
+
]);
|
|
68573
|
+
const arg = AST2.identifier("props");
|
|
68574
|
+
arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
|
|
68575
|
+
const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
|
|
68576
|
+
returnType.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
68577
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
68578
|
+
]);
|
|
68579
|
+
const fnType = AST2.tsFunctionType([arg]);
|
|
68580
|
+
fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
|
|
68581
|
+
return fnType;
|
|
68582
|
+
}
|
|
68583
|
+
switch (target.name) {
|
|
68584
|
+
case "String": {
|
|
68585
|
+
return AST2.tsStringKeyword();
|
|
68586
|
+
}
|
|
68587
|
+
case "Int": {
|
|
68588
|
+
return AST2.tsNumberKeyword();
|
|
68589
|
+
}
|
|
68590
|
+
case "Float": {
|
|
68591
|
+
return AST2.tsNumberKeyword();
|
|
68592
|
+
}
|
|
68593
|
+
case "Boolean": {
|
|
68594
|
+
return AST2.tsBooleanKeyword();
|
|
68595
|
+
}
|
|
68596
|
+
case "ID": {
|
|
68597
|
+
return AST2.tsStringKeyword();
|
|
68598
|
+
}
|
|
68599
|
+
default: {
|
|
68600
|
+
if (graphql4.isNonNullType(target) && "ofType" in target) {
|
|
68601
|
+
return scalarPropertyValue(
|
|
68602
|
+
config,
|
|
68603
|
+
filepath,
|
|
68604
|
+
missingScalars,
|
|
68605
|
+
target.ofType,
|
|
68606
|
+
body,
|
|
68607
|
+
field
|
|
68608
|
+
);
|
|
68609
|
+
}
|
|
68610
|
+
if (config.scalars?.[target.name]) {
|
|
68611
|
+
return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
|
|
68612
|
+
}
|
|
68613
|
+
if (target.name !== config.componentScalar) {
|
|
68614
|
+
missingScalars.add(target.name);
|
|
68615
|
+
}
|
|
68616
|
+
return AST2.tsAnyKeyword();
|
|
68617
|
+
}
|
|
68618
|
+
}
|
|
68619
|
+
}
|
|
68620
|
+
|
|
68712
68621
|
// ../../node_modules/.pnpm/estree-walker@3.0.1/node_modules/estree-walker/src/walker.js
|
|
68713
68622
|
var WalkerBase = class {
|
|
68714
68623
|
constructor() {
|
|
@@ -68822,7 +68731,7 @@ async function asyncWalk(ast, { enter, leave }) {
|
|
|
68822
68731
|
}
|
|
68823
68732
|
|
|
68824
68733
|
// src/lib/walk.ts
|
|
68825
|
-
import * as
|
|
68734
|
+
import * as graphql5 from "graphql";
|
|
68826
68735
|
async function find_graphql(config, parsedScript, walker) {
|
|
68827
68736
|
await asyncWalk(parsedScript, {
|
|
68828
68737
|
async enter(node, parent2) {
|
|
@@ -68877,7 +68786,7 @@ async function find_graphql(config, parsedScript, walker) {
|
|
|
68877
68786
|
} else if (!documentString) {
|
|
68878
68787
|
return;
|
|
68879
68788
|
}
|
|
68880
|
-
const parsedTag =
|
|
68789
|
+
const parsedTag = graphql5.parse(documentString);
|
|
68881
68790
|
if (walker.where && !walker.where(parsedTag, { node, parent: parent2 })) {
|
|
68882
68791
|
return;
|
|
68883
68792
|
}
|
|
@@ -69009,7 +68918,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
|
|
|
69009
68918
|
};
|
|
69010
68919
|
return defs.concat([
|
|
69011
68920
|
{
|
|
69012
|
-
raw:
|
|
68921
|
+
raw: graphql5.print(parsed),
|
|
69013
68922
|
parsed
|
|
69014
68923
|
}
|
|
69015
68924
|
]);
|
|
@@ -69024,7 +68933,7 @@ function extractAnonymousQuery(config, raw, expr, propName) {
|
|
|
69024
68933
|
|
|
69025
68934
|
// src/lib/router/manifest.ts
|
|
69026
68935
|
var t2 = __toESM(require_lib6(), 1);
|
|
69027
|
-
import * as
|
|
68936
|
+
import * as graphql6 from "graphql";
|
|
69028
68937
|
|
|
69029
68938
|
// src/lib/router/server.ts
|
|
69030
68939
|
import path2 from "node:path";
|
|
@@ -69062,11 +68971,11 @@ async function loadLocalSchema(config) {
|
|
|
69062
68971
|
}
|
|
69063
68972
|
|
|
69064
68973
|
// src/codegen/index.ts
|
|
69065
|
-
import * as
|
|
68974
|
+
import * as graphql32 from "graphql";
|
|
69066
68975
|
|
|
69067
68976
|
// src/codegen/generators/artifacts/index.ts
|
|
69068
|
-
var
|
|
69069
|
-
import * as
|
|
68977
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
68978
|
+
import * as graphql17 from "graphql";
|
|
69070
68979
|
|
|
69071
68980
|
// src/codegen/utils/commonjs.ts
|
|
69072
68981
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -69308,19 +69217,19 @@ var FieldCollection = class {
|
|
|
69308
69217
|
};
|
|
69309
69218
|
|
|
69310
69219
|
// src/codegen/utils/moduleExport.ts
|
|
69311
|
-
var
|
|
69312
|
-
var
|
|
69220
|
+
var recast3 = __toESM(require_main2(), 1);
|
|
69221
|
+
var AST3 = recast3.types.builders;
|
|
69313
69222
|
function moduleExport(config, key, value) {
|
|
69314
69223
|
if (config.module === "commonjs") {
|
|
69315
|
-
let target =
|
|
69224
|
+
let target = AST3.memberExpression(AST3.identifier("module"), AST3.identifier("exports"));
|
|
69316
69225
|
if (key !== "default") {
|
|
69317
|
-
target =
|
|
69226
|
+
target = AST3.memberExpression(target, AST3.identifier(key));
|
|
69318
69227
|
}
|
|
69319
|
-
return
|
|
69228
|
+
return AST3.expressionStatement(AST3.assignmentExpression("=", target, value));
|
|
69320
69229
|
}
|
|
69321
|
-
return key === "default" ?
|
|
69322
|
-
|
|
69323
|
-
|
|
69230
|
+
return key === "default" ? AST3.exportDefaultDeclaration(value) : AST3.exportNamedDeclaration(
|
|
69231
|
+
AST3.variableDeclaration("const", [
|
|
69232
|
+
AST3.variableDeclarator(AST3.identifier(key), value)
|
|
69324
69233
|
])
|
|
69325
69234
|
);
|
|
69326
69235
|
}
|
|
@@ -69577,7 +69486,7 @@ var serialize = (value, { json, lossy } = {}) => {
|
|
|
69577
69486
|
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));
|
|
69578
69487
|
|
|
69579
69488
|
// src/codegen/transforms/fragmentVariables.ts
|
|
69580
|
-
import * as
|
|
69489
|
+
import * as graphql8 from "graphql";
|
|
69581
69490
|
|
|
69582
69491
|
// src/codegen/utils/stripLoc.ts
|
|
69583
69492
|
function stripLoc(value) {
|
|
@@ -69598,7 +69507,7 @@ function stripLoc(value) {
|
|
|
69598
69507
|
}
|
|
69599
69508
|
|
|
69600
69509
|
// src/codegen/transforms/collectDefinitions.ts
|
|
69601
|
-
import * as
|
|
69510
|
+
import * as graphql7 from "graphql";
|
|
69602
69511
|
import { Kind as GraphqlKinds } from "graphql";
|
|
69603
69512
|
async function includeFragmentDefinitions(config, documents) {
|
|
69604
69513
|
const fragments = collectDefinitions(config, documents);
|
|
@@ -69648,10 +69557,10 @@ function collectDefinitions(config, docs) {
|
|
|
69648
69557
|
}
|
|
69649
69558
|
function findRequiredFragments(config, definition) {
|
|
69650
69559
|
const referencedFragments = [];
|
|
69651
|
-
const typeInfo = new
|
|
69652
|
-
definition.selectionSet =
|
|
69560
|
+
const typeInfo = new graphql7.TypeInfo(config.schema);
|
|
69561
|
+
definition.selectionSet = graphql7.visit(
|
|
69653
69562
|
definition,
|
|
69654
|
-
|
|
69563
|
+
graphql7.visitWithTypeInfo(typeInfo, {
|
|
69655
69564
|
FragmentSpread(node) {
|
|
69656
69565
|
referencedFragments.push(node.name.value);
|
|
69657
69566
|
}
|
|
@@ -69685,7 +69594,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
69685
69594
|
}
|
|
69686
69595
|
|
|
69687
69596
|
// src/codegen/transforms/fragmentVariables.ts
|
|
69688
|
-
var GraphqlKinds2 =
|
|
69597
|
+
var GraphqlKinds2 = graphql8.Kind;
|
|
69689
69598
|
async function fragmentVariables(config, documents) {
|
|
69690
69599
|
const fragments = collectDefinitions(config, documents);
|
|
69691
69600
|
const generatedFragments = {};
|
|
@@ -69708,7 +69617,7 @@ async function fragmentVariables(config, documents) {
|
|
|
69708
69617
|
});
|
|
69709
69618
|
}
|
|
69710
69619
|
const doc = {
|
|
69711
|
-
kind:
|
|
69620
|
+
kind: graphql8.Kind.DOCUMENT,
|
|
69712
69621
|
definitions: Object.values(generatedFragments)
|
|
69713
69622
|
};
|
|
69714
69623
|
documents.push({
|
|
@@ -69779,7 +69688,7 @@ function inlineFragmentArgs({
|
|
|
69779
69688
|
return null;
|
|
69780
69689
|
};
|
|
69781
69690
|
const result = esm_default(
|
|
69782
|
-
|
|
69691
|
+
graphql8.visit(document, {
|
|
69783
69692
|
FragmentSpread(node) {
|
|
69784
69693
|
if (!fragmentDefinitions[node.name.value]) {
|
|
69785
69694
|
throw new Error("Could not find definition for fragment" + node.name.value);
|
|
@@ -69865,7 +69774,7 @@ function inlineFragmentArgs({
|
|
|
69865
69774
|
);
|
|
69866
69775
|
if (newName) {
|
|
69867
69776
|
result.name = {
|
|
69868
|
-
kind:
|
|
69777
|
+
kind: graphql8.Kind.NAME,
|
|
69869
69778
|
value: newName
|
|
69870
69779
|
};
|
|
69871
69780
|
}
|
|
@@ -70032,7 +69941,7 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
|
|
|
70032
69941
|
}
|
|
70033
69942
|
|
|
70034
69943
|
// src/codegen/generators/artifacts/inputs.ts
|
|
70035
|
-
import * as
|
|
69944
|
+
import * as graphql9 from "graphql";
|
|
70036
69945
|
function inputObject(config, inputs, runtimeScalars) {
|
|
70037
69946
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
70038
69947
|
const inputObj = {
|
|
@@ -70062,10 +69971,10 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
|
|
|
70062
69971
|
if (visitedTypes.has(type.name)) {
|
|
70063
69972
|
return;
|
|
70064
69973
|
}
|
|
70065
|
-
if (
|
|
69974
|
+
if (graphql9.isEnumType(type) || graphql9.isScalarType(type)) {
|
|
70066
69975
|
return;
|
|
70067
69976
|
}
|
|
70068
|
-
if (
|
|
69977
|
+
if (graphql9.isUnionType(type)) {
|
|
70069
69978
|
return;
|
|
70070
69979
|
}
|
|
70071
69980
|
visitedTypes.add(type.name);
|
|
@@ -70083,50 +69992,50 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
|
|
|
70083
69992
|
}
|
|
70084
69993
|
|
|
70085
69994
|
// src/codegen/generators/artifacts/operations.ts
|
|
70086
|
-
import * as
|
|
69995
|
+
import * as graphql11 from "graphql";
|
|
70087
69996
|
|
|
70088
69997
|
// src/codegen/generators/artifacts/utils.ts
|
|
70089
|
-
var
|
|
70090
|
-
import * as
|
|
70091
|
-
var
|
|
69998
|
+
var recast4 = __toESM(require_main2(), 1);
|
|
69999
|
+
import * as graphql10 from "graphql";
|
|
70000
|
+
var AST4 = recast4.types.builders;
|
|
70092
70001
|
function serializeValue(value) {
|
|
70093
70002
|
if (Array.isArray(value)) {
|
|
70094
|
-
return
|
|
70003
|
+
return AST4.arrayExpression(value.map(serializeValue));
|
|
70095
70004
|
}
|
|
70096
70005
|
if (typeof value === "object" && value !== null) {
|
|
70097
|
-
return
|
|
70006
|
+
return AST4.objectExpression(
|
|
70098
70007
|
Object.entries(value).filter(([key, value2]) => typeof value2 !== "undefined").map(([key, val]) => {
|
|
70099
|
-
return
|
|
70008
|
+
return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
|
|
70100
70009
|
})
|
|
70101
70010
|
);
|
|
70102
70011
|
}
|
|
70103
70012
|
if (typeof value === "string") {
|
|
70104
70013
|
if (value.indexOf("\n") !== -1) {
|
|
70105
|
-
return
|
|
70106
|
-
[
|
|
70014
|
+
return AST4.templateLiteral(
|
|
70015
|
+
[AST4.templateElement({ raw: value, cooked: value }, true)],
|
|
70107
70016
|
[]
|
|
70108
70017
|
);
|
|
70109
70018
|
}
|
|
70110
|
-
return
|
|
70019
|
+
return AST4.stringLiteral(value);
|
|
70111
70020
|
}
|
|
70112
|
-
return
|
|
70021
|
+
return AST4.literal(value);
|
|
70113
70022
|
}
|
|
70114
70023
|
function convertValue(config, val) {
|
|
70115
70024
|
let value;
|
|
70116
70025
|
let kind;
|
|
70117
|
-
if (val.kind ===
|
|
70026
|
+
if (val.kind === graphql10.Kind.INT) {
|
|
70118
70027
|
value = parseInt(val.value, 10);
|
|
70119
70028
|
kind = "Int";
|
|
70120
|
-
} else if (val.kind ===
|
|
70029
|
+
} else if (val.kind === graphql10.Kind.FLOAT) {
|
|
70121
70030
|
value = parseFloat(val.value);
|
|
70122
70031
|
kind = "Float";
|
|
70123
|
-
} else if (val.kind ===
|
|
70032
|
+
} else if (val.kind === graphql10.Kind.BOOLEAN) {
|
|
70124
70033
|
value = val.value;
|
|
70125
70034
|
kind = "Boolean";
|
|
70126
|
-
} else if (val.kind ===
|
|
70035
|
+
} else if (val.kind === graphql10.Kind.VARIABLE) {
|
|
70127
70036
|
value = val.name.value;
|
|
70128
70037
|
kind = "Variable";
|
|
70129
|
-
} else if (val.kind ===
|
|
70038
|
+
} else if (val.kind === graphql10.Kind.STRING) {
|
|
70130
70039
|
value = val.value;
|
|
70131
70040
|
kind = "String";
|
|
70132
70041
|
}
|
|
@@ -70139,7 +70048,7 @@ function operationsByPath(config, filepath, definition, filterTypes) {
|
|
|
70139
70048
|
return {};
|
|
70140
70049
|
}
|
|
70141
70050
|
const pathOperations = {};
|
|
70142
|
-
|
|
70051
|
+
graphql11.visit(definition, {
|
|
70143
70052
|
FragmentSpread(node, _3, __, ___, ancestors) {
|
|
70144
70053
|
if (!config.isListFragment(node.name.value)) {
|
|
70145
70054
|
return;
|
|
@@ -70298,19 +70207,19 @@ function ancestorKey(ancestors) {
|
|
|
70298
70207
|
}
|
|
70299
70208
|
|
|
70300
70209
|
// src/codegen/generators/artifacts/selection.ts
|
|
70301
|
-
import * as
|
|
70210
|
+
import * as graphql16 from "graphql";
|
|
70302
70211
|
|
|
70303
70212
|
// src/codegen/transforms/list.ts
|
|
70304
|
-
import * as
|
|
70213
|
+
import * as graphql14 from "graphql";
|
|
70305
70214
|
|
|
70306
70215
|
// src/codegen/utils/objectIdentificationSelection.ts
|
|
70307
|
-
import * as
|
|
70216
|
+
import * as graphql12 from "graphql";
|
|
70308
70217
|
var objectIdentificationSelection = (config, type) => {
|
|
70309
70218
|
return config.keyFieldsForType(type.name).map((key) => {
|
|
70310
70219
|
return {
|
|
70311
|
-
kind:
|
|
70220
|
+
kind: graphql12.Kind.FIELD,
|
|
70312
70221
|
name: {
|
|
70313
|
-
kind:
|
|
70222
|
+
kind: graphql12.Kind.NAME,
|
|
70314
70223
|
value: key
|
|
70315
70224
|
}
|
|
70316
70225
|
};
|
|
@@ -70318,7 +70227,7 @@ var objectIdentificationSelection = (config, type) => {
|
|
|
70318
70227
|
};
|
|
70319
70228
|
|
|
70320
70229
|
// src/codegen/transforms/paginate.ts
|
|
70321
|
-
import * as
|
|
70230
|
+
import * as graphql13 from "graphql";
|
|
70322
70231
|
async function paginate(config, documents) {
|
|
70323
70232
|
const newDocs = [];
|
|
70324
70233
|
for (const doc of documents) {
|
|
@@ -70351,7 +70260,7 @@ async function paginate(config, documents) {
|
|
|
70351
70260
|
};
|
|
70352
70261
|
let cursorType = "String";
|
|
70353
70262
|
let paginationPath = [];
|
|
70354
|
-
doc.document =
|
|
70263
|
+
doc.document = graphql13.visit(doc.document, {
|
|
70355
70264
|
Field(node, _3, __, ___, ancestors) {
|
|
70356
70265
|
const paginateDirective = node.directives?.find(
|
|
70357
70266
|
(directive) => directive.name.value === config.paginateDirective
|
|
@@ -70377,7 +70286,7 @@ async function paginate(config, documents) {
|
|
|
70377
70286
|
flags.offset.enabled = offsetPagination;
|
|
70378
70287
|
flags.limit.enabled = offsetPagination;
|
|
70379
70288
|
paginationPath = ancestors.filter(
|
|
70380
|
-
(ancestor) => !Array.isArray(ancestor) && ancestor.kind ===
|
|
70289
|
+
(ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql13.Kind.FIELD
|
|
70381
70290
|
).concat(node).map((field) => field.alias?.value || field.name.value);
|
|
70382
70291
|
return {
|
|
70383
70292
|
...node,
|
|
@@ -70396,7 +70305,7 @@ async function paginate(config, documents) {
|
|
|
70396
70305
|
let fragment2 = "";
|
|
70397
70306
|
let paginateMode = config.defaultPaginateMode;
|
|
70398
70307
|
const requiredArgs = [];
|
|
70399
|
-
doc.document =
|
|
70308
|
+
doc.document = graphql13.visit(doc.document, {
|
|
70400
70309
|
OperationDefinition(node) {
|
|
70401
70310
|
if (node.operation !== "query") {
|
|
70402
70311
|
throw new HoudiniError({
|
|
@@ -70455,9 +70364,9 @@ async function paginate(config, documents) {
|
|
|
70455
70364
|
directives: [
|
|
70456
70365
|
...node.directives || [],
|
|
70457
70366
|
{
|
|
70458
|
-
kind:
|
|
70367
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
70459
70368
|
name: {
|
|
70460
|
-
kind:
|
|
70369
|
+
kind: graphql13.Kind.NAME,
|
|
70461
70370
|
value: config.argumentsDirective
|
|
70462
70371
|
}
|
|
70463
70372
|
}
|
|
@@ -70527,22 +70436,22 @@ async function paginate(config, documents) {
|
|
|
70527
70436
|
const paginationArgs = Object.entries(flags).filter(([_3, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
|
|
70528
70437
|
const fragmentSpreadSelection = [
|
|
70529
70438
|
{
|
|
70530
|
-
kind:
|
|
70439
|
+
kind: graphql13.Kind.FRAGMENT_SPREAD,
|
|
70531
70440
|
name: {
|
|
70532
|
-
kind:
|
|
70441
|
+
kind: graphql13.Kind.NAME,
|
|
70533
70442
|
value: fragmentName
|
|
70534
70443
|
},
|
|
70535
70444
|
directives: [
|
|
70536
70445
|
{
|
|
70537
|
-
kind:
|
|
70446
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
70538
70447
|
name: {
|
|
70539
|
-
kind:
|
|
70448
|
+
kind: graphql13.Kind.NAME,
|
|
70540
70449
|
value: config.withDirective
|
|
70541
70450
|
},
|
|
70542
70451
|
["arguments"]: requiredArgs.map((arg) => variableAsArgument(arg.name)).concat(paginationArgs.map(({ name }) => variableAsArgument(name)))
|
|
70543
70452
|
},
|
|
70544
70453
|
{
|
|
70545
|
-
kind:
|
|
70454
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
70546
70455
|
name: {
|
|
70547
70456
|
kind: "Name",
|
|
70548
70457
|
value: config.maskDisableDirective
|
|
@@ -70569,23 +70478,23 @@ async function paginate(config, documents) {
|
|
|
70569
70478
|
});
|
|
70570
70479
|
const typeConfig = config.typeConfig?.[fragment2];
|
|
70571
70480
|
const queryDoc = {
|
|
70572
|
-
kind:
|
|
70481
|
+
kind: graphql13.Kind.DOCUMENT,
|
|
70573
70482
|
definitions: [
|
|
70574
70483
|
{
|
|
70575
|
-
kind:
|
|
70484
|
+
kind: graphql13.Kind.OPERATION_DEFINITION,
|
|
70576
70485
|
name: {
|
|
70577
|
-
kind:
|
|
70486
|
+
kind: graphql13.Kind.NAME,
|
|
70578
70487
|
value: refetchQueryName
|
|
70579
70488
|
},
|
|
70580
70489
|
operation: "query",
|
|
70581
70490
|
variableDefinitions: requiredArgs.map(
|
|
70582
70491
|
(arg) => ({
|
|
70583
|
-
kind:
|
|
70492
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
70584
70493
|
type: arg.type,
|
|
70585
70494
|
variable: {
|
|
70586
|
-
kind:
|
|
70495
|
+
kind: graphql13.Kind.VARIABLE,
|
|
70587
70496
|
name: {
|
|
70588
|
-
kind:
|
|
70497
|
+
kind: graphql13.Kind.NAME,
|
|
70589
70498
|
value: arg.name
|
|
70590
70499
|
}
|
|
70591
70500
|
}
|
|
@@ -70593,18 +70502,18 @@ async function paginate(config, documents) {
|
|
|
70593
70502
|
).concat(
|
|
70594
70503
|
paginationArgs.map(
|
|
70595
70504
|
(arg) => ({
|
|
70596
|
-
kind:
|
|
70505
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
70597
70506
|
type: {
|
|
70598
|
-
kind:
|
|
70507
|
+
kind: graphql13.Kind.NAMED_TYPE,
|
|
70599
70508
|
name: {
|
|
70600
|
-
kind:
|
|
70509
|
+
kind: graphql13.Kind.NAME,
|
|
70601
70510
|
value: arg.type
|
|
70602
70511
|
}
|
|
70603
70512
|
},
|
|
70604
70513
|
variable: {
|
|
70605
|
-
kind:
|
|
70514
|
+
kind: graphql13.Kind.VARIABLE,
|
|
70606
70515
|
name: {
|
|
70607
|
-
kind:
|
|
70516
|
+
kind: graphql13.Kind.NAME,
|
|
70608
70517
|
value: arg.name
|
|
70609
70518
|
}
|
|
70610
70519
|
},
|
|
@@ -70616,12 +70525,12 @@ async function paginate(config, documents) {
|
|
|
70616
70525
|
).concat(
|
|
70617
70526
|
!nodeQuery ? [] : keys2.map(
|
|
70618
70527
|
(key) => ({
|
|
70619
|
-
kind:
|
|
70528
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
70620
70529
|
type: key.type,
|
|
70621
70530
|
variable: {
|
|
70622
|
-
kind:
|
|
70531
|
+
kind: graphql13.Kind.VARIABLE,
|
|
70623
70532
|
name: {
|
|
70624
|
-
kind:
|
|
70533
|
+
kind: graphql13.Kind.NAME,
|
|
70625
70534
|
value: key.name
|
|
70626
70535
|
}
|
|
70627
70536
|
}
|
|
@@ -70630,42 +70539,42 @@ async function paginate(config, documents) {
|
|
|
70630
70539
|
)
|
|
70631
70540
|
),
|
|
70632
70541
|
selectionSet: {
|
|
70633
|
-
kind:
|
|
70542
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
70634
70543
|
selections: !nodeQuery ? fragmentSpreadSelection : [
|
|
70635
70544
|
{
|
|
70636
|
-
kind:
|
|
70545
|
+
kind: graphql13.Kind.FIELD,
|
|
70637
70546
|
name: {
|
|
70638
|
-
kind:
|
|
70547
|
+
kind: graphql13.Kind.NAME,
|
|
70639
70548
|
value: typeConfig?.resolve?.queryField || "node"
|
|
70640
70549
|
},
|
|
70641
70550
|
["arguments"]: keys2.map((key) => ({
|
|
70642
|
-
kind:
|
|
70551
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
70643
70552
|
name: {
|
|
70644
|
-
kind:
|
|
70553
|
+
kind: graphql13.Kind.NAME,
|
|
70645
70554
|
value: key.name
|
|
70646
70555
|
},
|
|
70647
70556
|
value: {
|
|
70648
|
-
kind:
|
|
70557
|
+
kind: graphql13.Kind.VARIABLE,
|
|
70649
70558
|
name: {
|
|
70650
|
-
kind:
|
|
70559
|
+
kind: graphql13.Kind.NAME,
|
|
70651
70560
|
value: key.name
|
|
70652
70561
|
}
|
|
70653
70562
|
}
|
|
70654
70563
|
})),
|
|
70655
70564
|
selectionSet: {
|
|
70656
|
-
kind:
|
|
70565
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
70657
70566
|
selections: [
|
|
70658
70567
|
{
|
|
70659
|
-
kind:
|
|
70568
|
+
kind: graphql13.Kind.FIELD,
|
|
70660
70569
|
name: {
|
|
70661
|
-
kind:
|
|
70570
|
+
kind: graphql13.Kind.NAME,
|
|
70662
70571
|
value: "__typename"
|
|
70663
70572
|
}
|
|
70664
70573
|
},
|
|
70665
70574
|
...(typeConfig?.keys || [config.defaultKeys[0]]).map((key) => ({
|
|
70666
|
-
kind:
|
|
70575
|
+
kind: graphql13.Kind.FIELD,
|
|
70667
70576
|
name: {
|
|
70668
|
-
kind:
|
|
70577
|
+
kind: graphql13.Kind.NAME,
|
|
70669
70578
|
value: key
|
|
70670
70579
|
}
|
|
70671
70580
|
})),
|
|
@@ -70722,15 +70631,15 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
70722
70631
|
}
|
|
70723
70632
|
function variableAsArgument(name, variable) {
|
|
70724
70633
|
return {
|
|
70725
|
-
kind:
|
|
70634
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
70726
70635
|
name: {
|
|
70727
|
-
kind:
|
|
70636
|
+
kind: graphql13.Kind.NAME,
|
|
70728
70637
|
value: name
|
|
70729
70638
|
},
|
|
70730
70639
|
value: {
|
|
70731
|
-
kind:
|
|
70640
|
+
kind: graphql13.Kind.VARIABLE,
|
|
70732
70641
|
name: {
|
|
70733
|
-
kind:
|
|
70642
|
+
kind: graphql13.Kind.NAME,
|
|
70734
70643
|
value: variable ?? name
|
|
70735
70644
|
}
|
|
70736
70645
|
}
|
|
@@ -70738,18 +70647,18 @@ function variableAsArgument(name, variable) {
|
|
|
70738
70647
|
}
|
|
70739
70648
|
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
70740
70649
|
return {
|
|
70741
|
-
kind:
|
|
70650
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
70742
70651
|
type: {
|
|
70743
|
-
kind:
|
|
70652
|
+
kind: graphql13.Kind.NAMED_TYPE,
|
|
70744
70653
|
name: {
|
|
70745
|
-
kind:
|
|
70654
|
+
kind: graphql13.Kind.NAME,
|
|
70746
70655
|
value: type
|
|
70747
70656
|
}
|
|
70748
70657
|
},
|
|
70749
70658
|
variable: {
|
|
70750
|
-
kind:
|
|
70659
|
+
kind: graphql13.Kind.VARIABLE,
|
|
70751
70660
|
name: {
|
|
70752
|
-
kind:
|
|
70661
|
+
kind: graphql13.Kind.NAME,
|
|
70753
70662
|
value: variableName ?? name
|
|
70754
70663
|
}
|
|
70755
70664
|
},
|
|
@@ -70761,9 +70670,9 @@ function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
|
70761
70670
|
}
|
|
70762
70671
|
function argumentNode(name, value) {
|
|
70763
70672
|
return {
|
|
70764
|
-
kind:
|
|
70673
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
70765
70674
|
name: {
|
|
70766
|
-
kind:
|
|
70675
|
+
kind: graphql13.Kind.NAME,
|
|
70767
70676
|
value: name
|
|
70768
70677
|
},
|
|
70769
70678
|
value: objectNode(value)
|
|
@@ -70771,16 +70680,16 @@ function argumentNode(name, value) {
|
|
|
70771
70680
|
}
|
|
70772
70681
|
function objectNode([type, defaultValue]) {
|
|
70773
70682
|
const node = {
|
|
70774
|
-
kind:
|
|
70683
|
+
kind: graphql13.Kind.OBJECT,
|
|
70775
70684
|
fields: [
|
|
70776
70685
|
{
|
|
70777
|
-
kind:
|
|
70686
|
+
kind: graphql13.Kind.OBJECT_FIELD,
|
|
70778
70687
|
name: {
|
|
70779
|
-
kind:
|
|
70688
|
+
kind: graphql13.Kind.NAME,
|
|
70780
70689
|
value: "type"
|
|
70781
70690
|
},
|
|
70782
70691
|
value: {
|
|
70783
|
-
kind:
|
|
70692
|
+
kind: graphql13.Kind.STRING,
|
|
70784
70693
|
value: type
|
|
70785
70694
|
}
|
|
70786
70695
|
}
|
|
@@ -70788,8 +70697,8 @@ function objectNode([type, defaultValue]) {
|
|
|
70788
70697
|
};
|
|
70789
70698
|
if (defaultValue) {
|
|
70790
70699
|
node.fields.push({
|
|
70791
|
-
kind:
|
|
70792
|
-
name: { kind:
|
|
70700
|
+
kind: graphql13.Kind.OBJECT_FIELD,
|
|
70701
|
+
name: { kind: graphql13.Kind.NAME, value: "default" },
|
|
70793
70702
|
value: {
|
|
70794
70703
|
kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
|
|
70795
70704
|
value: defaultValue.toString()
|
|
@@ -70800,34 +70709,34 @@ function objectNode([type, defaultValue]) {
|
|
|
70800
70709
|
}
|
|
70801
70710
|
var pageInfoSelection = [
|
|
70802
70711
|
{
|
|
70803
|
-
kind:
|
|
70712
|
+
kind: graphql13.Kind.FIELD,
|
|
70804
70713
|
name: {
|
|
70805
|
-
kind:
|
|
70714
|
+
kind: graphql13.Kind.NAME,
|
|
70806
70715
|
value: "edges"
|
|
70807
70716
|
},
|
|
70808
70717
|
selectionSet: {
|
|
70809
|
-
kind:
|
|
70718
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
70810
70719
|
selections: [
|
|
70811
70720
|
{
|
|
70812
|
-
kind:
|
|
70721
|
+
kind: graphql13.Kind.FIELD,
|
|
70813
70722
|
name: {
|
|
70814
|
-
kind:
|
|
70723
|
+
kind: graphql13.Kind.NAME,
|
|
70815
70724
|
value: "cursor"
|
|
70816
70725
|
}
|
|
70817
70726
|
},
|
|
70818
70727
|
{
|
|
70819
|
-
kind:
|
|
70728
|
+
kind: graphql13.Kind.FIELD,
|
|
70820
70729
|
name: {
|
|
70821
|
-
kind:
|
|
70730
|
+
kind: graphql13.Kind.NAME,
|
|
70822
70731
|
value: "node"
|
|
70823
70732
|
},
|
|
70824
70733
|
selectionSet: {
|
|
70825
|
-
kind:
|
|
70734
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
70826
70735
|
selections: [
|
|
70827
70736
|
{
|
|
70828
|
-
kind:
|
|
70737
|
+
kind: graphql13.Kind.FIELD,
|
|
70829
70738
|
name: {
|
|
70830
|
-
kind:
|
|
70739
|
+
kind: graphql13.Kind.NAME,
|
|
70831
70740
|
value: "__typename"
|
|
70832
70741
|
}
|
|
70833
70742
|
}
|
|
@@ -70838,39 +70747,39 @@ var pageInfoSelection = [
|
|
|
70838
70747
|
}
|
|
70839
70748
|
},
|
|
70840
70749
|
{
|
|
70841
|
-
kind:
|
|
70750
|
+
kind: graphql13.Kind.FIELD,
|
|
70842
70751
|
name: {
|
|
70843
|
-
kind:
|
|
70752
|
+
kind: graphql13.Kind.NAME,
|
|
70844
70753
|
value: "pageInfo"
|
|
70845
70754
|
},
|
|
70846
70755
|
selectionSet: {
|
|
70847
|
-
kind:
|
|
70756
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
70848
70757
|
selections: [
|
|
70849
70758
|
{
|
|
70850
|
-
kind:
|
|
70759
|
+
kind: graphql13.Kind.FIELD,
|
|
70851
70760
|
name: {
|
|
70852
|
-
kind:
|
|
70761
|
+
kind: graphql13.Kind.NAME,
|
|
70853
70762
|
value: "hasPreviousPage"
|
|
70854
70763
|
}
|
|
70855
70764
|
},
|
|
70856
70765
|
{
|
|
70857
|
-
kind:
|
|
70766
|
+
kind: graphql13.Kind.FIELD,
|
|
70858
70767
|
name: {
|
|
70859
|
-
kind:
|
|
70768
|
+
kind: graphql13.Kind.NAME,
|
|
70860
70769
|
value: "hasNextPage"
|
|
70861
70770
|
}
|
|
70862
70771
|
},
|
|
70863
70772
|
{
|
|
70864
|
-
kind:
|
|
70773
|
+
kind: graphql13.Kind.FIELD,
|
|
70865
70774
|
name: {
|
|
70866
|
-
kind:
|
|
70775
|
+
kind: graphql13.Kind.NAME,
|
|
70867
70776
|
value: "startCursor"
|
|
70868
70777
|
}
|
|
70869
70778
|
},
|
|
70870
70779
|
{
|
|
70871
|
-
kind:
|
|
70780
|
+
kind: graphql13.Kind.FIELD,
|
|
70872
70781
|
name: {
|
|
70873
|
-
kind:
|
|
70782
|
+
kind: graphql13.Kind.NAME,
|
|
70874
70783
|
value: "endCursor"
|
|
70875
70784
|
}
|
|
70876
70785
|
}
|
|
@@ -70884,17 +70793,17 @@ async function addListFragments(config, documents) {
|
|
|
70884
70793
|
const lists = {};
|
|
70885
70794
|
const errors = [];
|
|
70886
70795
|
for (const doc of documents) {
|
|
70887
|
-
doc.document =
|
|
70796
|
+
doc.document = graphql14.visit(doc.document, {
|
|
70888
70797
|
Directive(node, key, parent2, path3, ancestors) {
|
|
70889
70798
|
if ([config.listDirective, config.paginateDirective].includes(node.name.value)) {
|
|
70890
70799
|
const nameArg = node.arguments?.find(
|
|
70891
70800
|
(arg) => arg.name.value === config.listOrPaginateNameArg
|
|
70892
70801
|
);
|
|
70893
70802
|
let error = {
|
|
70894
|
-
...new
|
|
70803
|
+
...new graphql14.GraphQLError(
|
|
70895
70804
|
"",
|
|
70896
70805
|
node,
|
|
70897
|
-
new
|
|
70806
|
+
new graphql14.Source(""),
|
|
70898
70807
|
node.loc ? [node.loc.start, node.loc.end] : null,
|
|
70899
70808
|
path3
|
|
70900
70809
|
),
|
|
@@ -70946,7 +70855,7 @@ async function addListFragments(config, documents) {
|
|
|
70946
70855
|
{
|
|
70947
70856
|
kind: "Argument",
|
|
70948
70857
|
name: {
|
|
70949
|
-
kind:
|
|
70858
|
+
kind: graphql14.Kind.NAME,
|
|
70950
70859
|
value: "connection"
|
|
70951
70860
|
},
|
|
70952
70861
|
value: {
|
|
@@ -70996,7 +70905,7 @@ async function addListFragments(config, documents) {
|
|
|
70996
70905
|
const validDeletes = [
|
|
70997
70906
|
...new Set(
|
|
70998
70907
|
Object.values(lists).map(({ type }) => {
|
|
70999
|
-
if (!(type instanceof
|
|
70908
|
+
if (!(type instanceof graphql14.GraphQLObjectType)) {
|
|
71000
70909
|
return "";
|
|
71001
70910
|
}
|
|
71002
70911
|
if (config.keyFieldsForType(type.name).length !== 1) {
|
|
@@ -71010,7 +70919,7 @@ async function addListFragments(config, documents) {
|
|
|
71010
70919
|
return;
|
|
71011
70920
|
}
|
|
71012
70921
|
const generatedDoc = {
|
|
71013
|
-
kind:
|
|
70922
|
+
kind: graphql14.Kind.DOCUMENT,
|
|
71014
70923
|
definitions: Object.entries(lists).flatMap(
|
|
71015
70924
|
([name, { selection, type }]) => {
|
|
71016
70925
|
const schemaType = config.schema.getType(type.name);
|
|
@@ -71018,7 +70927,7 @@ async function addListFragments(config, documents) {
|
|
|
71018
70927
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
71019
70928
|
}
|
|
71020
70929
|
const fragmentSelection = {
|
|
71021
|
-
kind:
|
|
70930
|
+
kind: graphql14.Kind.SELECTION_SET,
|
|
71022
70931
|
selections: [...selection.selections]
|
|
71023
70932
|
};
|
|
71024
70933
|
if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
|
|
@@ -71033,14 +70942,14 @@ async function addListFragments(config, documents) {
|
|
|
71033
70942
|
{
|
|
71034
70943
|
name: {
|
|
71035
70944
|
value: config.listInsertFragment(name),
|
|
71036
|
-
kind:
|
|
70945
|
+
kind: graphql14.Kind.NAME
|
|
71037
70946
|
},
|
|
71038
|
-
kind:
|
|
70947
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
71039
70948
|
selectionSet: fragmentSelection,
|
|
71040
70949
|
typeCondition: {
|
|
71041
|
-
kind:
|
|
70950
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
71042
70951
|
name: {
|
|
71043
|
-
kind:
|
|
70952
|
+
kind: graphql14.Kind.NAME,
|
|
71044
70953
|
value: type.name
|
|
71045
70954
|
}
|
|
71046
70955
|
}
|
|
@@ -71048,32 +70957,32 @@ async function addListFragments(config, documents) {
|
|
|
71048
70957
|
{
|
|
71049
70958
|
name: {
|
|
71050
70959
|
value: config.listToggleFragment(name),
|
|
71051
|
-
kind:
|
|
70960
|
+
kind: graphql14.Kind.NAME
|
|
71052
70961
|
},
|
|
71053
|
-
kind:
|
|
70962
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
71054
70963
|
selectionSet: fragmentSelection,
|
|
71055
70964
|
typeCondition: {
|
|
71056
|
-
kind:
|
|
70965
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
71057
70966
|
name: {
|
|
71058
|
-
kind:
|
|
70967
|
+
kind: graphql14.Kind.NAME,
|
|
71059
70968
|
value: type.name
|
|
71060
70969
|
}
|
|
71061
70970
|
}
|
|
71062
70971
|
},
|
|
71063
70972
|
{
|
|
71064
|
-
kind:
|
|
70973
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
71065
70974
|
name: {
|
|
71066
70975
|
value: config.listRemoveFragment(name),
|
|
71067
|
-
kind:
|
|
70976
|
+
kind: graphql14.Kind.NAME
|
|
71068
70977
|
},
|
|
71069
70978
|
selectionSet: {
|
|
71070
|
-
kind:
|
|
70979
|
+
kind: graphql14.Kind.SELECTION_SET,
|
|
71071
70980
|
selections: [...objectIdentificationSelection(config, type)]
|
|
71072
70981
|
},
|
|
71073
70982
|
typeCondition: {
|
|
71074
|
-
kind:
|
|
70983
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
71075
70984
|
name: {
|
|
71076
|
-
kind:
|
|
70985
|
+
kind: graphql14.Kind.NAME,
|
|
71077
70986
|
value: type.name
|
|
71078
70987
|
}
|
|
71079
70988
|
}
|
|
@@ -71082,14 +70991,14 @@ async function addListFragments(config, documents) {
|
|
|
71082
70991
|
}
|
|
71083
70992
|
).concat(
|
|
71084
70993
|
...validDeletes.map((typeName) => ({
|
|
71085
|
-
kind:
|
|
70994
|
+
kind: graphql14.Kind.DIRECTIVE_DEFINITION,
|
|
71086
70995
|
name: {
|
|
71087
|
-
kind:
|
|
70996
|
+
kind: graphql14.Kind.NAME,
|
|
71088
70997
|
value: config.listDeleteDirective(typeName)
|
|
71089
70998
|
},
|
|
71090
70999
|
locations: [
|
|
71091
71000
|
{
|
|
71092
|
-
kind:
|
|
71001
|
+
kind: graphql14.Kind.NAME,
|
|
71093
71002
|
value: "FIELD"
|
|
71094
71003
|
}
|
|
71095
71004
|
],
|
|
@@ -71097,8 +71006,8 @@ async function addListFragments(config, documents) {
|
|
|
71097
71006
|
}))
|
|
71098
71007
|
)
|
|
71099
71008
|
};
|
|
71100
|
-
config.newSchema += "\n" + generatedDoc.definitions.filter((c2) => c2.kind !== "FragmentDefinition").map(
|
|
71101
|
-
config.newDocuments += "\n" + generatedDoc.definitions.filter((c2) => c2.kind === "FragmentDefinition").map(
|
|
71009
|
+
config.newSchema += "\n" + generatedDoc.definitions.filter((c2) => c2.kind !== "FragmentDefinition").map(graphql14.print).join("\n\n");
|
|
71010
|
+
config.newDocuments += "\n" + generatedDoc.definitions.filter((c2) => c2.kind === "FragmentDefinition").map(graphql14.print).join("\n\n");
|
|
71102
71011
|
documents.push({
|
|
71103
71012
|
name: "generated::lists",
|
|
71104
71013
|
kind: ArtifactKind.Fragment,
|
|
@@ -71184,11 +71093,11 @@ var nodeNotDefinedMessage = (config) => `Looks like you are trying to use the ${
|
|
|
71184
71093
|
For more information, visit this link: ${siteURL}/guides/pagination`;
|
|
71185
71094
|
|
|
71186
71095
|
// src/codegen/generators/artifacts/fieldKey.ts
|
|
71187
|
-
import * as
|
|
71096
|
+
import * as graphql15 from "graphql";
|
|
71188
71097
|
function fieldKey(config, field) {
|
|
71189
71098
|
const attributeName = field.alias?.value || field.name.value;
|
|
71190
|
-
const printed =
|
|
71191
|
-
const secondParse =
|
|
71099
|
+
const printed = graphql15.print(field);
|
|
71100
|
+
const secondParse = graphql15.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
|
|
71192
71101
|
let paginateMode = config.defaultPaginateMode;
|
|
71193
71102
|
const paginatedDirective = field.directives?.find(
|
|
71194
71103
|
(directive) => directive.name.value === config.paginateDirective
|
|
@@ -71311,13 +71220,13 @@ function prepareSelection({
|
|
|
71311
71220
|
} else if ("getFields" in type) {
|
|
71312
71221
|
let typeRef = type.getFields()[field.name.value].type;
|
|
71313
71222
|
fieldType = getRootType(typeRef);
|
|
71314
|
-
nullable = !
|
|
71315
|
-
} else if (
|
|
71223
|
+
nullable = !graphql16.isNonNullType(typeRef);
|
|
71224
|
+
} else if (graphql16.isAbstractType(type)) {
|
|
71316
71225
|
for (const possible of config.schema.getPossibleTypes(type)) {
|
|
71317
|
-
if (
|
|
71226
|
+
if (graphql16.isObjectType(possible)) {
|
|
71318
71227
|
if (possible.getFields()[field.name.value]) {
|
|
71319
71228
|
fieldType = possible.getFields()[field.name.value].type;
|
|
71320
|
-
nullable = !
|
|
71229
|
+
nullable = !graphql16.isNonNullType(fieldType);
|
|
71321
71230
|
break;
|
|
71322
71231
|
}
|
|
71323
71232
|
}
|
|
@@ -71454,7 +71363,7 @@ function prepareSelection({
|
|
|
71454
71363
|
kind: "value"
|
|
71455
71364
|
} : { kind: "continue" };
|
|
71456
71365
|
const parentType = config.schema.getType(rootType);
|
|
71457
|
-
if (
|
|
71366
|
+
if (graphql16.isObjectType(parentType) || graphql16.isInterfaceType(parentType)) {
|
|
71458
71367
|
const fieldType2 = parentType.getFields()[field.name.value]?.type;
|
|
71459
71368
|
if (fieldType2) {
|
|
71460
71369
|
const listCount = unwrapType(config, fieldType2).wrappers.filter(
|
|
@@ -71477,7 +71386,7 @@ function prepareSelection({
|
|
|
71477
71386
|
}
|
|
71478
71387
|
fieldObj.loading = loadingValue;
|
|
71479
71388
|
}
|
|
71480
|
-
if (
|
|
71389
|
+
if (graphql16.isInterfaceType(fieldType) || graphql16.isUnionType(fieldType)) {
|
|
71481
71390
|
fieldObj.abstract = true;
|
|
71482
71391
|
if (Object.values(fieldObj.selection?.abstractFields?.fields ?? {}).some(
|
|
71483
71392
|
(fields) => Object.values(fields ?? {}).some((field2) => field2.required)
|
|
@@ -71559,7 +71468,7 @@ function mergeSelection({
|
|
|
71559
71468
|
typeSelection,
|
|
71560
71469
|
abstractSelection.fields[typeName] ?? {}
|
|
71561
71470
|
);
|
|
71562
|
-
if (
|
|
71471
|
+
if (graphql16.isAbstractType(gqlType)) {
|
|
71563
71472
|
for (const possible of config.schema.getPossibleTypes(gqlType)) {
|
|
71564
71473
|
if (!possibleSelectionTypes[typeName]) {
|
|
71565
71474
|
possibleSelectionTypes[typeName] = [];
|
|
@@ -71594,7 +71503,7 @@ function mergeSelection({
|
|
|
71594
71503
|
}
|
|
71595
71504
|
}
|
|
71596
71505
|
const parentType = config.schema.getType(rootType);
|
|
71597
|
-
const possibleParents =
|
|
71506
|
+
const possibleParents = graphql16.isAbstractType(parentType) ? config.schema.getPossibleTypes(parentType)?.map((t3) => t3.name) : [parentType.name];
|
|
71598
71507
|
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
71599
71508
|
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
71600
71509
|
delete abstractSelection.typeMap[key];
|
|
@@ -71651,12 +71560,12 @@ function mergeSelection({
|
|
|
71651
71560
|
}
|
|
71652
71561
|
|
|
71653
71562
|
// src/codegen/generators/artifacts/index.ts
|
|
71654
|
-
var
|
|
71563
|
+
var AST5 = recast5.types.builders;
|
|
71655
71564
|
function artifactGenerator(stats) {
|
|
71656
71565
|
return async function(config, docs) {
|
|
71657
71566
|
const filterTypes = {};
|
|
71658
71567
|
for (const doc of docs) {
|
|
71659
|
-
|
|
71568
|
+
graphql17.visit(doc.document, {
|
|
71660
71569
|
Directive(node, _3, __, ___, ancestors) {
|
|
71661
71570
|
if (node.name.value !== config.listDirective) {
|
|
71662
71571
|
return;
|
|
@@ -71716,7 +71625,7 @@ function artifactGenerator(stats) {
|
|
|
71716
71625
|
return;
|
|
71717
71626
|
}
|
|
71718
71627
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
71719
|
-
let documentWithoutInternalDirectives =
|
|
71628
|
+
let documentWithoutInternalDirectives = graphql17.visit(document, {
|
|
71720
71629
|
Directive(node) {
|
|
71721
71630
|
if (config.isInternalDirective(node.name.value)) {
|
|
71722
71631
|
return null;
|
|
@@ -71729,7 +71638,7 @@ function artifactGenerator(stats) {
|
|
|
71729
71638
|
}
|
|
71730
71639
|
}
|
|
71731
71640
|
});
|
|
71732
|
-
let documentWithoutExtraVariables =
|
|
71641
|
+
let documentWithoutExtraVariables = graphql17.visit(
|
|
71733
71642
|
documentWithoutInternalDirectives,
|
|
71734
71643
|
{
|
|
71735
71644
|
VariableDefinition(variableDefinitionNode) {
|
|
@@ -71740,13 +71649,13 @@ function artifactGenerator(stats) {
|
|
|
71740
71649
|
}
|
|
71741
71650
|
}
|
|
71742
71651
|
);
|
|
71743
|
-
let rawString =
|
|
71652
|
+
let rawString = graphql17.print(documentWithoutExtraVariables);
|
|
71744
71653
|
let docKind = doc.kind;
|
|
71745
71654
|
const operations = document.definitions.filter(
|
|
71746
|
-
({ kind }) => kind ===
|
|
71655
|
+
({ kind }) => kind === graphql17.Kind.OPERATION_DEFINITION
|
|
71747
71656
|
);
|
|
71748
71657
|
const fragments = document.definitions.filter(
|
|
71749
|
-
({ kind }) => kind ===
|
|
71658
|
+
({ kind }) => kind === graphql17.Kind.FRAGMENT_DEFINITION
|
|
71750
71659
|
);
|
|
71751
71660
|
let rootType = "";
|
|
71752
71661
|
let selectionSet;
|
|
@@ -71946,9 +71855,9 @@ function artifactGenerator(stats) {
|
|
|
71946
71855
|
plugin2.artifactEnd({ config, document: doc });
|
|
71947
71856
|
}
|
|
71948
71857
|
const _houdiniHash = hashOriginal({ document: doc });
|
|
71949
|
-
const file =
|
|
71858
|
+
const file = AST5.program([
|
|
71950
71859
|
moduleExport(config, "default", serializeValue(artifact)),
|
|
71951
|
-
|
|
71860
|
+
AST5.expressionStatement(AST5.stringLiteral(`HoudiniHash=${_houdiniHash}`))
|
|
71952
71861
|
]);
|
|
71953
71862
|
const artifactPath = config.artifactPath(document);
|
|
71954
71863
|
const countDocument = doc.generateStore;
|
|
@@ -72006,7 +71915,7 @@ function applyMask(config, target, mask) {
|
|
|
72006
71915
|
if (!targetType) {
|
|
72007
71916
|
continue;
|
|
72008
71917
|
}
|
|
72009
|
-
if (
|
|
71918
|
+
if (graphql17.isAbstractType(targetType)) {
|
|
72010
71919
|
for (const possible of config.schema.getPossibleTypes(targetType)) {
|
|
72011
71920
|
if (target.abstractFields?.fields[possible.name]) {
|
|
72012
71921
|
applyMask(
|
|
@@ -72029,8 +71938,8 @@ function applyMask(config, target, mask) {
|
|
|
72029
71938
|
}
|
|
72030
71939
|
|
|
72031
71940
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
72032
|
-
var
|
|
72033
|
-
var
|
|
71941
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
71942
|
+
var AST6 = recast6.types.builders;
|
|
72034
71943
|
async function generateGraphqlReturnTypes(config, docs) {
|
|
72035
71944
|
const indexPath = path_exports.join(config.runtimeDirectory, "index.d.ts");
|
|
72036
71945
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -72065,18 +71974,18 @@ async function generateGraphqlReturnTypes(config, docs) {
|
|
|
72065
71974
|
continue;
|
|
72066
71975
|
}
|
|
72067
71976
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
72068
|
-
const input =
|
|
72069
|
-
input.typeAnnotation =
|
|
72070
|
-
|
|
71977
|
+
const input = AST6.identifier("str");
|
|
71978
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
71979
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
72071
71980
|
);
|
|
72072
71981
|
script.body.splice(
|
|
72073
71982
|
i2,
|
|
72074
71983
|
0,
|
|
72075
|
-
|
|
72076
|
-
|
|
72077
|
-
|
|
71984
|
+
AST6.exportNamedDeclaration(
|
|
71985
|
+
AST6.tsDeclareFunction(
|
|
71986
|
+
AST6.identifier("graphql"),
|
|
72078
71987
|
[input],
|
|
72079
|
-
|
|
71988
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
72080
71989
|
)
|
|
72081
71990
|
)
|
|
72082
71991
|
);
|
|
@@ -72251,165 +72160,22 @@ function moduleStatments(config) {
|
|
|
72251
72160
|
var recast11 = __toESM(require_main2(), 1);
|
|
72252
72161
|
|
|
72253
72162
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
72254
|
-
var recast8 = __toESM(require_main2(), 1);
|
|
72255
|
-
import * as graphql19 from "graphql";
|
|
72256
|
-
|
|
72257
|
-
// src/codegen/generators/typescript/typeReference.ts
|
|
72258
72163
|
var recast7 = __toESM(require_main2(), 1);
|
|
72259
72164
|
import * as graphql18 from "graphql";
|
|
72260
|
-
|
|
72261
|
-
// src/codegen/generators/typescript/types.ts
|
|
72262
|
-
var recast6 = __toESM(require_main2(), 1);
|
|
72263
|
-
import * as graphql17 from "graphql";
|
|
72264
|
-
var AST6 = recast6.types.builders;
|
|
72265
|
-
function readonlyProperty(prop, enable = true) {
|
|
72266
|
-
if (enable) {
|
|
72267
|
-
prop.readonly = true;
|
|
72268
|
-
}
|
|
72269
|
-
return prop;
|
|
72270
|
-
}
|
|
72271
|
-
function nullableField(inner, input = false) {
|
|
72272
|
-
const members = [inner, AST6.tsNullKeyword()];
|
|
72273
|
-
if (input) {
|
|
72274
|
-
members.push(AST6.tsUndefinedKeyword());
|
|
72275
|
-
}
|
|
72276
|
-
return AST6.tsUnionType(members);
|
|
72277
|
-
}
|
|
72278
|
-
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
72279
|
-
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
72280
|
-
if (!field) {
|
|
72281
|
-
return AST6.tsNeverKeyword();
|
|
72282
|
-
}
|
|
72283
|
-
const component = config.componentFields[field.parent][field.field];
|
|
72284
|
-
const sourcePathRelative = path_exports.relative(
|
|
72285
|
-
path_exports.join(config.projectRoot, "src"),
|
|
72286
|
-
component.filepath
|
|
72287
|
-
);
|
|
72288
|
-
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
72289
|
-
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
72290
|
-
const localImport = ensureImports({
|
|
72291
|
-
config,
|
|
72292
|
-
body,
|
|
72293
|
-
import: "__component__" + component.fragment,
|
|
72294
|
-
sourceModule: path_exports.join(
|
|
72295
|
-
path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
|
|
72296
|
-
"src",
|
|
72297
|
-
sourcePath
|
|
72298
|
-
)
|
|
72299
|
-
});
|
|
72300
|
-
const parameters = AST6.tsTypeReference(AST6.identifier("Parameters"));
|
|
72301
|
-
parameters.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
72302
|
-
AST6.tsTypeQuery(AST6.identifier(localImport))
|
|
72303
|
-
]);
|
|
72304
|
-
const indexed = AST6.tsIndexedAccessType(
|
|
72305
|
-
parameters,
|
|
72306
|
-
AST6.tsLiteralType(AST6.numericLiteral(0))
|
|
72307
|
-
);
|
|
72308
|
-
const omit = AST6.tsTypeReference(AST6.identifier("Omit"));
|
|
72309
|
-
omit.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
72310
|
-
indexed,
|
|
72311
|
-
AST6.tsLiteralType(AST6.stringLiteral(component.prop))
|
|
72312
|
-
]);
|
|
72313
|
-
const arg = AST6.identifier("props");
|
|
72314
|
-
arg.typeAnnotation = AST6.tsTypeAnnotation(omit);
|
|
72315
|
-
const returnType = AST6.tsTypeReference(AST6.identifier("ReturnType"));
|
|
72316
|
-
returnType.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
72317
|
-
AST6.tsTypeQuery(AST6.identifier(localImport))
|
|
72318
|
-
]);
|
|
72319
|
-
const fnType = AST6.tsFunctionType([arg]);
|
|
72320
|
-
fnType.typeAnnotation = AST6.tsTypeAnnotation(returnType);
|
|
72321
|
-
return fnType;
|
|
72322
|
-
}
|
|
72323
|
-
switch (target.name) {
|
|
72324
|
-
case "String": {
|
|
72325
|
-
return AST6.tsStringKeyword();
|
|
72326
|
-
}
|
|
72327
|
-
case "Int": {
|
|
72328
|
-
return AST6.tsNumberKeyword();
|
|
72329
|
-
}
|
|
72330
|
-
case "Float": {
|
|
72331
|
-
return AST6.tsNumberKeyword();
|
|
72332
|
-
}
|
|
72333
|
-
case "Boolean": {
|
|
72334
|
-
return AST6.tsBooleanKeyword();
|
|
72335
|
-
}
|
|
72336
|
-
case "ID": {
|
|
72337
|
-
return AST6.tsStringKeyword();
|
|
72338
|
-
}
|
|
72339
|
-
default: {
|
|
72340
|
-
if (graphql17.isNonNullType(target) && "ofType" in target) {
|
|
72341
|
-
return scalarPropertyValue(
|
|
72342
|
-
config,
|
|
72343
|
-
filepath,
|
|
72344
|
-
missingScalars,
|
|
72345
|
-
target.ofType,
|
|
72346
|
-
body,
|
|
72347
|
-
field
|
|
72348
|
-
);
|
|
72349
|
-
}
|
|
72350
|
-
if (config.scalars?.[target.name]) {
|
|
72351
|
-
return AST6.tsTypeReference(AST6.identifier(config.scalars?.[target.name].type));
|
|
72352
|
-
}
|
|
72353
|
-
if (target.name !== config.componentScalar) {
|
|
72354
|
-
missingScalars.add(target.name);
|
|
72355
|
-
}
|
|
72356
|
-
return AST6.tsAnyKeyword();
|
|
72357
|
-
}
|
|
72358
|
-
}
|
|
72359
|
-
}
|
|
72360
|
-
|
|
72361
|
-
// src/codegen/generators/typescript/typeReference.ts
|
|
72362
72165
|
var AST7 = recast7.types.builders;
|
|
72363
|
-
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
72364
|
-
const { type, wrappers } = unwrapType(config, definition.type);
|
|
72365
|
-
let result;
|
|
72366
|
-
if (graphql18.isScalarType(type)) {
|
|
72367
|
-
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
72368
|
-
} else if (graphql18.isEnumType(type)) {
|
|
72369
|
-
result = enumReference(config, body, type.name);
|
|
72370
|
-
} else {
|
|
72371
|
-
result = AST7.tsTypeReference(AST7.identifier(type.name));
|
|
72372
|
-
}
|
|
72373
|
-
for (const toWrap of wrappers) {
|
|
72374
|
-
if (toWrap === "NonNull" /* NonNull */) {
|
|
72375
|
-
continue;
|
|
72376
|
-
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
72377
|
-
result = nullableField(result, true);
|
|
72378
|
-
} else if (toWrap === "List" /* List */) {
|
|
72379
|
-
result = AST7.tsArrayType(AST7.tsParenthesizedType(result));
|
|
72380
|
-
}
|
|
72381
|
-
}
|
|
72382
|
-
return result;
|
|
72383
|
-
}
|
|
72384
|
-
function enumReference(config, body, name) {
|
|
72385
|
-
ensureImports({
|
|
72386
|
-
config,
|
|
72387
|
-
body,
|
|
72388
|
-
import: ["ValueOf"],
|
|
72389
|
-
importKind: "type",
|
|
72390
|
-
sourceModule: "$houdini/runtime/lib/types"
|
|
72391
|
-
});
|
|
72392
|
-
return AST7.tsTypeReference(
|
|
72393
|
-
AST7.identifier("ValueOf"),
|
|
72394
|
-
AST7.tsTypeParameterInstantiation([AST7.tsTypeQuery(AST7.identifier(name))])
|
|
72395
|
-
);
|
|
72396
|
-
}
|
|
72397
|
-
|
|
72398
|
-
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
72399
|
-
var AST8 = recast8.types.builders;
|
|
72400
72166
|
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
72401
72167
|
const { type } = unwrapType(config, rootType);
|
|
72402
|
-
if (
|
|
72168
|
+
if (graphql18.isScalarType(type)) {
|
|
72403
72169
|
return;
|
|
72404
72170
|
}
|
|
72405
72171
|
if (visitedTypes.has(type.name)) {
|
|
72406
72172
|
return;
|
|
72407
72173
|
}
|
|
72408
|
-
if (
|
|
72174
|
+
if (graphql18.isUnionType(type)) {
|
|
72409
72175
|
throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
|
|
72410
72176
|
}
|
|
72411
72177
|
visitedTypes.add(type.name);
|
|
72412
|
-
if (
|
|
72178
|
+
if (graphql18.isEnumType(type)) {
|
|
72413
72179
|
ensureImports({
|
|
72414
72180
|
config,
|
|
72415
72181
|
body,
|
|
@@ -72423,21 +72189,37 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
|
|
|
72423
72189
|
for (const field of Object.values(type.getFields())) {
|
|
72424
72190
|
addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, field.type);
|
|
72425
72191
|
members.push(
|
|
72426
|
-
|
|
72427
|
-
|
|
72428
|
-
|
|
72192
|
+
AST7.tsPropertySignature(
|
|
72193
|
+
AST7.identifier(field.name),
|
|
72194
|
+
AST7.tsTypeAnnotation(
|
|
72429
72195
|
tsTypeReference(config, filepath, missingScalars, field, body)
|
|
72430
72196
|
),
|
|
72431
|
-
|
|
72197
|
+
graphql18.isNullableType(field.type)
|
|
72432
72198
|
)
|
|
72433
72199
|
);
|
|
72434
72200
|
}
|
|
72435
|
-
body.push(
|
|
72201
|
+
body.push(AST7.tsTypeAliasDeclaration(AST7.identifier(type.name), AST7.tsTypeLiteral(members)));
|
|
72436
72202
|
}
|
|
72437
72203
|
|
|
72438
72204
|
// src/codegen/generators/typescript/inlineType.ts
|
|
72439
72205
|
var recast9 = __toESM(require_main2(), 1);
|
|
72440
|
-
import * as
|
|
72206
|
+
import * as graphql19 from "graphql";
|
|
72207
|
+
|
|
72208
|
+
// src/codegen/generators/comments/jsdoc.ts
|
|
72209
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
72210
|
+
var AST8 = recast8.types.builders;
|
|
72211
|
+
function jsdocComment(text, deprecated) {
|
|
72212
|
+
let commentContent = `*
|
|
72213
|
+
* ${text}
|
|
72214
|
+
`;
|
|
72215
|
+
if (deprecated) {
|
|
72216
|
+
commentContent = `${commentContent} * @deprecated ${deprecated}
|
|
72217
|
+
`;
|
|
72218
|
+
}
|
|
72219
|
+
return AST8.commentBlock(commentContent, true);
|
|
72220
|
+
}
|
|
72221
|
+
|
|
72222
|
+
// src/codegen/generators/typescript/inlineType.ts
|
|
72441
72223
|
var AST9 = recast9.types.builders;
|
|
72442
72224
|
var fragmentKey2 = " $fragments";
|
|
72443
72225
|
function inlineType({
|
|
@@ -72458,7 +72240,7 @@ function inlineType({
|
|
|
72458
72240
|
const { type, wrappers } = unwrapType(config, rootType);
|
|
72459
72241
|
let result;
|
|
72460
72242
|
let forceNullable = false;
|
|
72461
|
-
if (
|
|
72243
|
+
if (graphql19.isScalarType(type)) {
|
|
72462
72244
|
result = scalarPropertyValue(
|
|
72463
72245
|
config,
|
|
72464
72246
|
filepath,
|
|
@@ -72467,7 +72249,7 @@ function inlineType({
|
|
|
72467
72249
|
body,
|
|
72468
72250
|
field
|
|
72469
72251
|
);
|
|
72470
|
-
} else if (
|
|
72252
|
+
} else if (graphql19.isEnumType(type)) {
|
|
72471
72253
|
ensureImports({
|
|
72472
72254
|
config,
|
|
72473
72255
|
body,
|
|
@@ -72492,11 +72274,11 @@ function inlineType({
|
|
|
72492
72274
|
for (const selection of selections) {
|
|
72493
72275
|
if (selection.kind === "InlineFragment" && selection.typeCondition) {
|
|
72494
72276
|
const fragmentType = config.schema.getType(selection.typeCondition.name.value);
|
|
72495
|
-
if (!
|
|
72277
|
+
if (!graphql19.isInterfaceType(type) && !graphql19.isUnionType(type)) {
|
|
72496
72278
|
selectedFields.push(...selection.selectionSet.selections);
|
|
72497
72279
|
continue;
|
|
72498
72280
|
}
|
|
72499
|
-
if (!
|
|
72281
|
+
if (!graphql19.isInterfaceType(fragmentType) && !graphql19.isUnionType(fragmentType)) {
|
|
72500
72282
|
if (!inlineFragments[fragmentType.name]) {
|
|
72501
72283
|
inlineFragments[fragmentType.name] = [];
|
|
72502
72284
|
}
|
|
@@ -72588,6 +72370,11 @@ function inlineType({
|
|
|
72588
72370
|
if (allOptional) {
|
|
72589
72371
|
prop.optional = true;
|
|
72590
72372
|
}
|
|
72373
|
+
if (field2.description || field2.deprecationReason) {
|
|
72374
|
+
prop.comments = [
|
|
72375
|
+
jsdocComment(field2.description ?? "", field2.deprecationReason ?? void 0)
|
|
72376
|
+
];
|
|
72377
|
+
}
|
|
72591
72378
|
return prop;
|
|
72592
72379
|
})
|
|
72593
72380
|
]);
|
|
@@ -72639,7 +72426,7 @@ function inlineType({
|
|
|
72639
72426
|
}
|
|
72640
72427
|
}
|
|
72641
72428
|
}
|
|
72642
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
72429
|
+
if (objectType.type === "TSTypeLiteral" && !graphql19.isInterfaceType(fragmentRootType) && !graphql19.isUnionType(fragmentRootType)) {
|
|
72643
72430
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
72644
72431
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
72645
72432
|
);
|
|
@@ -72664,11 +72451,11 @@ function inlineType({
|
|
|
72664
72451
|
];
|
|
72665
72452
|
}
|
|
72666
72453
|
let coveredTypenames;
|
|
72667
|
-
if (
|
|
72454
|
+
if (graphql19.isInterfaceType(fragmentRootType)) {
|
|
72668
72455
|
coveredTypenames = interfaceCoveredTypenames(fragmentRootType);
|
|
72669
|
-
} else if (
|
|
72456
|
+
} else if (graphql19.isUnionType(fragmentRootType)) {
|
|
72670
72457
|
coveredTypenames = fragmentRootType.getTypes().map((type2) => type2.name);
|
|
72671
|
-
} else if (
|
|
72458
|
+
} else if (graphql19.isObjectType(fragmentRootType)) {
|
|
72672
72459
|
coveredTypenames = [fragmentRootType.name];
|
|
72673
72460
|
} else {
|
|
72674
72461
|
throw Error("unreachable code");
|
|
@@ -72704,7 +72491,7 @@ function inlineType({
|
|
|
72704
72491
|
);
|
|
72705
72492
|
}
|
|
72706
72493
|
);
|
|
72707
|
-
const parentIsUnionOrInterface = !
|
|
72494
|
+
const parentIsUnionOrInterface = !graphql19.isInterfaceType(type) && !graphql19.isUnionType(type);
|
|
72708
72495
|
const possibleTypenames = parentIsUnionOrInterface ? [parent.name] : config.schema.getPossibleTypes(type).map((type2) => type2.name);
|
|
72709
72496
|
const coveredTypenames = new Set(
|
|
72710
72497
|
Object.values(inlineFragmentSelections).flatMap((sel) => sel.coveredTypenames)
|
|
@@ -72771,7 +72558,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
72771
72558
|
},
|
|
72772
72559
|
type: schema.getType("String")
|
|
72773
72560
|
};
|
|
72774
|
-
} else if (
|
|
72561
|
+
} else if (graphql19.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
72775
72562
|
fields = rootType.ofType.getFields();
|
|
72776
72563
|
} else {
|
|
72777
72564
|
fields = rootType.getFields();
|
|
@@ -72783,7 +72570,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
72783
72570
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
72784
72571
|
});
|
|
72785
72572
|
}
|
|
72786
|
-
const fieldType =
|
|
72573
|
+
const fieldType = graphql19.getNamedType(field.type);
|
|
72787
72574
|
if (!fieldType) {
|
|
72788
72575
|
throw new HoudiniError({
|
|
72789
72576
|
filepath,
|
|
@@ -73292,7 +73079,7 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
73292
73079
|
|
|
73293
73080
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
73294
73081
|
var recast12 = __toESM(require_main2(), 1);
|
|
73295
|
-
import * as
|
|
73082
|
+
import * as graphql20 from "graphql";
|
|
73296
73083
|
var AST12 = recast12.types.builders;
|
|
73297
73084
|
async function imperativeCacheTypef(config, docs) {
|
|
73298
73085
|
const returnType = (doc) => config.plugins.find((plugin2) => plugin2.graphqlTagReturn)?.graphqlTagReturn?.({
|
|
@@ -73343,7 +73130,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
73343
73130
|
const operationTypes = [config.schema.getMutationType(), config.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
73344
73131
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
73345
73132
|
const types16 = Object.values(config.schema.getTypeMap()).filter(
|
|
73346
|
-
(type) => !
|
|
73133
|
+
(type) => !graphql20.isAbstractType(type) && !graphql20.isScalarType(type) && !graphql20.isEnumType(type) && !graphql20.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
73347
73134
|
);
|
|
73348
73135
|
const fragmentMap = fragmentListMap(
|
|
73349
73136
|
config,
|
|
@@ -73360,7 +73147,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
73360
73147
|
}
|
|
73361
73148
|
let idFields = AST12.tsNeverKeyword();
|
|
73362
73149
|
const keys2 = keyFieldsForType(config.configFile, type.name);
|
|
73363
|
-
if (
|
|
73150
|
+
if (graphql20.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
73364
73151
|
idFields = AST12.tsTypeLiteral(
|
|
73365
73152
|
keys2.map((key) => {
|
|
73366
73153
|
const fieldType = type.getFields()[key];
|
|
@@ -73387,13 +73174,13 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
73387
73174
|
idFields = AST12.tsTypeLiteral([]);
|
|
73388
73175
|
}
|
|
73389
73176
|
let fields = AST12.tsTypeLiteral([]);
|
|
73390
|
-
if (
|
|
73177
|
+
if (graphql20.isObjectType(type)) {
|
|
73391
73178
|
fields = AST12.tsTypeLiteral(
|
|
73392
73179
|
Object.entries(type.getFields()).map(
|
|
73393
73180
|
([key, fieldType]) => {
|
|
73394
73181
|
const unwrapped = unwrapType(config, fieldType.type);
|
|
73395
73182
|
let typeOptions = AST12.tsUnionType([]);
|
|
73396
|
-
if (
|
|
73183
|
+
if (graphql20.isScalarType(unwrapped.type)) {
|
|
73397
73184
|
typeOptions.types.push(
|
|
73398
73185
|
scalarPropertyValue(
|
|
73399
73186
|
config,
|
|
@@ -73407,11 +73194,11 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
73407
73194
|
}
|
|
73408
73195
|
)
|
|
73409
73196
|
);
|
|
73410
|
-
} else if (
|
|
73197
|
+
} else if (graphql20.isEnumType(unwrapped.type)) {
|
|
73411
73198
|
typeOptions.types.push(
|
|
73412
73199
|
AST12.tsTypeReference(AST12.identifier(unwrapped.type.name))
|
|
73413
73200
|
);
|
|
73414
|
-
} else if (!
|
|
73201
|
+
} else if (!graphql20.isAbstractType(unwrapped.type)) {
|
|
73415
73202
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
73416
73203
|
} else {
|
|
73417
73204
|
typeOptions.types.push(
|
|
@@ -73507,7 +73294,7 @@ function listDefinitions(config, filepath, body, docs) {
|
|
|
73507
73294
|
const lists = [];
|
|
73508
73295
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
73509
73296
|
for (const doc of docs) {
|
|
73510
|
-
|
|
73297
|
+
graphql20.visit(doc.document, {
|
|
73511
73298
|
Directive(node, key, parent2, path3, ancestors) {
|
|
73512
73299
|
if (![config.listDirective, config.paginateDirective].includes(node.name.value)) {
|
|
73513
73300
|
return;
|
|
@@ -73529,7 +73316,7 @@ function listDefinitions(config, filepath, body, docs) {
|
|
|
73529
73316
|
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
73530
73317
|
const { type: listType } = unwrapType(config, targetFieldDefinition.type);
|
|
73531
73318
|
const possibleTypes = [];
|
|
73532
|
-
if (
|
|
73319
|
+
if (graphql20.isAbstractType(listType)) {
|
|
73533
73320
|
possibleTypes.push(
|
|
73534
73321
|
...config.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
73535
73322
|
);
|
|
@@ -73691,7 +73478,7 @@ async function typescriptGenerator(config, docs) {
|
|
|
73691
73478
|
}
|
|
73692
73479
|
|
|
73693
73480
|
// src/codegen/generators/persistedQueries/index.ts
|
|
73694
|
-
import * as
|
|
73481
|
+
import * as graphql21 from "graphql";
|
|
73695
73482
|
async function persistOutputGenerator(config, docs) {
|
|
73696
73483
|
if (!config.persistedQueriesPath.endsWith(".json")) {
|
|
73697
73484
|
throw new Error('Can write Persisted Queries only in a ".json" file.');
|
|
@@ -73701,8 +73488,8 @@ async function persistOutputGenerator(config, docs) {
|
|
|
73701
73488
|
if (!generateArtifact) {
|
|
73702
73489
|
return acc;
|
|
73703
73490
|
}
|
|
73704
|
-
let rawString =
|
|
73705
|
-
|
|
73491
|
+
let rawString = graphql21.print(
|
|
73492
|
+
graphql21.visit(document, {
|
|
73706
73493
|
Directive(node) {
|
|
73707
73494
|
if (config.isInternalDirective(node.name.value)) {
|
|
73708
73495
|
return null;
|
|
@@ -73711,7 +73498,7 @@ async function persistOutputGenerator(config, docs) {
|
|
|
73711
73498
|
})
|
|
73712
73499
|
);
|
|
73713
73500
|
const operations = document.definitions.filter(
|
|
73714
|
-
({ kind }) => kind ===
|
|
73501
|
+
({ kind }) => kind === graphql21.Kind.OPERATION_DEFINITION
|
|
73715
73502
|
);
|
|
73716
73503
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
73717
73504
|
if (artifact) {
|
|
@@ -73726,33 +73513,45 @@ async function persistOutputGenerator(config, docs) {
|
|
|
73726
73513
|
}
|
|
73727
73514
|
|
|
73728
73515
|
// src/codegen/generators/definitions/index.ts
|
|
73729
|
-
import * as
|
|
73516
|
+
import * as graphql23 from "graphql";
|
|
73730
73517
|
|
|
73731
73518
|
// src/codegen/generators/definitions/enums.ts
|
|
73732
73519
|
var recast13 = __toESM(require_main2(), 1);
|
|
73733
|
-
import * as
|
|
73520
|
+
import * as graphql22 from "graphql";
|
|
73734
73521
|
var AST13 = recast13.types.builders;
|
|
73735
73522
|
async function definitionsGenerator(config) {
|
|
73736
|
-
const enums =
|
|
73523
|
+
const enums = graphql22.parse(graphql22.printSchema(config.schema)).definitions.filter(
|
|
73737
73524
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
73738
73525
|
).filter((def) => !config.isInternalEnum(def));
|
|
73739
73526
|
const { code: runtimeDefinitions } = await printJS(
|
|
73740
73527
|
AST13.program(
|
|
73741
73528
|
enums.map((defn) => {
|
|
73742
73529
|
const name = defn.name.value;
|
|
73743
|
-
|
|
73530
|
+
const declaration = moduleExport(
|
|
73744
73531
|
config,
|
|
73745
73532
|
name,
|
|
73746
73533
|
AST13.objectExpression(
|
|
73747
73534
|
defn.values?.map((value) => {
|
|
73748
73535
|
const str = value.name.value;
|
|
73749
|
-
|
|
73536
|
+
const prop = AST13.objectProperty(
|
|
73750
73537
|
AST13.stringLiteral(str),
|
|
73751
73538
|
AST13.stringLiteral(str)
|
|
73752
73539
|
);
|
|
73540
|
+
const deprecationReason = value.directives?.find((d3) => d3.name.value === "deprecated")?.arguments?.find((a2) => a2.name.value === "reason")?.value?.value;
|
|
73541
|
+
if (value.description || deprecationReason)
|
|
73542
|
+
prop.comments = [
|
|
73543
|
+
jsdocComment(value.description?.value ?? "", deprecationReason)
|
|
73544
|
+
];
|
|
73545
|
+
return prop;
|
|
73753
73546
|
}) || []
|
|
73754
73547
|
)
|
|
73755
73548
|
);
|
|
73549
|
+
if (defn.description) {
|
|
73550
|
+
declaration.comments = [
|
|
73551
|
+
AST13.commentBlock(`* ${defn.description.value} `, true, false)
|
|
73552
|
+
];
|
|
73553
|
+
}
|
|
73554
|
+
return declaration;
|
|
73756
73555
|
})
|
|
73757
73556
|
)
|
|
73758
73557
|
);
|
|
@@ -73761,11 +73560,19 @@ type ValuesOf<T> = T[keyof T]
|
|
|
73761
73560
|
` + enums.sort((a2, b2) => a2.name.value.localeCompare(b2.name.value)).map((definition) => {
|
|
73762
73561
|
const name = definition.name.value;
|
|
73763
73562
|
const values = definition.values;
|
|
73764
|
-
|
|
73563
|
+
let jsdoc = "";
|
|
73564
|
+
if (definition.description) {
|
|
73565
|
+
jsdoc = `
|
|
73566
|
+
/** ${definition.description.value} */`;
|
|
73567
|
+
}
|
|
73568
|
+
return `${jsdoc}
|
|
73765
73569
|
export declare const ${name}: {
|
|
73766
|
-
${values?.map(
|
|
73570
|
+
${values?.map(
|
|
73571
|
+
(value) => (value.description ? ` /** ${value.description.value} */
|
|
73572
|
+
` : "") + ` readonly ${value.name.value}: "${value.name.value}";`
|
|
73573
|
+
).join("\n")}
|
|
73767
73574
|
}
|
|
73768
|
-
|
|
73575
|
+
${jsdoc}
|
|
73769
73576
|
export type ${name}$options = ValuesOf<typeof ${name}>
|
|
73770
73577
|
`;
|
|
73771
73578
|
}).join("");
|
|
@@ -73785,7 +73592,7 @@ async function schemaGenerator(config) {
|
|
|
73785
73592
|
await Promise.all([
|
|
73786
73593
|
fs_exports.writeFile(
|
|
73787
73594
|
config.definitionsSchemaPath,
|
|
73788
|
-
config.localSchema ?
|
|
73595
|
+
config.localSchema ? graphql23.printSchema(config.schema) : config.newSchema
|
|
73789
73596
|
),
|
|
73790
73597
|
fs_exports.writeFile(config.definitionsDocumentsPath, config.newDocuments),
|
|
73791
73598
|
definitionsGenerator(config)
|
|
@@ -75490,7 +75297,7 @@ function mergeGraphQLTypes2(typeSource, config) {
|
|
|
75490
75297
|
}
|
|
75491
75298
|
|
|
75492
75299
|
// src/codegen/transforms/schema.ts
|
|
75493
|
-
import * as
|
|
75300
|
+
import * as graphql24 from "graphql";
|
|
75494
75301
|
async function graphqlExtensions(config, documents) {
|
|
75495
75302
|
let internalSchema = `
|
|
75496
75303
|
enum CachePolicy {
|
|
@@ -75613,7 +75420,7 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
|
|
|
75613
75420
|
const args = fragmentArguments(config, "", field.parent);
|
|
75614
75421
|
if (args.length > 0) {
|
|
75615
75422
|
argString = "(" + args.map((arg) => {
|
|
75616
|
-
const typeName =
|
|
75423
|
+
const typeName = graphql24.print(arg.type);
|
|
75617
75424
|
return `${arg.name}:${typeName}${arg.required ? "!" : ""}`;
|
|
75618
75425
|
}).join("\n") + ")";
|
|
75619
75426
|
}
|
|
@@ -75623,20 +75430,20 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
|
|
|
75623
75430
|
`;
|
|
75624
75431
|
}).join("\n");
|
|
75625
75432
|
extensions += `${Object.keys(config.configFile.features?.runtimeScalars ?? {}).map((scalar) => `scalar ${scalar}`).join("\n")}`;
|
|
75626
|
-
config.newSchema =
|
|
75433
|
+
config.newSchema = graphql24.print(mergeTypeDefs2([internalSchema, config.newSchema]));
|
|
75627
75434
|
config.schemaString += extensions;
|
|
75628
|
-
config.schema =
|
|
75629
|
-
|
|
75630
|
-
mergeTypeDefs2([
|
|
75435
|
+
config.schema = graphql24.buildSchema(
|
|
75436
|
+
graphql24.print(
|
|
75437
|
+
mergeTypeDefs2([graphql24.printSchema(config.schema), internalSchema, extensions])
|
|
75631
75438
|
)
|
|
75632
75439
|
);
|
|
75633
75440
|
}
|
|
75634
75441
|
|
|
75635
75442
|
// src/codegen/transforms/typename.ts
|
|
75636
|
-
import * as
|
|
75443
|
+
import * as graphql25 from "graphql";
|
|
75637
75444
|
async function addTypename(config, documents) {
|
|
75638
75445
|
for (const doc of documents) {
|
|
75639
|
-
doc.document =
|
|
75446
|
+
doc.document = graphql25.visit(doc.document, {
|
|
75640
75447
|
Field(node, key, parent2, path3, ancestors) {
|
|
75641
75448
|
if (!node.selectionSet) {
|
|
75642
75449
|
return;
|
|
@@ -75648,7 +75455,7 @@ async function addTypename(config, documents) {
|
|
|
75648
75455
|
);
|
|
75649
75456
|
const field = type.getFields()[node.name.value];
|
|
75650
75457
|
const fieldType = unwrapType(config, field.type).type;
|
|
75651
|
-
if (
|
|
75458
|
+
if (graphql25.isInterfaceType(fieldType) || graphql25.isUnionType(fieldType)) {
|
|
75652
75459
|
return {
|
|
75653
75460
|
...node,
|
|
75654
75461
|
selectionSet: {
|
|
@@ -75656,9 +75463,9 @@ async function addTypename(config, documents) {
|
|
|
75656
75463
|
selections: [
|
|
75657
75464
|
...node.selectionSet.selections,
|
|
75658
75465
|
{
|
|
75659
|
-
kind:
|
|
75466
|
+
kind: graphql25.Kind.FIELD,
|
|
75660
75467
|
name: {
|
|
75661
|
-
kind:
|
|
75468
|
+
kind: graphql25.Kind.NAME,
|
|
75662
75469
|
value: "__typename"
|
|
75663
75470
|
}
|
|
75664
75471
|
}
|
|
@@ -75675,9 +75482,9 @@ async function addTypename(config, documents) {
|
|
|
75675
75482
|
selections: [
|
|
75676
75483
|
...node.selectionSet.selections,
|
|
75677
75484
|
{
|
|
75678
|
-
kind:
|
|
75485
|
+
kind: graphql25.Kind.FIELD,
|
|
75679
75486
|
name: {
|
|
75680
|
-
kind:
|
|
75487
|
+
kind: graphql25.Kind.NAME,
|
|
75681
75488
|
value: "__typename"
|
|
75682
75489
|
}
|
|
75683
75490
|
}
|
|
@@ -75690,10 +75497,10 @@ async function addTypename(config, documents) {
|
|
|
75690
75497
|
}
|
|
75691
75498
|
|
|
75692
75499
|
// src/codegen/transforms/addID.ts
|
|
75693
|
-
import * as
|
|
75500
|
+
import * as graphql26 from "graphql";
|
|
75694
75501
|
async function addID(config, documents) {
|
|
75695
75502
|
for (const doc of documents) {
|
|
75696
|
-
doc.document =
|
|
75503
|
+
doc.document = graphql26.visit(doc.document, {
|
|
75697
75504
|
Field(node, key, parent2, path3, ancestors) {
|
|
75698
75505
|
if (!node.selectionSet) {
|
|
75699
75506
|
return;
|
|
@@ -75731,7 +75538,7 @@ function addKeysToSelection(config, node, fieldType) {
|
|
|
75731
75538
|
if (!node.selectionSet || node.selectionSet.selections.length == 0) {
|
|
75732
75539
|
return;
|
|
75733
75540
|
}
|
|
75734
|
-
if (!
|
|
75541
|
+
if (!graphql26.isObjectType(fieldType) && !graphql26.isInterfaceType(fieldType)) {
|
|
75735
75542
|
return;
|
|
75736
75543
|
}
|
|
75737
75544
|
const keyFields = config.keyFieldsForType(fieldType.name);
|
|
@@ -75746,9 +75553,9 @@ function addKeysToSelection(config, node, fieldType) {
|
|
|
75746
75553
|
continue;
|
|
75747
75554
|
}
|
|
75748
75555
|
selections.push({
|
|
75749
|
-
kind:
|
|
75556
|
+
kind: graphql26.Kind.FIELD,
|
|
75750
75557
|
name: {
|
|
75751
|
-
kind:
|
|
75558
|
+
kind: graphql26.Kind.NAME,
|
|
75752
75559
|
value: keyField
|
|
75753
75560
|
}
|
|
75754
75561
|
});
|
|
@@ -75763,13 +75570,13 @@ function addKeysToSelection(config, node, fieldType) {
|
|
|
75763
75570
|
}
|
|
75764
75571
|
|
|
75765
75572
|
// src/codegen/transforms/componentFields.ts
|
|
75766
|
-
import * as
|
|
75573
|
+
import * as graphql27 from "graphql";
|
|
75767
75574
|
async function componentFields(config, documents) {
|
|
75768
75575
|
for (const document of documents) {
|
|
75769
|
-
const typeInfo = new
|
|
75770
|
-
document.document =
|
|
75576
|
+
const typeInfo = new graphql27.TypeInfo(config.schema);
|
|
75577
|
+
document.document = graphql27.visit(
|
|
75771
75578
|
document.document,
|
|
75772
|
-
|
|
75579
|
+
graphql27.visitWithTypeInfo(typeInfo, {
|
|
75773
75580
|
Field(node) {
|
|
75774
75581
|
const parentType = typeInfo.getParentType();
|
|
75775
75582
|
if (!parentType) {
|
|
@@ -75818,10 +75625,10 @@ async function componentFields(config, documents) {
|
|
|
75818
75625
|
}
|
|
75819
75626
|
|
|
75820
75627
|
// src/codegen/transforms/runtimeScalars.ts
|
|
75821
|
-
import * as
|
|
75628
|
+
import * as graphql28 from "graphql";
|
|
75822
75629
|
async function addTypename2(config, documents) {
|
|
75823
75630
|
for (const doc of documents) {
|
|
75824
|
-
doc.document =
|
|
75631
|
+
doc.document = graphql28.visit(doc.document, {
|
|
75825
75632
|
VariableDefinition(node) {
|
|
75826
75633
|
const { type, wrappers } = unwrapType(config, node.type);
|
|
75827
75634
|
const runtimeScalar = config.configFile.features?.runtimeScalars?.[type.name];
|
|
@@ -75860,7 +75667,7 @@ async function addTypename2(config, documents) {
|
|
|
75860
75667
|
}
|
|
75861
75668
|
|
|
75862
75669
|
// src/codegen/validators/typeCheck.ts
|
|
75863
|
-
import * as
|
|
75670
|
+
import * as graphql29 from "graphql";
|
|
75864
75671
|
async function typeCheck(config, docs) {
|
|
75865
75672
|
const errors = [];
|
|
75866
75673
|
const freeLists = [];
|
|
@@ -75868,7 +75675,7 @@ async function typeCheck(config, docs) {
|
|
|
75868
75675
|
const listTypes = [];
|
|
75869
75676
|
const fragments = {};
|
|
75870
75677
|
for (const { document: parsed, originalString, filename } of docs) {
|
|
75871
|
-
|
|
75678
|
+
graphql29.visit(parsed, {
|
|
75872
75679
|
FragmentDefinition(definition) {
|
|
75873
75680
|
fragments[definition.name.value] = definition;
|
|
75874
75681
|
},
|
|
@@ -75913,14 +75720,14 @@ async function typeCheck(config, docs) {
|
|
|
75913
75720
|
);
|
|
75914
75721
|
return;
|
|
75915
75722
|
}
|
|
75916
|
-
if (
|
|
75723
|
+
if (graphql29.isListType(rootType) || graphql29.isNonNullType(rootType) && graphql29.isListType(rootType.ofType)) {
|
|
75917
75724
|
needsParent = true;
|
|
75918
75725
|
break;
|
|
75919
75726
|
}
|
|
75920
|
-
if (
|
|
75727
|
+
if (graphql29.isNonNullType(rootType) && "ofType" in rootType) {
|
|
75921
75728
|
rootType = rootType.ofType;
|
|
75922
75729
|
}
|
|
75923
|
-
if (
|
|
75730
|
+
if (graphql29.isScalarType(rootType)) {
|
|
75924
75731
|
break;
|
|
75925
75732
|
}
|
|
75926
75733
|
rootType = rootType?.getFields()[parent3.name.value]?.type;
|
|
@@ -75996,9 +75803,9 @@ async function typeCheck(config, docs) {
|
|
|
75996
75803
|
);
|
|
75997
75804
|
}
|
|
75998
75805
|
let targetTypes = [type];
|
|
75999
|
-
if (
|
|
75806
|
+
if (graphql29.isUnionType(type)) {
|
|
76000
75807
|
targetTypes = config.schema.getPossibleTypes(type);
|
|
76001
|
-
} else if (
|
|
75808
|
+
} else if (graphql29.isInterfaceType(type)) {
|
|
76002
75809
|
try {
|
|
76003
75810
|
for (const key of config.keyFieldsForType(type.name)) {
|
|
76004
75811
|
if (!type.getFields()[key]) {
|
|
@@ -76034,13 +75841,13 @@ async function typeCheck(config, docs) {
|
|
|
76034
75841
|
if (errors.length > 0) {
|
|
76035
75842
|
throw errors;
|
|
76036
75843
|
}
|
|
76037
|
-
const rules = (filepath) => [...
|
|
75844
|
+
const rules = (filepath) => [...graphql29.specifiedRules].filter(
|
|
76038
75845
|
(rule) => ![
|
|
76039
|
-
|
|
76040
|
-
|
|
76041
|
-
|
|
76042
|
-
|
|
76043
|
-
|
|
75846
|
+
graphql29.NoUnusedFragmentsRule,
|
|
75847
|
+
graphql29.KnownFragmentNamesRule,
|
|
75848
|
+
graphql29.ExecutableDefinitionsRule,
|
|
75849
|
+
graphql29.KnownDirectivesRule,
|
|
75850
|
+
graphql29.KnownArgumentNamesRule
|
|
76044
75851
|
].includes(rule)
|
|
76045
75852
|
).concat(
|
|
76046
75853
|
validateLists({
|
|
@@ -76061,7 +75868,7 @@ async function typeCheck(config, docs) {
|
|
|
76061
75868
|
validateLoadingDirective(config)
|
|
76062
75869
|
);
|
|
76063
75870
|
for (const { filename, document: parsed, originalString } of docs) {
|
|
76064
|
-
for (const error of
|
|
75871
|
+
for (const error of graphql29.validate(config.schema, parsed, rules(filename))) {
|
|
76065
75872
|
errors.push(
|
|
76066
75873
|
new HoudiniError({
|
|
76067
75874
|
filepath: filename,
|
|
@@ -76090,20 +75897,20 @@ function validateRequiredDirective(config, filepath) {
|
|
|
76090
75897
|
if (!node.directives?.some(({ name }) => name.value === config.requiredDirective))
|
|
76091
75898
|
return;
|
|
76092
75899
|
const parentType = parentTypeFromAncestors(config.schema, filepath, ancestors);
|
|
76093
|
-
if (!
|
|
75900
|
+
if (!graphql29.isObjectType(parentType)) {
|
|
76094
75901
|
ctx.reportError(
|
|
76095
|
-
new
|
|
75902
|
+
new graphql29.GraphQLError(
|
|
76096
75903
|
`@${config.requiredDirective} may only be used on objects, not arguments`
|
|
76097
75904
|
)
|
|
76098
75905
|
);
|
|
76099
75906
|
return;
|
|
76100
75907
|
}
|
|
76101
75908
|
const type = parentType.getFields()[node.name.value].type;
|
|
76102
|
-
const isServerNullable = !
|
|
75909
|
+
const isServerNullable = !graphql29.isNonNullType(type);
|
|
76103
75910
|
const isAlreadyClientNullable = isClientNullable(node, true);
|
|
76104
75911
|
if (!isServerNullable && !isAlreadyClientNullable) {
|
|
76105
75912
|
ctx.reportError(
|
|
76106
|
-
new
|
|
75913
|
+
new graphql29.GraphQLError(
|
|
76107
75914
|
`@${config.requiredDirective} may only be used on nullable fields`
|
|
76108
75915
|
)
|
|
76109
75916
|
);
|
|
@@ -76125,7 +75932,7 @@ var validateLists = ({
|
|
|
76125
75932
|
if (!config.isListFragment(node.name.value)) {
|
|
76126
75933
|
if (!fragments[node.name.value]) {
|
|
76127
75934
|
ctx.reportError(
|
|
76128
|
-
new
|
|
75935
|
+
new graphql29.GraphQLError(
|
|
76129
75936
|
"Encountered unknown fragment: " + node.name.value
|
|
76130
75937
|
)
|
|
76131
75938
|
);
|
|
@@ -76135,7 +75942,7 @@ var validateLists = ({
|
|
|
76135
75942
|
const listName = config.listNameFromFragment(node.name.value);
|
|
76136
75943
|
if (!lists.includes(listName)) {
|
|
76137
75944
|
ctx.reportError(
|
|
76138
|
-
new
|
|
75945
|
+
new graphql29.GraphQLError(
|
|
76139
75946
|
"Encountered fragment referencing unknown list: " + listName
|
|
76140
75947
|
)
|
|
76141
75948
|
);
|
|
@@ -76160,7 +75967,7 @@ var validateLists = ({
|
|
|
76160
75967
|
);
|
|
76161
75968
|
if (parentArg) {
|
|
76162
75969
|
ctx.reportError(
|
|
76163
|
-
new
|
|
75970
|
+
new graphql29.GraphQLError(
|
|
76164
75971
|
`@${config.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
|
|
76165
75972
|
)
|
|
76166
75973
|
);
|
|
@@ -76176,7 +75983,7 @@ var validateLists = ({
|
|
|
76176
75983
|
return;
|
|
76177
75984
|
}
|
|
76178
75985
|
ctx.reportError(
|
|
76179
|
-
new
|
|
75986
|
+
new graphql29.GraphQLError(
|
|
76180
75987
|
`For this list fragment, you need to add or @${config.listParentDirective} or @${config.listAllListsDirective} directive to specify the behavior`
|
|
76181
75988
|
)
|
|
76182
75989
|
);
|
|
@@ -76186,7 +75993,7 @@ var validateLists = ({
|
|
|
76186
75993
|
const directiveName = node.name.value;
|
|
76187
75994
|
if (directiveName === "connection") {
|
|
76188
75995
|
ctx.reportError(
|
|
76189
|
-
new
|
|
75996
|
+
new graphql29.GraphQLError(
|
|
76190
75997
|
"@connection was renamed to @list. Please change your components. If you were using `cache.connection` in your components, you will need to update that to `cache.list` too."
|
|
76191
75998
|
)
|
|
76192
75999
|
);
|
|
@@ -76195,7 +76002,7 @@ var validateLists = ({
|
|
|
76195
76002
|
if (!config.isInternalDirective(node.name.value)) {
|
|
76196
76003
|
if (!config.schema.getDirective(directiveName)) {
|
|
76197
76004
|
ctx.reportError(
|
|
76198
|
-
new
|
|
76005
|
+
new graphql29.GraphQLError(
|
|
76199
76006
|
"Encountered unknown directive: " + directiveName
|
|
76200
76007
|
)
|
|
76201
76008
|
);
|
|
@@ -76204,7 +76011,7 @@ var validateLists = ({
|
|
|
76204
76011
|
}
|
|
76205
76012
|
if (config.isListOperationDirective(directiveName) && !listTypes.includes(config.listNameFromDirective(directiveName))) {
|
|
76206
76013
|
ctx.reportError(
|
|
76207
|
-
new
|
|
76014
|
+
new graphql29.GraphQLError(
|
|
76208
76015
|
"Encountered directive referencing unknown list: " + directiveName
|
|
76209
76016
|
)
|
|
76210
76017
|
);
|
|
@@ -76215,7 +76022,7 @@ var validateLists = ({
|
|
|
76215
76022
|
};
|
|
76216
76023
|
function knownArguments(config) {
|
|
76217
76024
|
return function(ctx) {
|
|
76218
|
-
const nativeValidator =
|
|
76025
|
+
const nativeValidator = graphql29.KnownArgumentNamesRule(ctx);
|
|
76219
76026
|
return {
|
|
76220
76027
|
...nativeValidator,
|
|
76221
76028
|
Directive(directiveNode) {
|
|
@@ -76250,7 +76057,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
76250
76057
|
for (const arg of node.arguments || []) {
|
|
76251
76058
|
if (arg.value.kind !== "ObjectValue") {
|
|
76252
76059
|
ctx.reportError(
|
|
76253
|
-
new
|
|
76060
|
+
new graphql29.GraphQLError("values in @arguments must be an object")
|
|
76254
76061
|
);
|
|
76255
76062
|
return;
|
|
76256
76063
|
}
|
|
@@ -76260,13 +76067,13 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
76260
76067
|
);
|
|
76261
76068
|
if (!typeArg) {
|
|
76262
76069
|
ctx.reportError(
|
|
76263
|
-
new
|
|
76070
|
+
new graphql29.GraphQLError("missing type field for @arguments directive")
|
|
76264
76071
|
);
|
|
76265
76072
|
return;
|
|
76266
76073
|
}
|
|
76267
|
-
if (typeArg.value.kind !==
|
|
76074
|
+
if (typeArg.value.kind !== graphql29.Kind.STRING) {
|
|
76268
76075
|
ctx.reportError(
|
|
76269
|
-
new
|
|
76076
|
+
new graphql29.GraphQLError("type field to @arguments must be a string")
|
|
76270
76077
|
);
|
|
76271
76078
|
return;
|
|
76272
76079
|
}
|
|
@@ -76279,7 +76086,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
76279
76086
|
);
|
|
76280
76087
|
if (typeArg.value.value !== defaultValueType) {
|
|
76281
76088
|
ctx.reportError(
|
|
76282
|
-
new
|
|
76089
|
+
new graphql29.GraphQLError(
|
|
76283
76090
|
`Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
|
|
76284
76091
|
)
|
|
76285
76092
|
);
|
|
@@ -76297,7 +76104,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
76297
76104
|
try {
|
|
76298
76105
|
args = fragmentArguments(config, filepath, fragments[fragmentName]);
|
|
76299
76106
|
} catch (e3) {
|
|
76300
|
-
ctx.reportError(new
|
|
76107
|
+
ctx.reportError(new graphql29.GraphQLError(e3.message));
|
|
76301
76108
|
return;
|
|
76302
76109
|
}
|
|
76303
76110
|
fragmentArguments2[fragmentName] = args;
|
|
@@ -76320,7 +76127,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
76320
76127
|
);
|
|
76321
76128
|
if (missing.length > 0) {
|
|
76322
76129
|
ctx.reportError(
|
|
76323
|
-
new
|
|
76130
|
+
new graphql29.GraphQLError(
|
|
76324
76131
|
`The following arguments are missing from the "${fragmentName}" fragment: ` + JSON.stringify(missing)
|
|
76325
76132
|
)
|
|
76326
76133
|
);
|
|
@@ -76331,7 +76138,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
76331
76138
|
);
|
|
76332
76139
|
if (unknown.length > 0) {
|
|
76333
76140
|
ctx.reportError(
|
|
76334
|
-
new
|
|
76141
|
+
new graphql29.GraphQLError(
|
|
76335
76142
|
"Encountered unknown arguments: " + JSON.stringify(unknown)
|
|
76336
76143
|
)
|
|
76337
76144
|
);
|
|
@@ -76343,7 +76150,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
76343
76150
|
for (const [applied, target] of zipped) {
|
|
76344
76151
|
if (!valueIsType(config, applied.value, target)) {
|
|
76345
76152
|
ctx.reportError(
|
|
76346
|
-
new
|
|
76153
|
+
new graphql29.GraphQLError(
|
|
76347
76154
|
`Invalid argument type. Expected ${target}, found ${applied.value.kind}`
|
|
76348
76155
|
)
|
|
76349
76156
|
);
|
|
@@ -76385,7 +76192,7 @@ function valueIsType(config, value, targetType) {
|
|
|
76385
76192
|
}
|
|
76386
76193
|
if (value.kind === "EnumValue" && targetType.kind === "NamedType") {
|
|
76387
76194
|
const enumType = config.schema.getType(targetType.name.value);
|
|
76388
|
-
if (!
|
|
76195
|
+
if (!graphql29.isEnumType(enumType)) {
|
|
76389
76196
|
return false;
|
|
76390
76197
|
}
|
|
76391
76198
|
return enumType.getValues().some((enumValue) => enumValue.value === value.value);
|
|
@@ -76405,7 +76212,7 @@ function paginateArgs(config, filepath) {
|
|
|
76405
76212
|
}
|
|
76406
76213
|
if (alreadyPaginated) {
|
|
76407
76214
|
ctx.reportError(
|
|
76408
|
-
new
|
|
76215
|
+
new graphql29.GraphQLError(
|
|
76409
76216
|
`@${config.paginateDirective} can only appear in a document once.`
|
|
76410
76217
|
)
|
|
76411
76218
|
);
|
|
@@ -76437,7 +76244,7 @@ function paginateArgs(config, filepath) {
|
|
|
76437
76244
|
const backwards = appliedArgs.has("last");
|
|
76438
76245
|
if (!forward && !backwards) {
|
|
76439
76246
|
ctx.reportError(
|
|
76440
|
-
new
|
|
76247
|
+
new graphql29.GraphQLError(
|
|
76441
76248
|
"A field with cursor-based pagination must have a first or last argument"
|
|
76442
76249
|
)
|
|
76443
76250
|
);
|
|
@@ -76451,7 +76258,7 @@ function paginateArgs(config, filepath) {
|
|
|
76451
76258
|
}
|
|
76452
76259
|
if (forward && backwards && paginateMode === "Infinite") {
|
|
76453
76260
|
ctx.reportError(
|
|
76454
|
-
new
|
|
76261
|
+
new graphql29.GraphQLError(
|
|
76455
76262
|
`A field with cursor pagination cannot go forwards an backwards simultaneously`
|
|
76456
76263
|
)
|
|
76457
76264
|
);
|
|
@@ -76465,7 +76272,7 @@ function paginateArgs(config, filepath) {
|
|
|
76465
76272
|
);
|
|
76466
76273
|
if (!appliedLimitArg) {
|
|
76467
76274
|
ctx.reportError(
|
|
76468
|
-
new
|
|
76275
|
+
new graphql29.GraphQLError(
|
|
76469
76276
|
"A field with offset-based pagination must have a limit argument"
|
|
76470
76277
|
)
|
|
76471
76278
|
);
|
|
@@ -76481,20 +76288,20 @@ function noUnusedFragmentArguments(config) {
|
|
|
76481
76288
|
const args = /* @__PURE__ */ new Set();
|
|
76482
76289
|
return {
|
|
76483
76290
|
enter(node) {
|
|
76484
|
-
if (node.kind ===
|
|
76291
|
+
if (node.kind === graphql29.Kind.FRAGMENT_DEFINITION) {
|
|
76485
76292
|
const definitionArguments = node.directives?.filter((directive) => directive.name.value === config.argumentsDirective).flatMap((directive) => directive.arguments);
|
|
76486
76293
|
for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
|
|
76487
76294
|
args.add(arg);
|
|
76488
76295
|
}
|
|
76489
|
-
} else if (node.kind ===
|
|
76296
|
+
} else if (node.kind === graphql29.Kind.VARIABLE) {
|
|
76490
76297
|
args.delete(node.name.value);
|
|
76491
76298
|
}
|
|
76492
76299
|
},
|
|
76493
76300
|
leave(node) {
|
|
76494
|
-
if (node.kind ===
|
|
76301
|
+
if (node.kind === graphql29.Kind.FRAGMENT_DEFINITION) {
|
|
76495
76302
|
if (args.size > 0) {
|
|
76496
76303
|
ctx.reportError(
|
|
76497
|
-
new
|
|
76304
|
+
new graphql29.GraphQLError(
|
|
76498
76305
|
"Encountered unused fragment arguments: " + [...args].join(",")
|
|
76499
76306
|
)
|
|
76500
76307
|
);
|
|
@@ -76530,7 +76337,7 @@ function nodeDirectives(config, directives) {
|
|
|
76530
76337
|
if (definition.kind === "OperationDefinition") {
|
|
76531
76338
|
if (definition.operation !== "query") {
|
|
76532
76339
|
ctx.reportError(
|
|
76533
|
-
new
|
|
76340
|
+
new graphql29.GraphQLError(
|
|
76534
76341
|
`@${node.name.value} must fall on a fragment or query document`
|
|
76535
76342
|
)
|
|
76536
76343
|
);
|
|
@@ -76542,7 +76349,7 @@ function nodeDirectives(config, directives) {
|
|
|
76542
76349
|
}
|
|
76543
76350
|
if (!possibleNodes.includes(definitionType)) {
|
|
76544
76351
|
ctx.reportError(
|
|
76545
|
-
new
|
|
76352
|
+
new graphql29.GraphQLError(paginateOnNonNodeMessage(node.name.value))
|
|
76546
76353
|
);
|
|
76547
76354
|
}
|
|
76548
76355
|
}
|
|
@@ -76561,7 +76368,7 @@ function checkMutationOperation(config) {
|
|
|
76561
76368
|
);
|
|
76562
76369
|
if (append && prepend) {
|
|
76563
76370
|
ctx.reportError(
|
|
76564
|
-
new
|
|
76371
|
+
new graphql29.GraphQLError(
|
|
76565
76372
|
`You can't apply both @${config.listPrependDirective} and @${config.listAppendDirective} at the same time`
|
|
76566
76373
|
)
|
|
76567
76374
|
);
|
|
@@ -76575,7 +76382,7 @@ function checkMutationOperation(config) {
|
|
|
76575
76382
|
);
|
|
76576
76383
|
if (parentId && allLists) {
|
|
76577
76384
|
ctx.reportError(
|
|
76578
|
-
new
|
|
76385
|
+
new graphql29.GraphQLError(
|
|
76579
76386
|
`You can't apply both @${config.listParentDirective} and @${config.listAllListsDirective} at the same time`
|
|
76580
76387
|
)
|
|
76581
76388
|
);
|
|
@@ -76597,7 +76404,7 @@ function checkMaskDirectives(config) {
|
|
|
76597
76404
|
);
|
|
76598
76405
|
if (maskEnableDirective && maskDisableDirective) {
|
|
76599
76406
|
ctx.reportError(
|
|
76600
|
-
new
|
|
76407
|
+
new graphql29.GraphQLError(
|
|
76601
76408
|
`You can't apply both @${config.maskEnableDirective} and @${config.maskDisableDirective} at the same time`
|
|
76602
76409
|
)
|
|
76603
76410
|
);
|
|
@@ -76639,7 +76446,7 @@ function validateLoadingDirective(config) {
|
|
|
76639
76446
|
);
|
|
76640
76447
|
if (!parentLoading && !global2) {
|
|
76641
76448
|
ctx.reportError(
|
|
76642
|
-
new
|
|
76449
|
+
new graphql29.GraphQLError(
|
|
76643
76450
|
`@${config.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config.loadingDirective}`
|
|
76644
76451
|
)
|
|
76645
76452
|
);
|
|
@@ -76661,7 +76468,7 @@ function validateLoadingDirective(config) {
|
|
|
76661
76468
|
);
|
|
76662
76469
|
if (!parentLoading && !global2) {
|
|
76663
76470
|
ctx.reportError(
|
|
76664
|
-
new
|
|
76471
|
+
new graphql29.GraphQLError(
|
|
76665
76472
|
`@${config.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config.loadingDirective}`
|
|
76666
76473
|
)
|
|
76667
76474
|
);
|
|
@@ -76676,7 +76483,7 @@ function getAndVerifyNodeInterface(config) {
|
|
|
76676
76483
|
if (!nodeInterface) {
|
|
76677
76484
|
return null;
|
|
76678
76485
|
}
|
|
76679
|
-
if (!
|
|
76486
|
+
if (!graphql29.isInterfaceType(nodeInterface)) {
|
|
76680
76487
|
displayInvalidNodeFieldMessage(config);
|
|
76681
76488
|
return null;
|
|
76682
76489
|
}
|
|
@@ -76771,11 +76578,11 @@ async function uniqueDocumentNames(config, docs) {
|
|
|
76771
76578
|
}
|
|
76772
76579
|
|
|
76773
76580
|
// src/codegen/validators/noIDAlias.ts
|
|
76774
|
-
import * as
|
|
76581
|
+
import * as graphql30 from "graphql";
|
|
76775
76582
|
async function noIDAlias(config, docs) {
|
|
76776
76583
|
const errors = [];
|
|
76777
76584
|
for (const { filename, document } of docs) {
|
|
76778
|
-
|
|
76585
|
+
graphql30.visit(document, {
|
|
76779
76586
|
Field(node, _3, __, ___, ancestors) {
|
|
76780
76587
|
const fieldType = parentTypeFromAncestors(config.schema, filename, ancestors).name;
|
|
76781
76588
|
if (config.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
|
|
@@ -76814,11 +76621,11 @@ async function validatePlugins(config, documents) {
|
|
|
76814
76621
|
}
|
|
76815
76622
|
|
|
76816
76623
|
// src/codegen/validators/componentFields.ts
|
|
76817
|
-
import * as
|
|
76624
|
+
import * as graphql31 from "graphql";
|
|
76818
76625
|
async function componentFields2(config, docs) {
|
|
76819
76626
|
const errors = [];
|
|
76820
76627
|
for (const { filename: filepath, document } of docs) {
|
|
76821
|
-
|
|
76628
|
+
graphql31.visit(document, {
|
|
76822
76629
|
FragmentDefinition(node, _3, __, ___, ancestors) {
|
|
76823
76630
|
const componentFieldDirective = node.directives?.find(
|
|
76824
76631
|
(dir) => dir.name.value === config.componentFieldDirective
|
|
@@ -76866,7 +76673,7 @@ async function componentFields2(config, docs) {
|
|
|
76866
76673
|
if (existingField && existingField.filepath !== filepath) {
|
|
76867
76674
|
conflict = true;
|
|
76868
76675
|
} else if (parentType && fieldValue) {
|
|
76869
|
-
const fieldDef =
|
|
76676
|
+
const fieldDef = graphql31.isObjectType(parentType) && parentType.getFields()[fieldValue];
|
|
76870
76677
|
if (fieldDef && !fieldDef.astNode?.directives?.find(
|
|
76871
76678
|
(dir) => dir.name.value === config.componentFieldDirective
|
|
76872
76679
|
)) {
|
|
@@ -76879,7 +76686,7 @@ async function componentFields2(config, docs) {
|
|
|
76879
76686
|
filepath
|
|
76880
76687
|
});
|
|
76881
76688
|
}
|
|
76882
|
-
if (parentType &&
|
|
76689
|
+
if (parentType && graphql31.isAbstractType(parentType)) {
|
|
76883
76690
|
errors.push({
|
|
76884
76691
|
message: `Cannot add component field ${parent2}.${fieldValue} because ${parent2} is an abstract type`,
|
|
76885
76692
|
filepath
|
|
@@ -77100,12 +76907,12 @@ async function processJSFile(config, contents) {
|
|
|
77100
76907
|
return documents;
|
|
77101
76908
|
}
|
|
77102
76909
|
async function processGraphQLDocument(config, filepath, document) {
|
|
77103
|
-
const parsedDoc =
|
|
76910
|
+
const parsedDoc = graphql32.parse(document);
|
|
77104
76911
|
const operations = parsedDoc.definitions.filter(
|
|
77105
|
-
({ kind: kind2 }) => kind2 ===
|
|
76912
|
+
({ kind: kind2 }) => kind2 === graphql32.Kind.OPERATION_DEFINITION
|
|
77106
76913
|
);
|
|
77107
76914
|
const fragments = parsedDoc.definitions.filter(
|
|
77108
|
-
({ kind: kind2 }) => kind2 ===
|
|
76915
|
+
({ kind: kind2 }) => kind2 === graphql32.Kind.FRAGMENT_DEFINITION
|
|
77109
76916
|
);
|
|
77110
76917
|
if (operations.length > 1) {
|
|
77111
76918
|
throw new HoudiniError({
|
|
@@ -78221,12 +78028,12 @@ async function packageJSON(targetPath, frameworkInfo) {
|
|
|
78221
78028
|
}
|
|
78222
78029
|
packageJSON2.devDependencies = {
|
|
78223
78030
|
...packageJSON2.devDependencies,
|
|
78224
|
-
houdini: "^1.2.
|
|
78031
|
+
houdini: "^1.2.45"
|
|
78225
78032
|
};
|
|
78226
78033
|
if (frameworkInfo.framework === "svelte" || frameworkInfo.framework === "kit") {
|
|
78227
78034
|
packageJSON2.devDependencies = {
|
|
78228
78035
|
...packageJSON2.devDependencies,
|
|
78229
|
-
"houdini-svelte": "^1.2.
|
|
78036
|
+
"houdini-svelte": "^1.2.45"
|
|
78230
78037
|
};
|
|
78231
78038
|
} else {
|
|
78232
78039
|
throw new Error(`Unmanaged framework: "${JSON.stringify(frameworkInfo)}"`);
|