houdini-svelte 1.0.0 → 1.0.2
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/plugin-cjs/index.js +53 -20
- package/build/plugin-esm/index.js +53 -20
- package/build/preprocess-cjs/index.js +8 -8
- package/build/preprocess-esm/index.js +8 -8
- package/build/runtime/stores/fragment.d.ts +2 -5
- package/build/runtime/stores/pagination/cursor.d.ts +2 -20
- package/build/runtime/stores/pagination/fragment.d.ts +2 -14
- package/build/runtime/stores/pagination/offset.d.ts +0 -9
- package/build/runtime/stores/pagination/query.d.ts +2 -3
- package/build/runtime/types.d.ts +51 -1
- package/build/runtime-cjs/stores/fragment.d.ts +2 -5
- package/build/runtime-cjs/stores/pagination/cursor.d.ts +2 -20
- package/build/runtime-cjs/stores/pagination/cursor.js +1 -1
- package/build/runtime-cjs/stores/pagination/fragment.d.ts +2 -14
- package/build/runtime-cjs/stores/pagination/offset.d.ts +0 -9
- package/build/runtime-cjs/stores/pagination/query.d.ts +2 -3
- package/build/runtime-cjs/types.d.ts +51 -1
- package/build/runtime-esm/stores/fragment.d.ts +2 -5
- package/build/runtime-esm/stores/pagination/cursor.d.ts +2 -20
- package/build/runtime-esm/stores/pagination/cursor.js +1 -1
- package/build/runtime-esm/stores/pagination/fragment.d.ts +2 -14
- package/build/runtime-esm/stores/pagination/offset.d.ts +0 -9
- package/build/runtime-esm/stores/pagination/query.d.ts +2 -3
- package/build/runtime-esm/types.d.ts +51 -1
- package/build/test-cjs/index.js +153 -77
- package/build/test-esm/index.js +153 -77
- package/package.json +2 -2
package/build/test-esm/index.js
CHANGED
|
@@ -95919,7 +95919,7 @@ var require_definition2 = __commonJS3({
|
|
|
95919
95919
|
exports.assertInterfaceType = assertInterfaceType;
|
|
95920
95920
|
exports.isUnionType = isUnionType7;
|
|
95921
95921
|
exports.assertUnionType = assertUnionType;
|
|
95922
|
-
exports.isEnumType =
|
|
95922
|
+
exports.isEnumType = isEnumType7;
|
|
95923
95923
|
exports.assertEnumType = assertEnumType;
|
|
95924
95924
|
exports.isInputObjectType = isInputObjectType2;
|
|
95925
95925
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -95990,7 +95990,7 @@ var require_definition2 = __commonJS3({
|
|
|
95990
95990
|
return Constructor;
|
|
95991
95991
|
}
|
|
95992
95992
|
function isType(type) {
|
|
95993
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
95993
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isInputObjectType2(type) || isListType3(type) || isNonNullType6(type);
|
|
95994
95994
|
}
|
|
95995
95995
|
function assertType(type) {
|
|
95996
95996
|
if (!isType(type)) {
|
|
@@ -96034,11 +96034,11 @@ var require_definition2 = __commonJS3({
|
|
|
96034
96034
|
}
|
|
96035
96035
|
return type;
|
|
96036
96036
|
}
|
|
96037
|
-
function
|
|
96037
|
+
function isEnumType7(type) {
|
|
96038
96038
|
return (0, _instanceOf.default)(type, GraphQLEnumType);
|
|
96039
96039
|
}
|
|
96040
96040
|
function assertEnumType(type) {
|
|
96041
|
-
if (!
|
|
96041
|
+
if (!isEnumType7(type)) {
|
|
96042
96042
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
96043
96043
|
}
|
|
96044
96044
|
return type;
|
|
@@ -96071,7 +96071,7 @@ var require_definition2 = __commonJS3({
|
|
|
96071
96071
|
return type;
|
|
96072
96072
|
}
|
|
96073
96073
|
function isInputType(type) {
|
|
96074
|
-
return isScalarType7(type) ||
|
|
96074
|
+
return isScalarType7(type) || isEnumType7(type) || isInputObjectType2(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
96075
96075
|
}
|
|
96076
96076
|
function assertInputType(type) {
|
|
96077
96077
|
if (!isInputType(type)) {
|
|
@@ -96080,7 +96080,7 @@ var require_definition2 = __commonJS3({
|
|
|
96080
96080
|
return type;
|
|
96081
96081
|
}
|
|
96082
96082
|
function isOutputType(type) {
|
|
96083
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
96083
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
96084
96084
|
}
|
|
96085
96085
|
function assertOutputType(type) {
|
|
96086
96086
|
if (!isOutputType(type)) {
|
|
@@ -96089,7 +96089,7 @@ var require_definition2 = __commonJS3({
|
|
|
96089
96089
|
return type;
|
|
96090
96090
|
}
|
|
96091
96091
|
function isLeafType(type) {
|
|
96092
|
-
return isScalarType7(type) ||
|
|
96092
|
+
return isScalarType7(type) || isEnumType7(type);
|
|
96093
96093
|
}
|
|
96094
96094
|
function assertLeafType(type) {
|
|
96095
96095
|
if (!isLeafType(type)) {
|
|
@@ -96177,7 +96177,7 @@ var require_definition2 = __commonJS3({
|
|
|
96177
96177
|
}
|
|
96178
96178
|
}
|
|
96179
96179
|
function isNamedType(type) {
|
|
96180
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
96180
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isInputObjectType2(type);
|
|
96181
96181
|
}
|
|
96182
96182
|
function assertNamedType(type) {
|
|
96183
96183
|
if (!isNamedType(type)) {
|
|
@@ -149352,26 +149352,45 @@ function fragmentArguments(config22, filepath, definition) {
|
|
|
149352
149352
|
if (!typeArg || typeArg.kind !== "StringValue") {
|
|
149353
149353
|
return [];
|
|
149354
149354
|
}
|
|
149355
|
-
let type = typeArg.value;
|
|
149356
|
-
let name = arg.name.value;
|
|
149357
|
-
let required = false;
|
|
149355
|
+
let type = parseArgumentTypeString(typeArg.value);
|
|
149358
149356
|
let defaultValue = arg.value.fields?.find((arg2) => arg2.name.value === "default")?.value || null;
|
|
149359
|
-
if (type[type.length - 1] === "!") {
|
|
149360
|
-
type = type.slice(0, -1);
|
|
149361
|
-
required = true;
|
|
149362
|
-
defaultValue = null;
|
|
149363
|
-
}
|
|
149364
149357
|
return [
|
|
149365
149358
|
{
|
|
149366
|
-
name,
|
|
149359
|
+
name: arg.name.value,
|
|
149367
149360
|
type,
|
|
149368
|
-
required,
|
|
149361
|
+
required: type.kind === "NonNullType",
|
|
149369
149362
|
defaultValue
|
|
149370
149363
|
}
|
|
149371
149364
|
];
|
|
149372
149365
|
}) || []
|
|
149373
149366
|
);
|
|
149374
149367
|
}
|
|
149368
|
+
function parseArgumentTypeString(input) {
|
|
149369
|
+
if (input[input.length - 1] === "!") {
|
|
149370
|
+
const inner = parseArgumentTypeString(input.substring(0, input.length - 1));
|
|
149371
|
+
if (inner.kind === "NonNullType") {
|
|
149372
|
+
throw new Error("invalid type" + input);
|
|
149373
|
+
}
|
|
149374
|
+
return {
|
|
149375
|
+
kind: "NonNullType",
|
|
149376
|
+
type: inner
|
|
149377
|
+
};
|
|
149378
|
+
}
|
|
149379
|
+
if (input[input.length - 1] === "]") {
|
|
149380
|
+
const inner = parseArgumentTypeString(input.substring(1, input.length - 1));
|
|
149381
|
+
return {
|
|
149382
|
+
kind: "ListType",
|
|
149383
|
+
type: inner
|
|
149384
|
+
};
|
|
149385
|
+
}
|
|
149386
|
+
return {
|
|
149387
|
+
kind: "NamedType",
|
|
149388
|
+
name: {
|
|
149389
|
+
kind: "Name",
|
|
149390
|
+
value: input
|
|
149391
|
+
}
|
|
149392
|
+
};
|
|
149393
|
+
}
|
|
149375
149394
|
function collectDefaultArgumentValues(config22, filepath, definition) {
|
|
149376
149395
|
let result = {};
|
|
149377
149396
|
for (const { name, required, defaultValue } of fragmentArguments(
|
|
@@ -149434,19 +149453,9 @@ function fragmentArgumentsDefinitions(config22, filepath, definition) {
|
|
|
149434
149453
|
return [];
|
|
149435
149454
|
}
|
|
149436
149455
|
return args.map((arg) => {
|
|
149437
|
-
const innerType = {
|
|
149438
|
-
kind: "NamedType",
|
|
149439
|
-
name: {
|
|
149440
|
-
kind: "Name",
|
|
149441
|
-
value: arg.type
|
|
149442
|
-
}
|
|
149443
|
-
};
|
|
149444
149456
|
return {
|
|
149445
149457
|
kind: "VariableDefinition",
|
|
149446
|
-
type: arg.
|
|
149447
|
-
kind: "NonNullType",
|
|
149448
|
-
type: innerType
|
|
149449
|
-
},
|
|
149458
|
+
type: arg.type,
|
|
149450
149459
|
variable: {
|
|
149451
149460
|
kind: "Variable",
|
|
149452
149461
|
name: {
|
|
@@ -152709,7 +152718,7 @@ async function typeCheck(config22, docs) {
|
|
|
152709
152718
|
const lists = [];
|
|
152710
152719
|
const listTypes = [];
|
|
152711
152720
|
const fragments = {};
|
|
152712
|
-
for (const { document: parsed, filename } of docs) {
|
|
152721
|
+
for (const { document: parsed, originalString, filename } of docs) {
|
|
152713
152722
|
graphql24.visit(parsed, {
|
|
152714
152723
|
[graphql24.Kind.FRAGMENT_DEFINITION](definition) {
|
|
152715
152724
|
fragments[definition.name.value] = definition;
|
|
@@ -152907,7 +152916,7 @@ async function typeCheck(config22, docs) {
|
|
|
152907
152916
|
paginateArgs(config22, filepath),
|
|
152908
152917
|
noUnusedFragmentArguments(config22)
|
|
152909
152918
|
);
|
|
152910
|
-
for (const { filename, document: parsed } of docs) {
|
|
152919
|
+
for (const { filename, document: parsed, originalString } of docs) {
|
|
152911
152920
|
for (const error3 of graphql24.validate(config22.schema, parsed, rules(filename))) {
|
|
152912
152921
|
errors.push(
|
|
152913
152922
|
new HoudiniError2({
|
|
@@ -153143,24 +153152,15 @@ function validateFragmentArguments(config22, filepath, fragments) {
|
|
|
153143
153152
|
)
|
|
153144
153153
|
);
|
|
153145
153154
|
} else {
|
|
153146
|
-
const zipped = appliedArgumentNames.map(
|
|
153147
|
-
|
|
153148
|
-
|
|
153149
|
-
|
|
153150
|
-
]
|
|
153151
|
-
);
|
|
153155
|
+
const zipped = appliedArgumentNames.map((name) => [
|
|
153156
|
+
appliedArguments[name],
|
|
153157
|
+
fragmentArguments2[fragmentName].find((arg) => arg.name === name).type
|
|
153158
|
+
]);
|
|
153152
153159
|
for (const [applied, target] of zipped) {
|
|
153153
|
-
if (
|
|
153154
|
-
continue;
|
|
153155
|
-
}
|
|
153156
|
-
const appliedType = applied.value.kind.substring(
|
|
153157
|
-
0,
|
|
153158
|
-
applied.value.kind.length - "Value".length
|
|
153159
|
-
);
|
|
153160
|
-
if (appliedType !== target) {
|
|
153160
|
+
if (!valueIsType(config22, applied.value, target)) {
|
|
153161
153161
|
ctx.reportError(
|
|
153162
153162
|
new graphql24.GraphQLError(
|
|
153163
|
-
`Invalid argument type. Expected ${target}, found ${
|
|
153163
|
+
`Invalid argument type. Expected ${target}, found ${applied.value.kind}`
|
|
153164
153164
|
)
|
|
153165
153165
|
);
|
|
153166
153166
|
}
|
|
@@ -153170,6 +153170,47 @@ function validateFragmentArguments(config22, filepath, fragments) {
|
|
|
153170
153170
|
};
|
|
153171
153171
|
};
|
|
153172
153172
|
}
|
|
153173
|
+
function valueIsType(config22, value2, targetType) {
|
|
153174
|
+
if (value2.kind === "NullValue") {
|
|
153175
|
+
return targetType.kind !== "NonNullType";
|
|
153176
|
+
}
|
|
153177
|
+
if (targetType.kind === "NonNullType") {
|
|
153178
|
+
targetType = targetType.type;
|
|
153179
|
+
}
|
|
153180
|
+
if (value2.kind === "ListValue") {
|
|
153181
|
+
if (targetType.kind !== "ListType") {
|
|
153182
|
+
return false;
|
|
153183
|
+
}
|
|
153184
|
+
const listType = targetType.type;
|
|
153185
|
+
return value2.values.every((value22) => valueIsType(config22, value22, listType));
|
|
153186
|
+
}
|
|
153187
|
+
if (value2.kind === "BooleanValue") {
|
|
153188
|
+
return targetType.kind === "NamedType" && targetType.name.value === "Boolean";
|
|
153189
|
+
}
|
|
153190
|
+
if (value2.kind === "StringValue") {
|
|
153191
|
+
return targetType.kind === "NamedType" && targetType.name.value === "String";
|
|
153192
|
+
}
|
|
153193
|
+
if (value2.kind === "IntValue") {
|
|
153194
|
+
return targetType.kind === "NamedType" && targetType.name.value === "Int";
|
|
153195
|
+
}
|
|
153196
|
+
if (value2.kind === "FloatValue") {
|
|
153197
|
+
return targetType.kind === "NamedType" && targetType.name.value === "Float";
|
|
153198
|
+
}
|
|
153199
|
+
if (value2.kind === "ObjectValue" && targetType.kind === "NamedType") {
|
|
153200
|
+
return true;
|
|
153201
|
+
}
|
|
153202
|
+
if (value2.kind === "EnumValue" && targetType.kind === "NamedType") {
|
|
153203
|
+
const enumType = config22.schema.getType(targetType.name.value);
|
|
153204
|
+
if (!graphql24.isEnumType(enumType)) {
|
|
153205
|
+
return false;
|
|
153206
|
+
}
|
|
153207
|
+
return enumType.getValues().some((enumValue) => enumValue.value === value2.value);
|
|
153208
|
+
}
|
|
153209
|
+
if (value2.kind === "Variable") {
|
|
153210
|
+
return true;
|
|
153211
|
+
}
|
|
153212
|
+
return false;
|
|
153213
|
+
}
|
|
153173
153214
|
function paginateArgs(config22, filepath) {
|
|
153174
153215
|
return function(ctx) {
|
|
153175
153216
|
let alreadyPaginated = false;
|
|
@@ -156950,7 +156991,7 @@ var require_definition3 = __commonJS4({
|
|
|
156950
156991
|
exports.assertInterfaceType = assertInterfaceType;
|
|
156951
156992
|
exports.isUnionType = isUnionType7;
|
|
156952
156993
|
exports.assertUnionType = assertUnionType;
|
|
156953
|
-
exports.isEnumType =
|
|
156994
|
+
exports.isEnumType = isEnumType7;
|
|
156954
156995
|
exports.assertEnumType = assertEnumType;
|
|
156955
156996
|
exports.isInputObjectType = isInputObjectType2;
|
|
156956
156997
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -157021,7 +157062,7 @@ var require_definition3 = __commonJS4({
|
|
|
157021
157062
|
return Constructor;
|
|
157022
157063
|
}
|
|
157023
157064
|
function isType(type) {
|
|
157024
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
157065
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isInputObjectType2(type) || isListType3(type) || isNonNullType6(type);
|
|
157025
157066
|
}
|
|
157026
157067
|
function assertType(type) {
|
|
157027
157068
|
if (!isType(type)) {
|
|
@@ -157065,11 +157106,11 @@ var require_definition3 = __commonJS4({
|
|
|
157065
157106
|
}
|
|
157066
157107
|
return type;
|
|
157067
157108
|
}
|
|
157068
|
-
function
|
|
157109
|
+
function isEnumType7(type) {
|
|
157069
157110
|
return (0, _instanceOf.default)(type, GraphQLEnumType);
|
|
157070
157111
|
}
|
|
157071
157112
|
function assertEnumType(type) {
|
|
157072
|
-
if (!
|
|
157113
|
+
if (!isEnumType7(type)) {
|
|
157073
157114
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
157074
157115
|
}
|
|
157075
157116
|
return type;
|
|
@@ -157102,7 +157143,7 @@ var require_definition3 = __commonJS4({
|
|
|
157102
157143
|
return type;
|
|
157103
157144
|
}
|
|
157104
157145
|
function isInputType(type) {
|
|
157105
|
-
return isScalarType7(type) ||
|
|
157146
|
+
return isScalarType7(type) || isEnumType7(type) || isInputObjectType2(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
157106
157147
|
}
|
|
157107
157148
|
function assertInputType(type) {
|
|
157108
157149
|
if (!isInputType(type)) {
|
|
@@ -157111,7 +157152,7 @@ var require_definition3 = __commonJS4({
|
|
|
157111
157152
|
return type;
|
|
157112
157153
|
}
|
|
157113
157154
|
function isOutputType(type) {
|
|
157114
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
157155
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
157115
157156
|
}
|
|
157116
157157
|
function assertOutputType(type) {
|
|
157117
157158
|
if (!isOutputType(type)) {
|
|
@@ -157120,7 +157161,7 @@ var require_definition3 = __commonJS4({
|
|
|
157120
157161
|
return type;
|
|
157121
157162
|
}
|
|
157122
157163
|
function isLeafType(type) {
|
|
157123
|
-
return isScalarType7(type) ||
|
|
157164
|
+
return isScalarType7(type) || isEnumType7(type);
|
|
157124
157165
|
}
|
|
157125
157166
|
function assertLeafType(type) {
|
|
157126
157167
|
if (!isLeafType(type)) {
|
|
@@ -157208,7 +157249,7 @@ var require_definition3 = __commonJS4({
|
|
|
157208
157249
|
}
|
|
157209
157250
|
}
|
|
157210
157251
|
function isNamedType(type) {
|
|
157211
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
157252
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isInputObjectType2(type);
|
|
157212
157253
|
}
|
|
157213
157254
|
function assertNamedType(type) {
|
|
157214
157255
|
if (!isNamedType(type)) {
|
|
@@ -210361,6 +210402,7 @@ function testConfigFile({ plugins, ...config22 } = {}) {
|
|
|
210361
210402
|
entitiesByCursor(first: Int, after: String, last: Int, before: String): EntityConnection!
|
|
210362
210403
|
node(id: ID!): Node
|
|
210363
210404
|
customIdList: [CustomIdType]!
|
|
210405
|
+
nodes(ids: [ID!]!): [Node!]!
|
|
210364
210406
|
}
|
|
210365
210407
|
|
|
210366
210408
|
type PageInfo {
|
|
@@ -210543,7 +210585,7 @@ function testConfig(config22 = {}) {
|
|
|
210543
210585
|
...testConfigFile(config22)
|
|
210544
210586
|
});
|
|
210545
210587
|
}
|
|
210546
|
-
function mockCollectedDoc(query22) {
|
|
210588
|
+
function mockCollectedDoc(query22, data2) {
|
|
210547
210589
|
const parsed = graphql252.parse(query22);
|
|
210548
210590
|
const name = parsed.definitions[0].name.value;
|
|
210549
210591
|
const operations = parsed.definitions;
|
|
@@ -210566,7 +210608,8 @@ function mockCollectedDoc(query22) {
|
|
|
210566
210608
|
generateArtifact: true,
|
|
210567
210609
|
generateStore: true,
|
|
210568
210610
|
originalString: query22,
|
|
210569
|
-
artifact: null
|
|
210611
|
+
artifact: null,
|
|
210612
|
+
...data2
|
|
210570
210613
|
};
|
|
210571
210614
|
}
|
|
210572
210615
|
|
|
@@ -217995,7 +218038,7 @@ var require_definition5 = __commonJS5({
|
|
|
217995
218038
|
exports.assertInterfaceType = assertInterfaceType;
|
|
217996
218039
|
exports.isUnionType = isUnionType13;
|
|
217997
218040
|
exports.assertUnionType = assertUnionType;
|
|
217998
|
-
exports.isEnumType =
|
|
218041
|
+
exports.isEnumType = isEnumType12;
|
|
217999
218042
|
exports.assertEnumType = assertEnumType;
|
|
218000
218043
|
exports.isInputObjectType = isInputObjectType8;
|
|
218001
218044
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -218066,7 +218109,7 @@ var require_definition5 = __commonJS5({
|
|
|
218066
218109
|
return Constructor;
|
|
218067
218110
|
}
|
|
218068
218111
|
function isType(type) {
|
|
218069
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218112
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
218070
218113
|
}
|
|
218071
218114
|
function assertType(type) {
|
|
218072
218115
|
if (!isType(type)) {
|
|
@@ -218110,11 +218153,11 @@ var require_definition5 = __commonJS5({
|
|
|
218110
218153
|
}
|
|
218111
218154
|
return type;
|
|
218112
218155
|
}
|
|
218113
|
-
function
|
|
218156
|
+
function isEnumType12(type) {
|
|
218114
218157
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
218115
218158
|
}
|
|
218116
218159
|
function assertEnumType(type) {
|
|
218117
|
-
if (!
|
|
218160
|
+
if (!isEnumType12(type)) {
|
|
218118
218161
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
218119
218162
|
}
|
|
218120
218163
|
return type;
|
|
@@ -218147,7 +218190,7 @@ var require_definition5 = __commonJS5({
|
|
|
218147
218190
|
return type;
|
|
218148
218191
|
}
|
|
218149
218192
|
function isInputType(type) {
|
|
218150
|
-
return isScalarType13(type) ||
|
|
218193
|
+
return isScalarType13(type) || isEnumType12(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
218151
218194
|
}
|
|
218152
218195
|
function assertInputType(type) {
|
|
218153
218196
|
if (!isInputType(type)) {
|
|
@@ -218156,7 +218199,7 @@ var require_definition5 = __commonJS5({
|
|
|
218156
218199
|
return type;
|
|
218157
218200
|
}
|
|
218158
218201
|
function isOutputType(type) {
|
|
218159
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218202
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
218160
218203
|
}
|
|
218161
218204
|
function assertOutputType(type) {
|
|
218162
218205
|
if (!isOutputType(type)) {
|
|
@@ -218165,7 +218208,7 @@ var require_definition5 = __commonJS5({
|
|
|
218165
218208
|
return type;
|
|
218166
218209
|
}
|
|
218167
218210
|
function isLeafType4(type) {
|
|
218168
|
-
return isScalarType13(type) ||
|
|
218211
|
+
return isScalarType13(type) || isEnumType12(type);
|
|
218169
218212
|
}
|
|
218170
218213
|
function assertLeafType(type) {
|
|
218171
218214
|
if (!isLeafType4(type)) {
|
|
@@ -218253,7 +218296,7 @@ var require_definition5 = __commonJS5({
|
|
|
218253
218296
|
}
|
|
218254
218297
|
}
|
|
218255
218298
|
function isNamedType4(type) {
|
|
218256
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218299
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type);
|
|
218257
218300
|
}
|
|
218258
218301
|
function assertNamedType(type) {
|
|
218259
218302
|
if (!isNamedType4(type)) {
|
|
@@ -304204,21 +304247,56 @@ async function fragmentTypedefs(input) {
|
|
|
304204
304247
|
document_input.typeAnnotation = AST16.tsTypeAnnotation(
|
|
304205
304248
|
AST16.tsTypeReference(AST16.identifier(store))
|
|
304206
304249
|
);
|
|
304207
|
-
|
|
304208
|
-
|
|
304209
|
-
|
|
304210
|
-
|
|
304211
|
-
|
|
304212
|
-
|
|
304213
|
-
|
|
304214
|
-
|
|
304215
|
-
|
|
304250
|
+
let store_type = "FragmentStoreInstance";
|
|
304251
|
+
if (doc.refetch?.paginated) {
|
|
304252
|
+
if (doc.refetch.method === "cursor") {
|
|
304253
|
+
store_type = "CursorFragmentStoreInstance";
|
|
304254
|
+
} else {
|
|
304255
|
+
store_type = "OffsetFragmentStoreInstance";
|
|
304256
|
+
}
|
|
304257
|
+
}
|
|
304258
|
+
ensureImports({
|
|
304259
|
+
config: input.config,
|
|
304260
|
+
body: contents.script.body,
|
|
304261
|
+
sourceModule: "./types",
|
|
304262
|
+
import: [store_type],
|
|
304263
|
+
importKind: "type"
|
|
304264
|
+
});
|
|
304216
304265
|
ensureImports({
|
|
304217
304266
|
config: input.config,
|
|
304218
304267
|
body: contents.script.body,
|
|
304219
304268
|
sourceModule: import_path,
|
|
304220
304269
|
import: [store]
|
|
304221
304270
|
});
|
|
304271
|
+
const shapeID = `${doc.name}$data`;
|
|
304272
|
+
const inputID = `${doc.name}$input`;
|
|
304273
|
+
ensureImports({
|
|
304274
|
+
config: input.config,
|
|
304275
|
+
body: contents.script.body,
|
|
304276
|
+
sourceModule: "../../../artifacts/" + doc.name,
|
|
304277
|
+
import: [inputID, shapeID]
|
|
304278
|
+
});
|
|
304279
|
+
const typeParams = [];
|
|
304280
|
+
if (doc.refetch?.paginated) {
|
|
304281
|
+
typeParams.push(AST16.tsTypeReference(AST16.identifier(inputID)));
|
|
304282
|
+
}
|
|
304283
|
+
const return_value = AST16.tsTypeReference(
|
|
304284
|
+
AST16.identifier(store_type),
|
|
304285
|
+
AST16.tsTypeParameterInstantiation([
|
|
304286
|
+
AST16.tsTypeReference(AST16.identifier(shapeID)),
|
|
304287
|
+
...typeParams
|
|
304288
|
+
])
|
|
304289
|
+
);
|
|
304290
|
+
const null_return_value = AST16.tsTypeReference(
|
|
304291
|
+
AST16.identifier(store_type),
|
|
304292
|
+
AST16.tsTypeParameterInstantiation([
|
|
304293
|
+
AST16.tsUnionType([
|
|
304294
|
+
AST16.tsTypeReference(AST16.identifier(shapeID)),
|
|
304295
|
+
AST16.tsNullKeyword()
|
|
304296
|
+
]),
|
|
304297
|
+
...typeParams
|
|
304298
|
+
])
|
|
304299
|
+
);
|
|
304222
304300
|
return [
|
|
304223
304301
|
AST16.exportNamedDeclaration(
|
|
304224
304302
|
AST16.tsDeclareFunction(
|
|
@@ -304231,9 +304309,7 @@ async function fragmentTypedefs(input) {
|
|
|
304231
304309
|
AST16.tsDeclareFunction(
|
|
304232
304310
|
AST16.identifier(which),
|
|
304233
304311
|
[initial_value_or_null_input, document_input],
|
|
304234
|
-
AST16.tsTypeAnnotation(
|
|
304235
|
-
AST16.tsUnionType([return_value, AST16.tsNullKeyword()])
|
|
304236
|
-
)
|
|
304312
|
+
AST16.tsTypeAnnotation(null_return_value)
|
|
304237
304313
|
)
|
|
304238
304314
|
)
|
|
304239
304315
|
];
|
|
@@ -306064,7 +306140,7 @@ async function test_config(extraConfig = {}) {
|
|
|
306064
306140
|
}
|
|
306065
306141
|
async function pipeline_test(documents, extra_config) {
|
|
306066
306142
|
const config5 = await test_config(extra_config);
|
|
306067
|
-
const docs = documents.map(mockCollectedDoc);
|
|
306143
|
+
const docs = documents.map((doc) => mockCollectedDoc(doc));
|
|
306068
306144
|
await runPipeline22(config5, docs);
|
|
306069
306145
|
return {
|
|
306070
306146
|
pluginRoot: config5.pluginDirectory("houdini-svelte"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini-svelte",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "The svelte plugin for houdini",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"rollup": "^3.7.4",
|
|
33
33
|
"svelte": "^3.55.1",
|
|
34
34
|
"vite": "^4.1.1",
|
|
35
|
-
"houdini": "^1.0.
|
|
35
|
+
"houdini": "^1.0.2"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"build"
|