houdini 1.0.0-next.8 → 1.0.0-next.9
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 +50 -22
- package/build/cmd-esm/index.js +50 -22
- package/build/codegen/generators/typescript/typeReference.d.ts +4 -2
- package/build/codegen/generators/typescript/types.d.ts +0 -1
- package/build/codegen-cjs/index.js +48 -20
- package/build/codegen-esm/index.js +48 -20
- package/build/runtime/client/index.d.ts +1 -1
- package/build/runtime/client/plugins/cache.d.ts +1 -1
- package/build/runtime/client/plugins/fetch.d.ts +1 -1
- package/build/runtime/client/plugins/fetchParams.d.ts +1 -1
- package/build/runtime/client/plugins/mutation.d.ts +1 -1
- package/build/runtime/client/plugins/query.d.ts +1 -1
- package/build/runtime/client/plugins/subscription.d.ts +1 -1
- package/build/runtime/client/plugins/throwOnError.d.ts +1 -1
- package/build/runtime/lib/types.d.ts +1 -0
- package/build/runtime-cjs/client/documentStore.js +1 -1
- package/build/runtime-cjs/client/index.d.ts +1 -1
- package/build/runtime-cjs/client/index.js +13 -13
- package/build/runtime-cjs/client/plugins/cache.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/cache.js +3 -3
- package/build/runtime-cjs/client/plugins/fetch.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/fetch.js +7 -7
- package/build/runtime-cjs/client/plugins/fetchParams.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/fetchParams.js +3 -3
- package/build/runtime-cjs/client/plugins/mutation.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/mutation.js +3 -3
- package/build/runtime-cjs/client/plugins/query.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/query.js +3 -3
- package/build/runtime-cjs/client/plugins/subscription.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/subscription.js +3 -3
- package/build/runtime-cjs/client/plugins/throwOnError.d.ts +1 -1
- package/build/runtime-cjs/client/plugins/throwOnError.js +3 -3
- package/build/runtime-cjs/lib/types.d.ts +1 -0
- package/build/runtime-esm/client/documentStore.js +2 -2
- package/build/runtime-esm/client/index.d.ts +1 -1
- package/build/runtime-esm/client/index.js +10 -10
- package/build/runtime-esm/client/plugins/cache.d.ts +1 -1
- package/build/runtime-esm/client/plugins/cache.js +2 -2
- package/build/runtime-esm/client/plugins/fetch.d.ts +1 -1
- package/build/runtime-esm/client/plugins/fetch.js +6 -6
- package/build/runtime-esm/client/plugins/fetchParams.d.ts +1 -1
- package/build/runtime-esm/client/plugins/fetchParams.js +2 -2
- package/build/runtime-esm/client/plugins/mutation.d.ts +1 -1
- package/build/runtime-esm/client/plugins/mutation.js +2 -2
- package/build/runtime-esm/client/plugins/query.d.ts +1 -1
- package/build/runtime-esm/client/plugins/query.js +2 -2
- package/build/runtime-esm/client/plugins/subscription.d.ts +1 -1
- package/build/runtime-esm/client/plugins/subscription.js +2 -2
- package/build/runtime-esm/client/plugins/throwOnError.d.ts +1 -1
- package/build/runtime-esm/client/plugins/throwOnError.js +2 -2
- package/build/runtime-esm/lib/types.d.ts +1 -0
- package/build/test-cjs/index.js +48 -20
- package/build/test-esm/index.js +48 -20
- package/build/vite-cjs/index.js +48 -20
- package/build/vite-esm/index.js +48 -20
- package/package.json +1 -1
package/build/vite-cjs/index.js
CHANGED
|
@@ -7495,7 +7495,7 @@ var require_definition = __commonJS({
|
|
|
7495
7495
|
exports.assertInterfaceType = assertInterfaceType;
|
|
7496
7496
|
exports.isUnionType = isUnionType13;
|
|
7497
7497
|
exports.assertUnionType = assertUnionType;
|
|
7498
|
-
exports.isEnumType =
|
|
7498
|
+
exports.isEnumType = isEnumType11;
|
|
7499
7499
|
exports.assertEnumType = assertEnumType;
|
|
7500
7500
|
exports.isInputObjectType = isInputObjectType8;
|
|
7501
7501
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -7566,7 +7566,7 @@ var require_definition = __commonJS({
|
|
|
7566
7566
|
return Constructor;
|
|
7567
7567
|
}
|
|
7568
7568
|
function isType(type) {
|
|
7569
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
7569
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
7570
7570
|
}
|
|
7571
7571
|
function assertType(type) {
|
|
7572
7572
|
if (!isType(type)) {
|
|
@@ -7610,11 +7610,11 @@ var require_definition = __commonJS({
|
|
|
7610
7610
|
}
|
|
7611
7611
|
return type;
|
|
7612
7612
|
}
|
|
7613
|
-
function
|
|
7613
|
+
function isEnumType11(type) {
|
|
7614
7614
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
7615
7615
|
}
|
|
7616
7616
|
function assertEnumType(type) {
|
|
7617
|
-
if (!
|
|
7617
|
+
if (!isEnumType11(type)) {
|
|
7618
7618
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
7619
7619
|
}
|
|
7620
7620
|
return type;
|
|
@@ -7647,7 +7647,7 @@ var require_definition = __commonJS({
|
|
|
7647
7647
|
return type;
|
|
7648
7648
|
}
|
|
7649
7649
|
function isInputType(type) {
|
|
7650
|
-
return isScalarType13(type) ||
|
|
7650
|
+
return isScalarType13(type) || isEnumType11(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
7651
7651
|
}
|
|
7652
7652
|
function assertInputType(type) {
|
|
7653
7653
|
if (!isInputType(type)) {
|
|
@@ -7656,7 +7656,7 @@ var require_definition = __commonJS({
|
|
|
7656
7656
|
return type;
|
|
7657
7657
|
}
|
|
7658
7658
|
function isOutputType(type) {
|
|
7659
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
7659
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
7660
7660
|
}
|
|
7661
7661
|
function assertOutputType(type) {
|
|
7662
7662
|
if (!isOutputType(type)) {
|
|
@@ -7665,7 +7665,7 @@ var require_definition = __commonJS({
|
|
|
7665
7665
|
return type;
|
|
7666
7666
|
}
|
|
7667
7667
|
function isLeafType4(type) {
|
|
7668
|
-
return isScalarType13(type) ||
|
|
7668
|
+
return isScalarType13(type) || isEnumType11(type);
|
|
7669
7669
|
}
|
|
7670
7670
|
function assertLeafType(type) {
|
|
7671
7671
|
if (!isLeafType4(type)) {
|
|
@@ -7753,7 +7753,7 @@ var require_definition = __commonJS({
|
|
|
7753
7753
|
}
|
|
7754
7754
|
}
|
|
7755
7755
|
function isNamedType4(type) {
|
|
7756
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
7756
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isInputObjectType8(type);
|
|
7757
7757
|
}
|
|
7758
7758
|
function assertNamedType(type) {
|
|
7759
7759
|
if (!isNamedType4(type)) {
|
|
@@ -70467,11 +70467,13 @@ function scalarPropertyValue(config4, missingScalars, target) {
|
|
|
70467
70467
|
|
|
70468
70468
|
// src/codegen/generators/typescript/typeReference.ts
|
|
70469
70469
|
var AST8 = recast8.types.builders;
|
|
70470
|
-
function tsTypeReference(config4, missingScalars, definition) {
|
|
70470
|
+
function tsTypeReference(config4, missingScalars, definition, body) {
|
|
70471
70471
|
const { type, wrappers } = unwrapType(config4, definition.type);
|
|
70472
70472
|
let result;
|
|
70473
70473
|
if (graphql16.isScalarType(type)) {
|
|
70474
70474
|
result = scalarPropertyValue(config4, missingScalars, type);
|
|
70475
|
+
} else if (graphql16.isEnumType(type)) {
|
|
70476
|
+
result = enumReference(config4, body, type.name);
|
|
70475
70477
|
} else {
|
|
70476
70478
|
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
70477
70479
|
}
|
|
@@ -70486,6 +70488,19 @@ function tsTypeReference(config4, missingScalars, definition) {
|
|
|
70486
70488
|
}
|
|
70487
70489
|
return result;
|
|
70488
70490
|
}
|
|
70491
|
+
function enumReference(config4, body, name) {
|
|
70492
|
+
ensureImports({
|
|
70493
|
+
config: config4,
|
|
70494
|
+
body,
|
|
70495
|
+
import: ["ValueOf"],
|
|
70496
|
+
importKind: "type",
|
|
70497
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
70498
|
+
});
|
|
70499
|
+
return AST8.tsTypeReference(
|
|
70500
|
+
AST8.identifier("ValueOf"),
|
|
70501
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
70502
|
+
);
|
|
70503
|
+
}
|
|
70489
70504
|
|
|
70490
70505
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
70491
70506
|
var AST9 = recast9.types.builders;
|
|
@@ -70517,7 +70532,7 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
|
|
|
70517
70532
|
members.push(
|
|
70518
70533
|
AST9.tsPropertySignature(
|
|
70519
70534
|
AST9.identifier(field.name),
|
|
70520
|
-
AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field)),
|
|
70535
|
+
AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field, body)),
|
|
70521
70536
|
graphql17.isNullableType(field.type)
|
|
70522
70537
|
)
|
|
70523
70538
|
);
|
|
@@ -70548,6 +70563,13 @@ function inlineType({
|
|
|
70548
70563
|
if (graphql18.isScalarType(type)) {
|
|
70549
70564
|
result = scalarPropertyValue(config4, missingScalars, type);
|
|
70550
70565
|
} else if (graphql18.isEnumType(type)) {
|
|
70566
|
+
ensureImports({
|
|
70567
|
+
config: config4,
|
|
70568
|
+
body,
|
|
70569
|
+
importKind: "type",
|
|
70570
|
+
import: ["ValueOf"],
|
|
70571
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
70572
|
+
});
|
|
70551
70573
|
if (!visitedTypes.has(type.name)) {
|
|
70552
70574
|
ensureImports({
|
|
70553
70575
|
config: config4,
|
|
@@ -70557,7 +70579,7 @@ function inlineType({
|
|
|
70557
70579
|
});
|
|
70558
70580
|
visitedTypes.add(type.name);
|
|
70559
70581
|
}
|
|
70560
|
-
result =
|
|
70582
|
+
result = enumReference(config4, body, type.name);
|
|
70561
70583
|
} else if (selections) {
|
|
70562
70584
|
const rootObj = type;
|
|
70563
70585
|
const inlineFragments = {};
|
|
@@ -70990,7 +71012,7 @@ async function generateOperationTypeDefs(config4, filepath, body, definition, se
|
|
|
70990
71012
|
return AST11.tsPropertySignature(
|
|
70991
71013
|
AST11.identifier(definition2.variable.name.value),
|
|
70992
71014
|
AST11.tsTypeAnnotation(
|
|
70993
|
-
tsTypeReference(config4, missingScalars, definition2)
|
|
71015
|
+
tsTypeReference(config4, missingScalars, definition2, body)
|
|
70994
71016
|
),
|
|
70995
71017
|
definition2.type.kind !== "NonNullType"
|
|
70996
71018
|
);
|
|
@@ -71057,7 +71079,12 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
71057
71079
|
return AST11.tsPropertySignature(
|
|
71058
71080
|
AST11.identifier(definition2.variable.name.value),
|
|
71059
71081
|
AST11.tsTypeAnnotation(
|
|
71060
|
-
tsTypeReference(
|
|
71082
|
+
tsTypeReference(
|
|
71083
|
+
config4,
|
|
71084
|
+
missingScalars,
|
|
71085
|
+
definition2,
|
|
71086
|
+
body
|
|
71087
|
+
)
|
|
71061
71088
|
),
|
|
71062
71089
|
definition2.type.kind !== "NonNullType"
|
|
71063
71090
|
);
|
|
@@ -71150,7 +71177,7 @@ async function imperativeCacheTypef(config4, docs) {
|
|
|
71150
71177
|
),
|
|
71151
71178
|
AST12.tsPropertySignature(
|
|
71152
71179
|
AST12.identifier("lists"),
|
|
71153
|
-
AST12.tsTypeAnnotation(listDefinitions(config4, docs))
|
|
71180
|
+
AST12.tsTypeAnnotation(listDefinitions(config4, body, docs))
|
|
71154
71181
|
),
|
|
71155
71182
|
AST12.tsPropertySignature(
|
|
71156
71183
|
AST12.identifier("queries"),
|
|
@@ -71259,7 +71286,7 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
71259
71286
|
const prop = AST12.tsPropertySignature(
|
|
71260
71287
|
AST12.identifier(arg.name),
|
|
71261
71288
|
AST12.tsTypeAnnotation(
|
|
71262
|
-
tsTypeReference(config4, /* @__PURE__ */ new Set(), arg)
|
|
71289
|
+
tsTypeReference(config4, /* @__PURE__ */ new Set(), arg, body)
|
|
71263
71290
|
)
|
|
71264
71291
|
);
|
|
71265
71292
|
const unwrapped2 = unwrapType(config4, arg.type);
|
|
@@ -71309,7 +71336,7 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
71309
71336
|
})
|
|
71310
71337
|
);
|
|
71311
71338
|
}
|
|
71312
|
-
function listDefinitions(config4, docs) {
|
|
71339
|
+
function listDefinitions(config4, body, docs) {
|
|
71313
71340
|
const lists = [];
|
|
71314
71341
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
71315
71342
|
for (const doc of docs) {
|
|
@@ -71366,7 +71393,8 @@ function listDefinitions(config4, docs) {
|
|
|
71366
71393
|
tsTypeReference(
|
|
71367
71394
|
config4,
|
|
71368
71395
|
/* @__PURE__ */ new Set(),
|
|
71369
|
-
arg
|
|
71396
|
+
arg,
|
|
71397
|
+
body
|
|
71370
71398
|
)
|
|
71371
71399
|
)
|
|
71372
71400
|
);
|
|
@@ -71560,9 +71588,9 @@ async function definitionsGenerator(config4) {
|
|
|
71560
71588
|
).code;
|
|
71561
71589
|
const typeDefinitions2 = enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map(
|
|
71562
71590
|
(definition) => `
|
|
71563
|
-
export
|
|
71564
|
-
${definition.values?.map((value) => ` ${value.name.value}
|
|
71565
|
-
}
|
|
71591
|
+
export const ${definition.name.value} = {
|
|
71592
|
+
${definition.values?.map((value) => ` ${value.name.value}: "${value.name.value}"`).join(",\n")}
|
|
71593
|
+
} as const
|
|
71566
71594
|
`
|
|
71567
71595
|
).join("");
|
|
71568
71596
|
const definitionsIndex = `
|
package/build/vite-esm/index.js
CHANGED
|
@@ -7500,7 +7500,7 @@ var require_definition = __commonJS({
|
|
|
7500
7500
|
exports.assertInterfaceType = assertInterfaceType;
|
|
7501
7501
|
exports.isUnionType = isUnionType13;
|
|
7502
7502
|
exports.assertUnionType = assertUnionType;
|
|
7503
|
-
exports.isEnumType =
|
|
7503
|
+
exports.isEnumType = isEnumType11;
|
|
7504
7504
|
exports.assertEnumType = assertEnumType;
|
|
7505
7505
|
exports.isInputObjectType = isInputObjectType8;
|
|
7506
7506
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -7571,7 +7571,7 @@ var require_definition = __commonJS({
|
|
|
7571
7571
|
return Constructor;
|
|
7572
7572
|
}
|
|
7573
7573
|
function isType(type) {
|
|
7574
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
7574
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
7575
7575
|
}
|
|
7576
7576
|
function assertType(type) {
|
|
7577
7577
|
if (!isType(type)) {
|
|
@@ -7615,11 +7615,11 @@ var require_definition = __commonJS({
|
|
|
7615
7615
|
}
|
|
7616
7616
|
return type;
|
|
7617
7617
|
}
|
|
7618
|
-
function
|
|
7618
|
+
function isEnumType11(type) {
|
|
7619
7619
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
7620
7620
|
}
|
|
7621
7621
|
function assertEnumType(type) {
|
|
7622
|
-
if (!
|
|
7622
|
+
if (!isEnumType11(type)) {
|
|
7623
7623
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
7624
7624
|
}
|
|
7625
7625
|
return type;
|
|
@@ -7652,7 +7652,7 @@ var require_definition = __commonJS({
|
|
|
7652
7652
|
return type;
|
|
7653
7653
|
}
|
|
7654
7654
|
function isInputType(type) {
|
|
7655
|
-
return isScalarType13(type) ||
|
|
7655
|
+
return isScalarType13(type) || isEnumType11(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
7656
7656
|
}
|
|
7657
7657
|
function assertInputType(type) {
|
|
7658
7658
|
if (!isInputType(type)) {
|
|
@@ -7661,7 +7661,7 @@ var require_definition = __commonJS({
|
|
|
7661
7661
|
return type;
|
|
7662
7662
|
}
|
|
7663
7663
|
function isOutputType(type) {
|
|
7664
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
7664
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
7665
7665
|
}
|
|
7666
7666
|
function assertOutputType(type) {
|
|
7667
7667
|
if (!isOutputType(type)) {
|
|
@@ -7670,7 +7670,7 @@ var require_definition = __commonJS({
|
|
|
7670
7670
|
return type;
|
|
7671
7671
|
}
|
|
7672
7672
|
function isLeafType4(type) {
|
|
7673
|
-
return isScalarType13(type) ||
|
|
7673
|
+
return isScalarType13(type) || isEnumType11(type);
|
|
7674
7674
|
}
|
|
7675
7675
|
function assertLeafType(type) {
|
|
7676
7676
|
if (!isLeafType4(type)) {
|
|
@@ -7758,7 +7758,7 @@ var require_definition = __commonJS({
|
|
|
7758
7758
|
}
|
|
7759
7759
|
}
|
|
7760
7760
|
function isNamedType4(type) {
|
|
7761
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
7761
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType11(type) || isInputObjectType8(type);
|
|
7762
7762
|
}
|
|
7763
7763
|
function assertNamedType(type) {
|
|
7764
7764
|
if (!isNamedType4(type)) {
|
|
@@ -70461,11 +70461,13 @@ function scalarPropertyValue(config4, missingScalars, target) {
|
|
|
70461
70461
|
|
|
70462
70462
|
// src/codegen/generators/typescript/typeReference.ts
|
|
70463
70463
|
var AST8 = recast8.types.builders;
|
|
70464
|
-
function tsTypeReference(config4, missingScalars, definition) {
|
|
70464
|
+
function tsTypeReference(config4, missingScalars, definition, body) {
|
|
70465
70465
|
const { type, wrappers } = unwrapType(config4, definition.type);
|
|
70466
70466
|
let result;
|
|
70467
70467
|
if (graphql16.isScalarType(type)) {
|
|
70468
70468
|
result = scalarPropertyValue(config4, missingScalars, type);
|
|
70469
|
+
} else if (graphql16.isEnumType(type)) {
|
|
70470
|
+
result = enumReference(config4, body, type.name);
|
|
70469
70471
|
} else {
|
|
70470
70472
|
result = AST8.tsTypeReference(AST8.identifier(type.name));
|
|
70471
70473
|
}
|
|
@@ -70480,6 +70482,19 @@ function tsTypeReference(config4, missingScalars, definition) {
|
|
|
70480
70482
|
}
|
|
70481
70483
|
return result;
|
|
70482
70484
|
}
|
|
70485
|
+
function enumReference(config4, body, name) {
|
|
70486
|
+
ensureImports({
|
|
70487
|
+
config: config4,
|
|
70488
|
+
body,
|
|
70489
|
+
import: ["ValueOf"],
|
|
70490
|
+
importKind: "type",
|
|
70491
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
70492
|
+
});
|
|
70493
|
+
return AST8.tsTypeReference(
|
|
70494
|
+
AST8.identifier("ValueOf"),
|
|
70495
|
+
AST8.tsTypeParameterInstantiation([AST8.tsTypeQuery(AST8.identifier(name))])
|
|
70496
|
+
);
|
|
70497
|
+
}
|
|
70483
70498
|
|
|
70484
70499
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
70485
70500
|
var AST9 = recast9.types.builders;
|
|
@@ -70511,7 +70526,7 @@ function addReferencedInputTypes(config4, filepath, body, visitedTypes, missingS
|
|
|
70511
70526
|
members.push(
|
|
70512
70527
|
AST9.tsPropertySignature(
|
|
70513
70528
|
AST9.identifier(field.name),
|
|
70514
|
-
AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field)),
|
|
70529
|
+
AST9.tsTypeAnnotation(tsTypeReference(config4, missingScalars, field, body)),
|
|
70515
70530
|
graphql17.isNullableType(field.type)
|
|
70516
70531
|
)
|
|
70517
70532
|
);
|
|
@@ -70542,6 +70557,13 @@ function inlineType({
|
|
|
70542
70557
|
if (graphql18.isScalarType(type)) {
|
|
70543
70558
|
result = scalarPropertyValue(config4, missingScalars, type);
|
|
70544
70559
|
} else if (graphql18.isEnumType(type)) {
|
|
70560
|
+
ensureImports({
|
|
70561
|
+
config: config4,
|
|
70562
|
+
body,
|
|
70563
|
+
importKind: "type",
|
|
70564
|
+
import: ["ValueOf"],
|
|
70565
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
70566
|
+
});
|
|
70545
70567
|
if (!visitedTypes.has(type.name)) {
|
|
70546
70568
|
ensureImports({
|
|
70547
70569
|
config: config4,
|
|
@@ -70551,7 +70573,7 @@ function inlineType({
|
|
|
70551
70573
|
});
|
|
70552
70574
|
visitedTypes.add(type.name);
|
|
70553
70575
|
}
|
|
70554
|
-
result =
|
|
70576
|
+
result = enumReference(config4, body, type.name);
|
|
70555
70577
|
} else if (selections) {
|
|
70556
70578
|
const rootObj = type;
|
|
70557
70579
|
const inlineFragments = {};
|
|
@@ -70984,7 +71006,7 @@ async function generateOperationTypeDefs(config4, filepath, body, definition, se
|
|
|
70984
71006
|
return AST11.tsPropertySignature(
|
|
70985
71007
|
AST11.identifier(definition2.variable.name.value),
|
|
70986
71008
|
AST11.tsTypeAnnotation(
|
|
70987
|
-
tsTypeReference(config4, missingScalars, definition2)
|
|
71009
|
+
tsTypeReference(config4, missingScalars, definition2, body)
|
|
70988
71010
|
),
|
|
70989
71011
|
definition2.type.kind !== "NonNullType"
|
|
70990
71012
|
);
|
|
@@ -71051,7 +71073,12 @@ async function generateFragmentTypeDefs(config4, filepath, body, selections, def
|
|
|
71051
71073
|
return AST11.tsPropertySignature(
|
|
71052
71074
|
AST11.identifier(definition2.variable.name.value),
|
|
71053
71075
|
AST11.tsTypeAnnotation(
|
|
71054
|
-
tsTypeReference(
|
|
71076
|
+
tsTypeReference(
|
|
71077
|
+
config4,
|
|
71078
|
+
missingScalars,
|
|
71079
|
+
definition2,
|
|
71080
|
+
body
|
|
71081
|
+
)
|
|
71055
71082
|
),
|
|
71056
71083
|
definition2.type.kind !== "NonNullType"
|
|
71057
71084
|
);
|
|
@@ -71144,7 +71171,7 @@ async function imperativeCacheTypef(config4, docs) {
|
|
|
71144
71171
|
),
|
|
71145
71172
|
AST12.tsPropertySignature(
|
|
71146
71173
|
AST12.identifier("lists"),
|
|
71147
|
-
AST12.tsTypeAnnotation(listDefinitions(config4, docs))
|
|
71174
|
+
AST12.tsTypeAnnotation(listDefinitions(config4, body, docs))
|
|
71148
71175
|
),
|
|
71149
71176
|
AST12.tsPropertySignature(
|
|
71150
71177
|
AST12.identifier("queries"),
|
|
@@ -71253,7 +71280,7 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
71253
71280
|
const prop = AST12.tsPropertySignature(
|
|
71254
71281
|
AST12.identifier(arg.name),
|
|
71255
71282
|
AST12.tsTypeAnnotation(
|
|
71256
|
-
tsTypeReference(config4, /* @__PURE__ */ new Set(), arg)
|
|
71283
|
+
tsTypeReference(config4, /* @__PURE__ */ new Set(), arg, body)
|
|
71257
71284
|
)
|
|
71258
71285
|
);
|
|
71259
71286
|
const unwrapped2 = unwrapType(config4, arg.type);
|
|
@@ -71303,7 +71330,7 @@ function typeDefinitions(config4, body, docs, returnType) {
|
|
|
71303
71330
|
})
|
|
71304
71331
|
);
|
|
71305
71332
|
}
|
|
71306
|
-
function listDefinitions(config4, docs) {
|
|
71333
|
+
function listDefinitions(config4, body, docs) {
|
|
71307
71334
|
const lists = [];
|
|
71308
71335
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
71309
71336
|
for (const doc of docs) {
|
|
@@ -71360,7 +71387,8 @@ function listDefinitions(config4, docs) {
|
|
|
71360
71387
|
tsTypeReference(
|
|
71361
71388
|
config4,
|
|
71362
71389
|
/* @__PURE__ */ new Set(),
|
|
71363
|
-
arg
|
|
71390
|
+
arg,
|
|
71391
|
+
body
|
|
71364
71392
|
)
|
|
71365
71393
|
)
|
|
71366
71394
|
);
|
|
@@ -71554,9 +71582,9 @@ async function definitionsGenerator(config4) {
|
|
|
71554
71582
|
).code;
|
|
71555
71583
|
const typeDefinitions2 = enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map(
|
|
71556
71584
|
(definition) => `
|
|
71557
|
-
export
|
|
71558
|
-
${definition.values?.map((value) => ` ${value.name.value}
|
|
71559
|
-
}
|
|
71585
|
+
export const ${definition.name.value} = {
|
|
71586
|
+
${definition.values?.map((value) => ` ${value.name.value}: "${value.name.value}"`).join(",\n")}
|
|
71587
|
+
} as const
|
|
71560
71588
|
`
|
|
71561
71589
|
).join("");
|
|
71562
71590
|
const definitionsIndex = `
|