houdini-svelte 1.0.0 → 1.0.1
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.
|
@@ -100066,7 +100066,7 @@ var require_definition3 = __commonJS3({
|
|
|
100066
100066
|
exports.assertInterfaceType = assertInterfaceType;
|
|
100067
100067
|
exports.isUnionType = isUnionType13;
|
|
100068
100068
|
exports.assertUnionType = assertUnionType;
|
|
100069
|
-
exports.isEnumType =
|
|
100069
|
+
exports.isEnumType = isEnumType12;
|
|
100070
100070
|
exports.assertEnumType = assertEnumType;
|
|
100071
100071
|
exports.isInputObjectType = isInputObjectType8;
|
|
100072
100072
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -100137,7 +100137,7 @@ var require_definition3 = __commonJS3({
|
|
|
100137
100137
|
return Constructor;
|
|
100138
100138
|
}
|
|
100139
100139
|
function isType(type) {
|
|
100140
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
100140
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
100141
100141
|
}
|
|
100142
100142
|
function assertType(type) {
|
|
100143
100143
|
if (!isType(type)) {
|
|
@@ -100181,11 +100181,11 @@ var require_definition3 = __commonJS3({
|
|
|
100181
100181
|
}
|
|
100182
100182
|
return type;
|
|
100183
100183
|
}
|
|
100184
|
-
function
|
|
100184
|
+
function isEnumType12(type) {
|
|
100185
100185
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
100186
100186
|
}
|
|
100187
100187
|
function assertEnumType(type) {
|
|
100188
|
-
if (!
|
|
100188
|
+
if (!isEnumType12(type)) {
|
|
100189
100189
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
100190
100190
|
}
|
|
100191
100191
|
return type;
|
|
@@ -100218,7 +100218,7 @@ var require_definition3 = __commonJS3({
|
|
|
100218
100218
|
return type;
|
|
100219
100219
|
}
|
|
100220
100220
|
function isInputType(type) {
|
|
100221
|
-
return isScalarType13(type) ||
|
|
100221
|
+
return isScalarType13(type) || isEnumType12(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
100222
100222
|
}
|
|
100223
100223
|
function assertInputType(type) {
|
|
100224
100224
|
if (!isInputType(type)) {
|
|
@@ -100227,7 +100227,7 @@ var require_definition3 = __commonJS3({
|
|
|
100227
100227
|
return type;
|
|
100228
100228
|
}
|
|
100229
100229
|
function isOutputType(type) {
|
|
100230
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
100230
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
100231
100231
|
}
|
|
100232
100232
|
function assertOutputType(type) {
|
|
100233
100233
|
if (!isOutputType(type)) {
|
|
@@ -100236,7 +100236,7 @@ var require_definition3 = __commonJS3({
|
|
|
100236
100236
|
return type;
|
|
100237
100237
|
}
|
|
100238
100238
|
function isLeafType4(type) {
|
|
100239
|
-
return isScalarType13(type) ||
|
|
100239
|
+
return isScalarType13(type) || isEnumType12(type);
|
|
100240
100240
|
}
|
|
100241
100241
|
function assertLeafType(type) {
|
|
100242
100242
|
if (!isLeafType4(type)) {
|
|
@@ -100324,7 +100324,7 @@ var require_definition3 = __commonJS3({
|
|
|
100324
100324
|
}
|
|
100325
100325
|
}
|
|
100326
100326
|
function isNamedType4(type) {
|
|
100327
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
100327
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type);
|
|
100328
100328
|
}
|
|
100329
100329
|
function assertNamedType(type) {
|
|
100330
100330
|
if (!isNamedType4(type)) {
|
|
@@ -100060,7 +100060,7 @@ var require_definition3 = __commonJS3({
|
|
|
100060
100060
|
exports.assertInterfaceType = assertInterfaceType;
|
|
100061
100061
|
exports.isUnionType = isUnionType13;
|
|
100062
100062
|
exports.assertUnionType = assertUnionType;
|
|
100063
|
-
exports.isEnumType =
|
|
100063
|
+
exports.isEnumType = isEnumType12;
|
|
100064
100064
|
exports.assertEnumType = assertEnumType;
|
|
100065
100065
|
exports.isInputObjectType = isInputObjectType8;
|
|
100066
100066
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -100131,7 +100131,7 @@ var require_definition3 = __commonJS3({
|
|
|
100131
100131
|
return Constructor;
|
|
100132
100132
|
}
|
|
100133
100133
|
function isType(type) {
|
|
100134
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
100134
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
100135
100135
|
}
|
|
100136
100136
|
function assertType(type) {
|
|
100137
100137
|
if (!isType(type)) {
|
|
@@ -100175,11 +100175,11 @@ var require_definition3 = __commonJS3({
|
|
|
100175
100175
|
}
|
|
100176
100176
|
return type;
|
|
100177
100177
|
}
|
|
100178
|
-
function
|
|
100178
|
+
function isEnumType12(type) {
|
|
100179
100179
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
100180
100180
|
}
|
|
100181
100181
|
function assertEnumType(type) {
|
|
100182
|
-
if (!
|
|
100182
|
+
if (!isEnumType12(type)) {
|
|
100183
100183
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
100184
100184
|
}
|
|
100185
100185
|
return type;
|
|
@@ -100212,7 +100212,7 @@ var require_definition3 = __commonJS3({
|
|
|
100212
100212
|
return type;
|
|
100213
100213
|
}
|
|
100214
100214
|
function isInputType(type) {
|
|
100215
|
-
return isScalarType13(type) ||
|
|
100215
|
+
return isScalarType13(type) || isEnumType12(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
100216
100216
|
}
|
|
100217
100217
|
function assertInputType(type) {
|
|
100218
100218
|
if (!isInputType(type)) {
|
|
@@ -100221,7 +100221,7 @@ var require_definition3 = __commonJS3({
|
|
|
100221
100221
|
return type;
|
|
100222
100222
|
}
|
|
100223
100223
|
function isOutputType(type) {
|
|
100224
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
100224
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
100225
100225
|
}
|
|
100226
100226
|
function assertOutputType(type) {
|
|
100227
100227
|
if (!isOutputType(type)) {
|
|
@@ -100230,7 +100230,7 @@ var require_definition3 = __commonJS3({
|
|
|
100230
100230
|
return type;
|
|
100231
100231
|
}
|
|
100232
100232
|
function isLeafType4(type) {
|
|
100233
|
-
return isScalarType13(type) ||
|
|
100233
|
+
return isScalarType13(type) || isEnumType12(type);
|
|
100234
100234
|
}
|
|
100235
100235
|
function assertLeafType(type) {
|
|
100236
100236
|
if (!isLeafType4(type)) {
|
|
@@ -100318,7 +100318,7 @@ var require_definition3 = __commonJS3({
|
|
|
100318
100318
|
}
|
|
100319
100319
|
}
|
|
100320
100320
|
function isNamedType4(type) {
|
|
100321
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
100321
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type);
|
|
100322
100322
|
}
|
|
100323
100323
|
function assertNamedType(type) {
|
|
100324
100324
|
if (!isNamedType4(type)) {
|
|
@@ -131930,7 +131930,7 @@ var require_definition2 = __commonJS3({
|
|
|
131930
131930
|
exports.assertInterfaceType = assertInterfaceType;
|
|
131931
131931
|
exports.isUnionType = isUnionType13;
|
|
131932
131932
|
exports.assertUnionType = assertUnionType;
|
|
131933
|
-
exports.isEnumType =
|
|
131933
|
+
exports.isEnumType = isEnumType12;
|
|
131934
131934
|
exports.assertEnumType = assertEnumType;
|
|
131935
131935
|
exports.isInputObjectType = isInputObjectType8;
|
|
131936
131936
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -132001,7 +132001,7 @@ var require_definition2 = __commonJS3({
|
|
|
132001
132001
|
return Constructor;
|
|
132002
132002
|
}
|
|
132003
132003
|
function isType(type) {
|
|
132004
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
132004
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
132005
132005
|
}
|
|
132006
132006
|
function assertType(type) {
|
|
132007
132007
|
if (!isType(type)) {
|
|
@@ -132045,11 +132045,11 @@ var require_definition2 = __commonJS3({
|
|
|
132045
132045
|
}
|
|
132046
132046
|
return type;
|
|
132047
132047
|
}
|
|
132048
|
-
function
|
|
132048
|
+
function isEnumType12(type) {
|
|
132049
132049
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
132050
132050
|
}
|
|
132051
132051
|
function assertEnumType(type) {
|
|
132052
|
-
if (!
|
|
132052
|
+
if (!isEnumType12(type)) {
|
|
132053
132053
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
132054
132054
|
}
|
|
132055
132055
|
return type;
|
|
@@ -132082,7 +132082,7 @@ var require_definition2 = __commonJS3({
|
|
|
132082
132082
|
return type;
|
|
132083
132083
|
}
|
|
132084
132084
|
function isInputType(type) {
|
|
132085
|
-
return isScalarType13(type) ||
|
|
132085
|
+
return isScalarType13(type) || isEnumType12(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
132086
132086
|
}
|
|
132087
132087
|
function assertInputType(type) {
|
|
132088
132088
|
if (!isInputType(type)) {
|
|
@@ -132091,7 +132091,7 @@ var require_definition2 = __commonJS3({
|
|
|
132091
132091
|
return type;
|
|
132092
132092
|
}
|
|
132093
132093
|
function isOutputType(type) {
|
|
132094
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
132094
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
132095
132095
|
}
|
|
132096
132096
|
function assertOutputType(type) {
|
|
132097
132097
|
if (!isOutputType(type)) {
|
|
@@ -132100,7 +132100,7 @@ var require_definition2 = __commonJS3({
|
|
|
132100
132100
|
return type;
|
|
132101
132101
|
}
|
|
132102
132102
|
function isLeafType4(type) {
|
|
132103
|
-
return isScalarType13(type) ||
|
|
132103
|
+
return isScalarType13(type) || isEnumType12(type);
|
|
132104
132104
|
}
|
|
132105
132105
|
function assertLeafType(type) {
|
|
132106
132106
|
if (!isLeafType4(type)) {
|
|
@@ -132188,7 +132188,7 @@ var require_definition2 = __commonJS3({
|
|
|
132188
132188
|
}
|
|
132189
132189
|
}
|
|
132190
132190
|
function isNamedType4(type) {
|
|
132191
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
132191
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type);
|
|
132192
132192
|
}
|
|
132193
132193
|
function assertNamedType(type) {
|
|
132194
132194
|
if (!isNamedType4(type)) {
|
|
@@ -131922,7 +131922,7 @@ var require_definition2 = __commonJS3({
|
|
|
131922
131922
|
exports.assertInterfaceType = assertInterfaceType;
|
|
131923
131923
|
exports.isUnionType = isUnionType13;
|
|
131924
131924
|
exports.assertUnionType = assertUnionType;
|
|
131925
|
-
exports.isEnumType =
|
|
131925
|
+
exports.isEnumType = isEnumType12;
|
|
131926
131926
|
exports.assertEnumType = assertEnumType;
|
|
131927
131927
|
exports.isInputObjectType = isInputObjectType8;
|
|
131928
131928
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -131993,7 +131993,7 @@ var require_definition2 = __commonJS3({
|
|
|
131993
131993
|
return Constructor;
|
|
131994
131994
|
}
|
|
131995
131995
|
function isType(type) {
|
|
131996
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
131996
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
131997
131997
|
}
|
|
131998
131998
|
function assertType(type) {
|
|
131999
131999
|
if (!isType(type)) {
|
|
@@ -132037,11 +132037,11 @@ var require_definition2 = __commonJS3({
|
|
|
132037
132037
|
}
|
|
132038
132038
|
return type;
|
|
132039
132039
|
}
|
|
132040
|
-
function
|
|
132040
|
+
function isEnumType12(type) {
|
|
132041
132041
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
132042
132042
|
}
|
|
132043
132043
|
function assertEnumType(type) {
|
|
132044
|
-
if (!
|
|
132044
|
+
if (!isEnumType12(type)) {
|
|
132045
132045
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
132046
132046
|
}
|
|
132047
132047
|
return type;
|
|
@@ -132074,7 +132074,7 @@ var require_definition2 = __commonJS3({
|
|
|
132074
132074
|
return type;
|
|
132075
132075
|
}
|
|
132076
132076
|
function isInputType(type) {
|
|
132077
|
-
return isScalarType13(type) ||
|
|
132077
|
+
return isScalarType13(type) || isEnumType12(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
132078
132078
|
}
|
|
132079
132079
|
function assertInputType(type) {
|
|
132080
132080
|
if (!isInputType(type)) {
|
|
@@ -132083,7 +132083,7 @@ var require_definition2 = __commonJS3({
|
|
|
132083
132083
|
return type;
|
|
132084
132084
|
}
|
|
132085
132085
|
function isOutputType(type) {
|
|
132086
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
132086
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
132087
132087
|
}
|
|
132088
132088
|
function assertOutputType(type) {
|
|
132089
132089
|
if (!isOutputType(type)) {
|
|
@@ -132092,7 +132092,7 @@ var require_definition2 = __commonJS3({
|
|
|
132092
132092
|
return type;
|
|
132093
132093
|
}
|
|
132094
132094
|
function isLeafType4(type) {
|
|
132095
|
-
return isScalarType13(type) ||
|
|
132095
|
+
return isScalarType13(type) || isEnumType12(type);
|
|
132096
132096
|
}
|
|
132097
132097
|
function assertLeafType(type) {
|
|
132098
132098
|
if (!isLeafType4(type)) {
|
|
@@ -132180,7 +132180,7 @@ var require_definition2 = __commonJS3({
|
|
|
132180
132180
|
}
|
|
132181
132181
|
}
|
|
132182
132182
|
function isNamedType4(type) {
|
|
132183
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
132183
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type);
|
|
132184
132184
|
}
|
|
132185
132185
|
function assertNamedType(type) {
|
|
132186
132186
|
if (!isNamedType4(type)) {
|
package/build/test-cjs/index.js
CHANGED
|
@@ -95928,7 +95928,7 @@ var require_definition2 = __commonJS3({
|
|
|
95928
95928
|
exports.assertInterfaceType = assertInterfaceType;
|
|
95929
95929
|
exports.isUnionType = isUnionType7;
|
|
95930
95930
|
exports.assertUnionType = assertUnionType;
|
|
95931
|
-
exports.isEnumType =
|
|
95931
|
+
exports.isEnumType = isEnumType7;
|
|
95932
95932
|
exports.assertEnumType = assertEnumType;
|
|
95933
95933
|
exports.isInputObjectType = isInputObjectType2;
|
|
95934
95934
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -95999,7 +95999,7 @@ var require_definition2 = __commonJS3({
|
|
|
95999
95999
|
return Constructor;
|
|
96000
96000
|
}
|
|
96001
96001
|
function isType(type) {
|
|
96002
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
96002
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isInputObjectType2(type) || isListType3(type) || isNonNullType6(type);
|
|
96003
96003
|
}
|
|
96004
96004
|
function assertType(type) {
|
|
96005
96005
|
if (!isType(type)) {
|
|
@@ -96043,11 +96043,11 @@ var require_definition2 = __commonJS3({
|
|
|
96043
96043
|
}
|
|
96044
96044
|
return type;
|
|
96045
96045
|
}
|
|
96046
|
-
function
|
|
96046
|
+
function isEnumType7(type) {
|
|
96047
96047
|
return (0, _instanceOf.default)(type, GraphQLEnumType);
|
|
96048
96048
|
}
|
|
96049
96049
|
function assertEnumType(type) {
|
|
96050
|
-
if (!
|
|
96050
|
+
if (!isEnumType7(type)) {
|
|
96051
96051
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
96052
96052
|
}
|
|
96053
96053
|
return type;
|
|
@@ -96080,7 +96080,7 @@ var require_definition2 = __commonJS3({
|
|
|
96080
96080
|
return type;
|
|
96081
96081
|
}
|
|
96082
96082
|
function isInputType(type) {
|
|
96083
|
-
return isScalarType7(type) ||
|
|
96083
|
+
return isScalarType7(type) || isEnumType7(type) || isInputObjectType2(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
96084
96084
|
}
|
|
96085
96085
|
function assertInputType(type) {
|
|
96086
96086
|
if (!isInputType(type)) {
|
|
@@ -96089,7 +96089,7 @@ var require_definition2 = __commonJS3({
|
|
|
96089
96089
|
return type;
|
|
96090
96090
|
}
|
|
96091
96091
|
function isOutputType(type) {
|
|
96092
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
96092
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
96093
96093
|
}
|
|
96094
96094
|
function assertOutputType(type) {
|
|
96095
96095
|
if (!isOutputType(type)) {
|
|
@@ -96098,7 +96098,7 @@ var require_definition2 = __commonJS3({
|
|
|
96098
96098
|
return type;
|
|
96099
96099
|
}
|
|
96100
96100
|
function isLeafType(type) {
|
|
96101
|
-
return isScalarType7(type) ||
|
|
96101
|
+
return isScalarType7(type) || isEnumType7(type);
|
|
96102
96102
|
}
|
|
96103
96103
|
function assertLeafType(type) {
|
|
96104
96104
|
if (!isLeafType(type)) {
|
|
@@ -96186,7 +96186,7 @@ var require_definition2 = __commonJS3({
|
|
|
96186
96186
|
}
|
|
96187
96187
|
}
|
|
96188
96188
|
function isNamedType(type) {
|
|
96189
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
96189
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isInputObjectType2(type);
|
|
96190
96190
|
}
|
|
96191
96191
|
function assertNamedType(type) {
|
|
96192
96192
|
if (!isNamedType(type)) {
|
|
@@ -149361,26 +149361,45 @@ function fragmentArguments(config22, filepath, definition) {
|
|
|
149361
149361
|
if (!typeArg || typeArg.kind !== "StringValue") {
|
|
149362
149362
|
return [];
|
|
149363
149363
|
}
|
|
149364
|
-
let type = typeArg.value;
|
|
149365
|
-
let name = arg.name.value;
|
|
149366
|
-
let required = false;
|
|
149364
|
+
let type = parseArgumentTypeString(typeArg.value);
|
|
149367
149365
|
let defaultValue = arg.value.fields?.find((arg2) => arg2.name.value === "default")?.value || null;
|
|
149368
|
-
if (type[type.length - 1] === "!") {
|
|
149369
|
-
type = type.slice(0, -1);
|
|
149370
|
-
required = true;
|
|
149371
|
-
defaultValue = null;
|
|
149372
|
-
}
|
|
149373
149366
|
return [
|
|
149374
149367
|
{
|
|
149375
|
-
name,
|
|
149368
|
+
name: arg.name.value,
|
|
149376
149369
|
type,
|
|
149377
|
-
required,
|
|
149370
|
+
required: type.kind === "NonNullType",
|
|
149378
149371
|
defaultValue
|
|
149379
149372
|
}
|
|
149380
149373
|
];
|
|
149381
149374
|
}) || []
|
|
149382
149375
|
);
|
|
149383
149376
|
}
|
|
149377
|
+
function parseArgumentTypeString(input) {
|
|
149378
|
+
if (input[input.length - 1] === "!") {
|
|
149379
|
+
const inner = parseArgumentTypeString(input.substring(0, input.length - 1));
|
|
149380
|
+
if (inner.kind === "NonNullType") {
|
|
149381
|
+
throw new Error("invalid type" + input);
|
|
149382
|
+
}
|
|
149383
|
+
return {
|
|
149384
|
+
kind: "NonNullType",
|
|
149385
|
+
type: inner
|
|
149386
|
+
};
|
|
149387
|
+
}
|
|
149388
|
+
if (input[input.length - 1] === "]") {
|
|
149389
|
+
const inner = parseArgumentTypeString(input.substring(1, input.length - 1));
|
|
149390
|
+
return {
|
|
149391
|
+
kind: "ListType",
|
|
149392
|
+
type: inner
|
|
149393
|
+
};
|
|
149394
|
+
}
|
|
149395
|
+
return {
|
|
149396
|
+
kind: "NamedType",
|
|
149397
|
+
name: {
|
|
149398
|
+
kind: "Name",
|
|
149399
|
+
value: input
|
|
149400
|
+
}
|
|
149401
|
+
};
|
|
149402
|
+
}
|
|
149384
149403
|
function collectDefaultArgumentValues(config22, filepath, definition) {
|
|
149385
149404
|
let result = {};
|
|
149386
149405
|
for (const { name, required, defaultValue } of fragmentArguments(
|
|
@@ -149443,19 +149462,9 @@ function fragmentArgumentsDefinitions(config22, filepath, definition) {
|
|
|
149443
149462
|
return [];
|
|
149444
149463
|
}
|
|
149445
149464
|
return args.map((arg) => {
|
|
149446
|
-
const innerType = {
|
|
149447
|
-
kind: "NamedType",
|
|
149448
|
-
name: {
|
|
149449
|
-
kind: "Name",
|
|
149450
|
-
value: arg.type
|
|
149451
|
-
}
|
|
149452
|
-
};
|
|
149453
149465
|
return {
|
|
149454
149466
|
kind: "VariableDefinition",
|
|
149455
|
-
type: arg.
|
|
149456
|
-
kind: "NonNullType",
|
|
149457
|
-
type: innerType
|
|
149458
|
-
},
|
|
149467
|
+
type: arg.type,
|
|
149459
149468
|
variable: {
|
|
149460
149469
|
kind: "Variable",
|
|
149461
149470
|
name: {
|
|
@@ -152718,7 +152727,7 @@ async function typeCheck(config22, docs) {
|
|
|
152718
152727
|
const lists = [];
|
|
152719
152728
|
const listTypes = [];
|
|
152720
152729
|
const fragments = {};
|
|
152721
|
-
for (const { document: parsed, filename } of docs) {
|
|
152730
|
+
for (const { document: parsed, originalString, filename } of docs) {
|
|
152722
152731
|
graphql24.visit(parsed, {
|
|
152723
152732
|
[graphql24.Kind.FRAGMENT_DEFINITION](definition) {
|
|
152724
152733
|
fragments[definition.name.value] = definition;
|
|
@@ -152916,7 +152925,7 @@ async function typeCheck(config22, docs) {
|
|
|
152916
152925
|
paginateArgs(config22, filepath),
|
|
152917
152926
|
noUnusedFragmentArguments(config22)
|
|
152918
152927
|
);
|
|
152919
|
-
for (const { filename, document: parsed } of docs) {
|
|
152928
|
+
for (const { filename, document: parsed, originalString } of docs) {
|
|
152920
152929
|
for (const error3 of graphql24.validate(config22.schema, parsed, rules(filename))) {
|
|
152921
152930
|
errors.push(
|
|
152922
152931
|
new HoudiniError2({
|
|
@@ -153152,24 +153161,15 @@ function validateFragmentArguments(config22, filepath, fragments) {
|
|
|
153152
153161
|
)
|
|
153153
153162
|
);
|
|
153154
153163
|
} else {
|
|
153155
|
-
const zipped = appliedArgumentNames.map(
|
|
153156
|
-
|
|
153157
|
-
|
|
153158
|
-
|
|
153159
|
-
]
|
|
153160
|
-
);
|
|
153164
|
+
const zipped = appliedArgumentNames.map((name) => [
|
|
153165
|
+
appliedArguments[name],
|
|
153166
|
+
fragmentArguments2[fragmentName].find((arg) => arg.name === name).type
|
|
153167
|
+
]);
|
|
153161
153168
|
for (const [applied, target] of zipped) {
|
|
153162
|
-
if (
|
|
153163
|
-
continue;
|
|
153164
|
-
}
|
|
153165
|
-
const appliedType = applied.value.kind.substring(
|
|
153166
|
-
0,
|
|
153167
|
-
applied.value.kind.length - "Value".length
|
|
153168
|
-
);
|
|
153169
|
-
if (appliedType !== target) {
|
|
153169
|
+
if (!valueIsType(config22, applied.value, target)) {
|
|
153170
153170
|
ctx.reportError(
|
|
153171
153171
|
new graphql24.GraphQLError(
|
|
153172
|
-
`Invalid argument type. Expected ${target}, found ${
|
|
153172
|
+
`Invalid argument type. Expected ${target}, found ${applied.value.kind}`
|
|
153173
153173
|
)
|
|
153174
153174
|
);
|
|
153175
153175
|
}
|
|
@@ -153179,6 +153179,47 @@ function validateFragmentArguments(config22, filepath, fragments) {
|
|
|
153179
153179
|
};
|
|
153180
153180
|
};
|
|
153181
153181
|
}
|
|
153182
|
+
function valueIsType(config22, value2, targetType) {
|
|
153183
|
+
if (value2.kind === "NullValue") {
|
|
153184
|
+
return targetType.kind !== "NonNullType";
|
|
153185
|
+
}
|
|
153186
|
+
if (targetType.kind === "NonNullType") {
|
|
153187
|
+
targetType = targetType.type;
|
|
153188
|
+
}
|
|
153189
|
+
if (value2.kind === "ListValue") {
|
|
153190
|
+
if (targetType.kind !== "ListType") {
|
|
153191
|
+
return false;
|
|
153192
|
+
}
|
|
153193
|
+
const listType = targetType.type;
|
|
153194
|
+
return value2.values.every((value22) => valueIsType(config22, value22, listType));
|
|
153195
|
+
}
|
|
153196
|
+
if (value2.kind === "BooleanValue") {
|
|
153197
|
+
return targetType.kind === "NamedType" && targetType.name.value === "Boolean";
|
|
153198
|
+
}
|
|
153199
|
+
if (value2.kind === "StringValue") {
|
|
153200
|
+
return targetType.kind === "NamedType" && targetType.name.value === "String";
|
|
153201
|
+
}
|
|
153202
|
+
if (value2.kind === "IntValue") {
|
|
153203
|
+
return targetType.kind === "NamedType" && targetType.name.value === "Int";
|
|
153204
|
+
}
|
|
153205
|
+
if (value2.kind === "FloatValue") {
|
|
153206
|
+
return targetType.kind === "NamedType" && targetType.name.value === "Float";
|
|
153207
|
+
}
|
|
153208
|
+
if (value2.kind === "ObjectValue" && targetType.kind === "NamedType") {
|
|
153209
|
+
return true;
|
|
153210
|
+
}
|
|
153211
|
+
if (value2.kind === "EnumValue" && targetType.kind === "NamedType") {
|
|
153212
|
+
const enumType = config22.schema.getType(targetType.name.value);
|
|
153213
|
+
if (!graphql24.isEnumType(enumType)) {
|
|
153214
|
+
return false;
|
|
153215
|
+
}
|
|
153216
|
+
return enumType.getValues().some((enumValue) => enumValue.value === value2.value);
|
|
153217
|
+
}
|
|
153218
|
+
if (value2.kind === "Variable") {
|
|
153219
|
+
return true;
|
|
153220
|
+
}
|
|
153221
|
+
return false;
|
|
153222
|
+
}
|
|
153182
153223
|
function paginateArgs(config22, filepath) {
|
|
153183
153224
|
return function(ctx) {
|
|
153184
153225
|
let alreadyPaginated = false;
|
|
@@ -156960,7 +157001,7 @@ var require_definition3 = __commonJS4({
|
|
|
156960
157001
|
exports.assertInterfaceType = assertInterfaceType;
|
|
156961
157002
|
exports.isUnionType = isUnionType7;
|
|
156962
157003
|
exports.assertUnionType = assertUnionType;
|
|
156963
|
-
exports.isEnumType =
|
|
157004
|
+
exports.isEnumType = isEnumType7;
|
|
156964
157005
|
exports.assertEnumType = assertEnumType;
|
|
156965
157006
|
exports.isInputObjectType = isInputObjectType2;
|
|
156966
157007
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -157031,7 +157072,7 @@ var require_definition3 = __commonJS4({
|
|
|
157031
157072
|
return Constructor;
|
|
157032
157073
|
}
|
|
157033
157074
|
function isType(type) {
|
|
157034
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
157075
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isInputObjectType2(type) || isListType3(type) || isNonNullType6(type);
|
|
157035
157076
|
}
|
|
157036
157077
|
function assertType(type) {
|
|
157037
157078
|
if (!isType(type)) {
|
|
@@ -157075,11 +157116,11 @@ var require_definition3 = __commonJS4({
|
|
|
157075
157116
|
}
|
|
157076
157117
|
return type;
|
|
157077
157118
|
}
|
|
157078
|
-
function
|
|
157119
|
+
function isEnumType7(type) {
|
|
157079
157120
|
return (0, _instanceOf.default)(type, GraphQLEnumType);
|
|
157080
157121
|
}
|
|
157081
157122
|
function assertEnumType(type) {
|
|
157082
|
-
if (!
|
|
157123
|
+
if (!isEnumType7(type)) {
|
|
157083
157124
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
157084
157125
|
}
|
|
157085
157126
|
return type;
|
|
@@ -157112,7 +157153,7 @@ var require_definition3 = __commonJS4({
|
|
|
157112
157153
|
return type;
|
|
157113
157154
|
}
|
|
157114
157155
|
function isInputType(type) {
|
|
157115
|
-
return isScalarType7(type) ||
|
|
157156
|
+
return isScalarType7(type) || isEnumType7(type) || isInputObjectType2(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
157116
157157
|
}
|
|
157117
157158
|
function assertInputType(type) {
|
|
157118
157159
|
if (!isInputType(type)) {
|
|
@@ -157121,7 +157162,7 @@ var require_definition3 = __commonJS4({
|
|
|
157121
157162
|
return type;
|
|
157122
157163
|
}
|
|
157123
157164
|
function isOutputType(type) {
|
|
157124
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
157165
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
157125
157166
|
}
|
|
157126
157167
|
function assertOutputType(type) {
|
|
157127
157168
|
if (!isOutputType(type)) {
|
|
@@ -157130,7 +157171,7 @@ var require_definition3 = __commonJS4({
|
|
|
157130
157171
|
return type;
|
|
157131
157172
|
}
|
|
157132
157173
|
function isLeafType(type) {
|
|
157133
|
-
return isScalarType7(type) ||
|
|
157174
|
+
return isScalarType7(type) || isEnumType7(type);
|
|
157134
157175
|
}
|
|
157135
157176
|
function assertLeafType(type) {
|
|
157136
157177
|
if (!isLeafType(type)) {
|
|
@@ -157218,7 +157259,7 @@ var require_definition3 = __commonJS4({
|
|
|
157218
157259
|
}
|
|
157219
157260
|
}
|
|
157220
157261
|
function isNamedType(type) {
|
|
157221
|
-
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) ||
|
|
157262
|
+
return isScalarType7(type) || isObjectType3(type) || isInterfaceType6(type) || isUnionType7(type) || isEnumType7(type) || isInputObjectType2(type);
|
|
157222
157263
|
}
|
|
157223
157264
|
function assertNamedType(type) {
|
|
157224
157265
|
if (!isNamedType(type)) {
|
|
@@ -210371,6 +210412,7 @@ function testConfigFile({ plugins, ...config22 } = {}) {
|
|
|
210371
210412
|
entitiesByCursor(first: Int, after: String, last: Int, before: String): EntityConnection!
|
|
210372
210413
|
node(id: ID!): Node
|
|
210373
210414
|
customIdList: [CustomIdType]!
|
|
210415
|
+
nodes(ids: [ID!]!): [Node!]!
|
|
210374
210416
|
}
|
|
210375
210417
|
|
|
210376
210418
|
type PageInfo {
|
|
@@ -218006,7 +218048,7 @@ var require_definition5 = __commonJS5({
|
|
|
218006
218048
|
exports.assertInterfaceType = assertInterfaceType;
|
|
218007
218049
|
exports.isUnionType = isUnionType13;
|
|
218008
218050
|
exports.assertUnionType = assertUnionType;
|
|
218009
|
-
exports.isEnumType =
|
|
218051
|
+
exports.isEnumType = isEnumType12;
|
|
218010
218052
|
exports.assertEnumType = assertEnumType;
|
|
218011
218053
|
exports.isInputObjectType = isInputObjectType8;
|
|
218012
218054
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -218077,7 +218119,7 @@ var require_definition5 = __commonJS5({
|
|
|
218077
218119
|
return Constructor;
|
|
218078
218120
|
}
|
|
218079
218121
|
function isType(type) {
|
|
218080
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218122
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
218081
218123
|
}
|
|
218082
218124
|
function assertType(type) {
|
|
218083
218125
|
if (!isType(type)) {
|
|
@@ -218121,11 +218163,11 @@ var require_definition5 = __commonJS5({
|
|
|
218121
218163
|
}
|
|
218122
218164
|
return type;
|
|
218123
218165
|
}
|
|
218124
|
-
function
|
|
218166
|
+
function isEnumType12(type) {
|
|
218125
218167
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
218126
218168
|
}
|
|
218127
218169
|
function assertEnumType(type) {
|
|
218128
|
-
if (!
|
|
218170
|
+
if (!isEnumType12(type)) {
|
|
218129
218171
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
218130
218172
|
}
|
|
218131
218173
|
return type;
|
|
@@ -218158,7 +218200,7 @@ var require_definition5 = __commonJS5({
|
|
|
218158
218200
|
return type;
|
|
218159
218201
|
}
|
|
218160
218202
|
function isInputType(type) {
|
|
218161
|
-
return isScalarType13(type) ||
|
|
218203
|
+
return isScalarType13(type) || isEnumType12(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
218162
218204
|
}
|
|
218163
218205
|
function assertInputType(type) {
|
|
218164
218206
|
if (!isInputType(type)) {
|
|
@@ -218167,7 +218209,7 @@ var require_definition5 = __commonJS5({
|
|
|
218167
218209
|
return type;
|
|
218168
218210
|
}
|
|
218169
218211
|
function isOutputType(type) {
|
|
218170
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218212
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
218171
218213
|
}
|
|
218172
218214
|
function assertOutputType(type) {
|
|
218173
218215
|
if (!isOutputType(type)) {
|
|
@@ -218176,7 +218218,7 @@ var require_definition5 = __commonJS5({
|
|
|
218176
218218
|
return type;
|
|
218177
218219
|
}
|
|
218178
218220
|
function isLeafType4(type) {
|
|
218179
|
-
return isScalarType13(type) ||
|
|
218221
|
+
return isScalarType13(type) || isEnumType12(type);
|
|
218180
218222
|
}
|
|
218181
218223
|
function assertLeafType(type) {
|
|
218182
218224
|
if (!isLeafType4(type)) {
|
|
@@ -218264,7 +218306,7 @@ var require_definition5 = __commonJS5({
|
|
|
218264
218306
|
}
|
|
218265
218307
|
}
|
|
218266
218308
|
function isNamedType4(type) {
|
|
218267
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218309
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type);
|
|
218268
218310
|
}
|
|
218269
218311
|
function assertNamedType(type) {
|
|
218270
218312
|
if (!isNamedType4(type)) {
|
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 {
|
|
@@ -217995,7 +218037,7 @@ var require_definition5 = __commonJS5({
|
|
|
217995
218037
|
exports.assertInterfaceType = assertInterfaceType;
|
|
217996
218038
|
exports.isUnionType = isUnionType13;
|
|
217997
218039
|
exports.assertUnionType = assertUnionType;
|
|
217998
|
-
exports.isEnumType =
|
|
218040
|
+
exports.isEnumType = isEnumType12;
|
|
217999
218041
|
exports.assertEnumType = assertEnumType;
|
|
218000
218042
|
exports.isInputObjectType = isInputObjectType8;
|
|
218001
218043
|
exports.assertInputObjectType = assertInputObjectType;
|
|
@@ -218066,7 +218108,7 @@ var require_definition5 = __commonJS5({
|
|
|
218066
218108
|
return Constructor;
|
|
218067
218109
|
}
|
|
218068
218110
|
function isType(type) {
|
|
218069
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218111
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type) || isListType8(type) || isNonNullType10(type);
|
|
218070
218112
|
}
|
|
218071
218113
|
function assertType(type) {
|
|
218072
218114
|
if (!isType(type)) {
|
|
@@ -218110,11 +218152,11 @@ var require_definition5 = __commonJS5({
|
|
|
218110
218152
|
}
|
|
218111
218153
|
return type;
|
|
218112
218154
|
}
|
|
218113
|
-
function
|
|
218155
|
+
function isEnumType12(type) {
|
|
218114
218156
|
return (0, _instanceOf.default)(type, GraphQLEnumType4);
|
|
218115
218157
|
}
|
|
218116
218158
|
function assertEnumType(type) {
|
|
218117
|
-
if (!
|
|
218159
|
+
if (!isEnumType12(type)) {
|
|
218118
218160
|
throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type."));
|
|
218119
218161
|
}
|
|
218120
218162
|
return type;
|
|
@@ -218147,7 +218189,7 @@ var require_definition5 = __commonJS5({
|
|
|
218147
218189
|
return type;
|
|
218148
218190
|
}
|
|
218149
218191
|
function isInputType(type) {
|
|
218150
|
-
return isScalarType13(type) ||
|
|
218192
|
+
return isScalarType13(type) || isEnumType12(type) || isInputObjectType8(type) || isWrappingType(type) && isInputType(type.ofType);
|
|
218151
218193
|
}
|
|
218152
218194
|
function assertInputType(type) {
|
|
218153
218195
|
if (!isInputType(type)) {
|
|
@@ -218156,7 +218198,7 @@ var require_definition5 = __commonJS5({
|
|
|
218156
218198
|
return type;
|
|
218157
218199
|
}
|
|
218158
218200
|
function isOutputType(type) {
|
|
218159
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218201
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isWrappingType(type) && isOutputType(type.ofType);
|
|
218160
218202
|
}
|
|
218161
218203
|
function assertOutputType(type) {
|
|
218162
218204
|
if (!isOutputType(type)) {
|
|
@@ -218165,7 +218207,7 @@ var require_definition5 = __commonJS5({
|
|
|
218165
218207
|
return type;
|
|
218166
218208
|
}
|
|
218167
218209
|
function isLeafType4(type) {
|
|
218168
|
-
return isScalarType13(type) ||
|
|
218210
|
+
return isScalarType13(type) || isEnumType12(type);
|
|
218169
218211
|
}
|
|
218170
218212
|
function assertLeafType(type) {
|
|
218171
218213
|
if (!isLeafType4(type)) {
|
|
@@ -218253,7 +218295,7 @@ var require_definition5 = __commonJS5({
|
|
|
218253
218295
|
}
|
|
218254
218296
|
}
|
|
218255
218297
|
function isNamedType4(type) {
|
|
218256
|
-
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) ||
|
|
218298
|
+
return isScalarType13(type) || isObjectType12(type) || isInterfaceType12(type) || isUnionType13(type) || isEnumType12(type) || isInputObjectType8(type);
|
|
218257
218299
|
}
|
|
218258
218300
|
function assertNamedType(type) {
|
|
218259
218301
|
if (!isNamedType4(type)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "houdini-svelte",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
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.1"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"build"
|