houdini 2.0.0-next.3 → 2.0.0-next.5
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 +54 -26
- package/build/cmd-esm/index.js +54 -26
- package/build/codegen/generators/typescript/addReferencedInputTypes.d.ts +1 -1
- package/build/codegen/generators/typescript/inlineType.d.ts +2 -1
- package/build/codegen-cjs/index.js +52 -24
- package/build/codegen-esm/index.js +52 -24
- package/build/lib/typescript.d.ts +3 -3
- package/build/lib-cjs/index.js +11 -6
- package/build/lib-esm/index.js +11 -6
- package/build/test-cjs/index.js +52 -24
- package/build/test-esm/index.js +52 -24
- package/build/vite-cjs/index.js +55 -35
- package/build/vite-esm/index.js +55 -35
- package/package.json +1 -1
|
@@ -65678,10 +65678,10 @@ var AST3 = recast2.types.builders;
|
|
|
65678
65678
|
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
65679
65679
|
type,
|
|
65680
65680
|
wrappers
|
|
65681
|
-
}, body) {
|
|
65681
|
+
}, body, input) {
|
|
65682
65682
|
let result;
|
|
65683
65683
|
if (graphql6.isScalarType(type)) {
|
|
65684
|
-
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
65684
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null, input);
|
|
65685
65685
|
} else if (graphql6.isEnumType(type)) {
|
|
65686
65686
|
result = enumReference(config, body, type.name);
|
|
65687
65687
|
} else {
|
|
@@ -65698,14 +65698,15 @@ function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
|
65698
65698
|
}
|
|
65699
65699
|
return result;
|
|
65700
65700
|
}
|
|
65701
|
-
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
65701
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body, input) {
|
|
65702
65702
|
const { type, wrappers } = unwrapType(config, definition.type);
|
|
65703
65703
|
return unwrappedTsTypeReference(
|
|
65704
65704
|
config,
|
|
65705
65705
|
filepath,
|
|
65706
65706
|
missingScalars,
|
|
65707
65707
|
{ type, wrappers },
|
|
65708
|
-
body
|
|
65708
|
+
body,
|
|
65709
|
+
input
|
|
65709
65710
|
);
|
|
65710
65711
|
}
|
|
65711
65712
|
function enumReference(config, body, name) {
|
|
@@ -65734,7 +65735,7 @@ function nullableField(inner, input = false) {
|
|
|
65734
65735
|
}
|
|
65735
65736
|
return AST3.tsUnionType(members);
|
|
65736
65737
|
}
|
|
65737
|
-
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
65738
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field, input) {
|
|
65738
65739
|
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
65739
65740
|
if (!field) {
|
|
65740
65741
|
return AST3.tsNeverKeyword();
|
|
@@ -65793,6 +65794,9 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
65793
65794
|
return AST3.tsBooleanKeyword();
|
|
65794
65795
|
}
|
|
65795
65796
|
case "ID": {
|
|
65797
|
+
if (input) {
|
|
65798
|
+
return AST3.tsUnionType([AST3.tsStringKeyword(), AST3.tsNumberKeyword()]);
|
|
65799
|
+
}
|
|
65796
65800
|
return AST3.tsStringKeyword();
|
|
65797
65801
|
}
|
|
65798
65802
|
default: {
|
|
@@ -65803,7 +65807,8 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
65803
65807
|
missingScalars,
|
|
65804
65808
|
target.ofType,
|
|
65805
65809
|
body,
|
|
65806
|
-
field
|
|
65810
|
+
field,
|
|
65811
|
+
input
|
|
65807
65812
|
);
|
|
65808
65813
|
}
|
|
65809
65814
|
if (config.scalars?.[target.name]) {
|
|
@@ -68900,7 +68905,7 @@ var recast11 = __toESM(require_main2(), 1);
|
|
|
68900
68905
|
var graphql19 = __toESM(require("graphql"), 1);
|
|
68901
68906
|
var recast7 = __toESM(require_main2(), 1);
|
|
68902
68907
|
var AST8 = recast7.types.builders;
|
|
68903
|
-
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
68908
|
+
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType, input) {
|
|
68904
68909
|
const { type } = unwrapType(config, rootType);
|
|
68905
68910
|
if (graphql19.isScalarType(type)) {
|
|
68906
68911
|
return;
|
|
@@ -68925,12 +68930,20 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
|
|
|
68925
68930
|
}
|
|
68926
68931
|
const members = [];
|
|
68927
68932
|
for (const field of Object.values(type.getFields())) {
|
|
68928
|
-
addReferencedInputTypes(
|
|
68933
|
+
addReferencedInputTypes(
|
|
68934
|
+
config,
|
|
68935
|
+
filepath,
|
|
68936
|
+
body,
|
|
68937
|
+
visitedTypes,
|
|
68938
|
+
missingScalars,
|
|
68939
|
+
field.type,
|
|
68940
|
+
input
|
|
68941
|
+
);
|
|
68929
68942
|
members.push(
|
|
68930
68943
|
AST8.tsPropertySignature(
|
|
68931
68944
|
AST8.identifier(field.name),
|
|
68932
68945
|
AST8.tsTypeAnnotation(
|
|
68933
|
-
tsTypeReference(config, filepath, missingScalars, field, body)
|
|
68946
|
+
tsTypeReference(config, filepath, missingScalars, field, body, input)
|
|
68934
68947
|
),
|
|
68935
68948
|
graphql19.isNullableType(field.type)
|
|
68936
68949
|
)
|
|
@@ -68973,7 +68986,8 @@ function inlineType({
|
|
|
68973
68986
|
includeFragments,
|
|
68974
68987
|
allOptional,
|
|
68975
68988
|
forceNonNull,
|
|
68976
|
-
field
|
|
68989
|
+
field,
|
|
68990
|
+
input
|
|
68977
68991
|
}) {
|
|
68978
68992
|
const { type, wrappers } = unwrapType(config, rootType);
|
|
68979
68993
|
let result;
|
|
@@ -68985,7 +68999,8 @@ function inlineType({
|
|
|
68985
68999
|
missingScalars,
|
|
68986
69000
|
type,
|
|
68987
69001
|
body,
|
|
68988
|
-
field
|
|
69002
|
+
field,
|
|
69003
|
+
input
|
|
68989
69004
|
);
|
|
68990
69005
|
} else if (graphql20.isEnumType(type)) {
|
|
68991
69006
|
ensureImports({
|
|
@@ -69093,7 +69108,8 @@ function inlineType({
|
|
|
69093
69108
|
field: {
|
|
69094
69109
|
field: attributeName,
|
|
69095
69110
|
parent: type.name
|
|
69096
|
-
}
|
|
69111
|
+
},
|
|
69112
|
+
input
|
|
69097
69113
|
});
|
|
69098
69114
|
const hasIncludeOrSkipDirective = selection.directives && selection.directives.filter(
|
|
69099
69115
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
@@ -69157,7 +69173,8 @@ function inlineType({
|
|
|
69157
69173
|
missingScalars,
|
|
69158
69174
|
includeFragments,
|
|
69159
69175
|
allOptional,
|
|
69160
|
-
field: null
|
|
69176
|
+
field: null,
|
|
69177
|
+
input: false
|
|
69161
69178
|
});
|
|
69162
69179
|
let objectType = fragmentType;
|
|
69163
69180
|
if (fragmentType.type === "TSUnionType") {
|
|
@@ -69622,7 +69639,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
69622
69639
|
body,
|
|
69623
69640
|
missingScalars,
|
|
69624
69641
|
includeFragments: true,
|
|
69625
|
-
field: null
|
|
69642
|
+
field: null,
|
|
69643
|
+
input: false
|
|
69626
69644
|
});
|
|
69627
69645
|
if (artifact.kind === "HoudiniQuery") {
|
|
69628
69646
|
resultType = withLoadingState({
|
|
@@ -69671,7 +69689,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
69671
69689
|
body,
|
|
69672
69690
|
visitedTypes,
|
|
69673
69691
|
missingScalars,
|
|
69674
|
-
variableDefinition.type
|
|
69692
|
+
variableDefinition.type,
|
|
69693
|
+
true
|
|
69675
69694
|
);
|
|
69676
69695
|
}
|
|
69677
69696
|
body.push(
|
|
@@ -69689,7 +69708,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
69689
69708
|
filepath,
|
|
69690
69709
|
missingScalars,
|
|
69691
69710
|
definition2,
|
|
69692
|
-
body
|
|
69711
|
+
body,
|
|
69712
|
+
true
|
|
69693
69713
|
)
|
|
69694
69714
|
),
|
|
69695
69715
|
definition2.type.kind !== "NonNullType"
|
|
@@ -69724,7 +69744,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
69724
69744
|
missingScalars,
|
|
69725
69745
|
includeFragments: false,
|
|
69726
69746
|
allOptional: true,
|
|
69727
|
-
field: null
|
|
69747
|
+
field: null,
|
|
69748
|
+
input: false
|
|
69728
69749
|
})
|
|
69729
69750
|
)
|
|
69730
69751
|
)
|
|
@@ -69757,7 +69778,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
69757
69778
|
filepath,
|
|
69758
69779
|
missingScalars,
|
|
69759
69780
|
definition2,
|
|
69760
|
-
body
|
|
69781
|
+
body,
|
|
69782
|
+
false
|
|
69761
69783
|
)
|
|
69762
69784
|
),
|
|
69763
69785
|
definition2.type.kind !== "NonNullType"
|
|
@@ -69820,7 +69842,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
69820
69842
|
visitedTypes,
|
|
69821
69843
|
missingScalars,
|
|
69822
69844
|
includeFragments: true,
|
|
69823
|
-
field: null
|
|
69845
|
+
field: null,
|
|
69846
|
+
input: false
|
|
69824
69847
|
})
|
|
69825
69848
|
})
|
|
69826
69849
|
)
|
|
@@ -69916,7 +69939,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
69916
69939
|
{
|
|
69917
69940
|
field: key,
|
|
69918
69941
|
parent: type.name
|
|
69919
|
-
}
|
|
69942
|
+
},
|
|
69943
|
+
false
|
|
69920
69944
|
)
|
|
69921
69945
|
)
|
|
69922
69946
|
);
|
|
@@ -69943,7 +69967,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
69943
69967
|
{
|
|
69944
69968
|
field: key,
|
|
69945
69969
|
parent: type.name
|
|
69946
|
-
}
|
|
69970
|
+
},
|
|
69971
|
+
false
|
|
69947
69972
|
)
|
|
69948
69973
|
);
|
|
69949
69974
|
} else if (graphql21.isEnumType(unwrapped.type)) {
|
|
@@ -69981,7 +70006,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
69981
70006
|
body,
|
|
69982
70007
|
visitedTypes,
|
|
69983
70008
|
/* @__PURE__ */ new Set(),
|
|
69984
|
-
arg.type
|
|
70009
|
+
arg.type,
|
|
70010
|
+
true
|
|
69985
70011
|
);
|
|
69986
70012
|
const prop = AST13.tsPropertySignature(
|
|
69987
70013
|
AST13.identifier(arg.name),
|
|
@@ -69991,7 +70017,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
69991
70017
|
filepath,
|
|
69992
70018
|
/* @__PURE__ */ new Set(),
|
|
69993
70019
|
arg,
|
|
69994
|
-
body
|
|
70020
|
+
body,
|
|
70021
|
+
graphql21.isInputType(arg.type)
|
|
69995
70022
|
)
|
|
69996
70023
|
)
|
|
69997
70024
|
);
|
|
@@ -70103,7 +70130,8 @@ function listDefinitions(config, filepath, body, docs) {
|
|
|
70103
70130
|
filepath,
|
|
70104
70131
|
/* @__PURE__ */ new Set(),
|
|
70105
70132
|
arg,
|
|
70106
|
-
body
|
|
70133
|
+
body,
|
|
70134
|
+
graphql21.isInputType(arg.type)
|
|
70107
70135
|
)
|
|
70108
70136
|
)
|
|
70109
70137
|
);
|
|
@@ -65677,10 +65677,10 @@ var AST3 = recast2.types.builders;
|
|
|
65677
65677
|
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
65678
65678
|
type,
|
|
65679
65679
|
wrappers
|
|
65680
|
-
}, body) {
|
|
65680
|
+
}, body, input) {
|
|
65681
65681
|
let result;
|
|
65682
65682
|
if (graphql6.isScalarType(type)) {
|
|
65683
|
-
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
65683
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null, input);
|
|
65684
65684
|
} else if (graphql6.isEnumType(type)) {
|
|
65685
65685
|
result = enumReference(config, body, type.name);
|
|
65686
65686
|
} else {
|
|
@@ -65697,14 +65697,15 @@ function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
|
65697
65697
|
}
|
|
65698
65698
|
return result;
|
|
65699
65699
|
}
|
|
65700
|
-
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
65700
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body, input) {
|
|
65701
65701
|
const { type, wrappers } = unwrapType(config, definition.type);
|
|
65702
65702
|
return unwrappedTsTypeReference(
|
|
65703
65703
|
config,
|
|
65704
65704
|
filepath,
|
|
65705
65705
|
missingScalars,
|
|
65706
65706
|
{ type, wrappers },
|
|
65707
|
-
body
|
|
65707
|
+
body,
|
|
65708
|
+
input
|
|
65708
65709
|
);
|
|
65709
65710
|
}
|
|
65710
65711
|
function enumReference(config, body, name) {
|
|
@@ -65733,7 +65734,7 @@ function nullableField(inner, input = false) {
|
|
|
65733
65734
|
}
|
|
65734
65735
|
return AST3.tsUnionType(members);
|
|
65735
65736
|
}
|
|
65736
|
-
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
65737
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field, input) {
|
|
65737
65738
|
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
65738
65739
|
if (!field) {
|
|
65739
65740
|
return AST3.tsNeverKeyword();
|
|
@@ -65792,6 +65793,9 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
65792
65793
|
return AST3.tsBooleanKeyword();
|
|
65793
65794
|
}
|
|
65794
65795
|
case "ID": {
|
|
65796
|
+
if (input) {
|
|
65797
|
+
return AST3.tsUnionType([AST3.tsStringKeyword(), AST3.tsNumberKeyword()]);
|
|
65798
|
+
}
|
|
65795
65799
|
return AST3.tsStringKeyword();
|
|
65796
65800
|
}
|
|
65797
65801
|
default: {
|
|
@@ -65802,7 +65806,8 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
65802
65806
|
missingScalars,
|
|
65803
65807
|
target.ofType,
|
|
65804
65808
|
body,
|
|
65805
|
-
field
|
|
65809
|
+
field,
|
|
65810
|
+
input
|
|
65806
65811
|
);
|
|
65807
65812
|
}
|
|
65808
65813
|
if (config.scalars?.[target.name]) {
|
|
@@ -68899,7 +68904,7 @@ var recast11 = __toESM(require_main2(), 1);
|
|
|
68899
68904
|
var recast7 = __toESM(require_main2(), 1);
|
|
68900
68905
|
import * as graphql19 from "graphql";
|
|
68901
68906
|
var AST8 = recast7.types.builders;
|
|
68902
|
-
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
68907
|
+
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType, input) {
|
|
68903
68908
|
const { type } = unwrapType(config, rootType);
|
|
68904
68909
|
if (graphql19.isScalarType(type)) {
|
|
68905
68910
|
return;
|
|
@@ -68924,12 +68929,20 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
|
|
|
68924
68929
|
}
|
|
68925
68930
|
const members = [];
|
|
68926
68931
|
for (const field of Object.values(type.getFields())) {
|
|
68927
|
-
addReferencedInputTypes(
|
|
68932
|
+
addReferencedInputTypes(
|
|
68933
|
+
config,
|
|
68934
|
+
filepath,
|
|
68935
|
+
body,
|
|
68936
|
+
visitedTypes,
|
|
68937
|
+
missingScalars,
|
|
68938
|
+
field.type,
|
|
68939
|
+
input
|
|
68940
|
+
);
|
|
68928
68941
|
members.push(
|
|
68929
68942
|
AST8.tsPropertySignature(
|
|
68930
68943
|
AST8.identifier(field.name),
|
|
68931
68944
|
AST8.tsTypeAnnotation(
|
|
68932
|
-
tsTypeReference(config, filepath, missingScalars, field, body)
|
|
68945
|
+
tsTypeReference(config, filepath, missingScalars, field, body, input)
|
|
68933
68946
|
),
|
|
68934
68947
|
graphql19.isNullableType(field.type)
|
|
68935
68948
|
)
|
|
@@ -68972,7 +68985,8 @@ function inlineType({
|
|
|
68972
68985
|
includeFragments,
|
|
68973
68986
|
allOptional,
|
|
68974
68987
|
forceNonNull,
|
|
68975
|
-
field
|
|
68988
|
+
field,
|
|
68989
|
+
input
|
|
68976
68990
|
}) {
|
|
68977
68991
|
const { type, wrappers } = unwrapType(config, rootType);
|
|
68978
68992
|
let result;
|
|
@@ -68984,7 +68998,8 @@ function inlineType({
|
|
|
68984
68998
|
missingScalars,
|
|
68985
68999
|
type,
|
|
68986
69000
|
body,
|
|
68987
|
-
field
|
|
69001
|
+
field,
|
|
69002
|
+
input
|
|
68988
69003
|
);
|
|
68989
69004
|
} else if (graphql20.isEnumType(type)) {
|
|
68990
69005
|
ensureImports({
|
|
@@ -69092,7 +69107,8 @@ function inlineType({
|
|
|
69092
69107
|
field: {
|
|
69093
69108
|
field: attributeName,
|
|
69094
69109
|
parent: type.name
|
|
69095
|
-
}
|
|
69110
|
+
},
|
|
69111
|
+
input
|
|
69096
69112
|
});
|
|
69097
69113
|
const hasIncludeOrSkipDirective = selection.directives && selection.directives.filter(
|
|
69098
69114
|
(directive) => directive.name.value === "include" || directive.name.value === "skip"
|
|
@@ -69156,7 +69172,8 @@ function inlineType({
|
|
|
69156
69172
|
missingScalars,
|
|
69157
69173
|
includeFragments,
|
|
69158
69174
|
allOptional,
|
|
69159
|
-
field: null
|
|
69175
|
+
field: null,
|
|
69176
|
+
input: false
|
|
69160
69177
|
});
|
|
69161
69178
|
let objectType = fragmentType;
|
|
69162
69179
|
if (fragmentType.type === "TSUnionType") {
|
|
@@ -69621,7 +69638,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
69621
69638
|
body,
|
|
69622
69639
|
missingScalars,
|
|
69623
69640
|
includeFragments: true,
|
|
69624
|
-
field: null
|
|
69641
|
+
field: null,
|
|
69642
|
+
input: false
|
|
69625
69643
|
});
|
|
69626
69644
|
if (artifact.kind === "HoudiniQuery") {
|
|
69627
69645
|
resultType = withLoadingState({
|
|
@@ -69670,7 +69688,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
69670
69688
|
body,
|
|
69671
69689
|
visitedTypes,
|
|
69672
69690
|
missingScalars,
|
|
69673
|
-
variableDefinition.type
|
|
69691
|
+
variableDefinition.type,
|
|
69692
|
+
true
|
|
69674
69693
|
);
|
|
69675
69694
|
}
|
|
69676
69695
|
body.push(
|
|
@@ -69688,7 +69707,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
69688
69707
|
filepath,
|
|
69689
69708
|
missingScalars,
|
|
69690
69709
|
definition2,
|
|
69691
|
-
body
|
|
69710
|
+
body,
|
|
69711
|
+
true
|
|
69692
69712
|
)
|
|
69693
69713
|
),
|
|
69694
69714
|
definition2.type.kind !== "NonNullType"
|
|
@@ -69723,7 +69743,8 @@ async function generateOperationTypeDefs(config, filepath, document, body, defin
|
|
|
69723
69743
|
missingScalars,
|
|
69724
69744
|
includeFragments: false,
|
|
69725
69745
|
allOptional: true,
|
|
69726
|
-
field: null
|
|
69746
|
+
field: null,
|
|
69747
|
+
input: false
|
|
69727
69748
|
})
|
|
69728
69749
|
)
|
|
69729
69750
|
)
|
|
@@ -69756,7 +69777,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
69756
69777
|
filepath,
|
|
69757
69778
|
missingScalars,
|
|
69758
69779
|
definition2,
|
|
69759
|
-
body
|
|
69780
|
+
body,
|
|
69781
|
+
false
|
|
69760
69782
|
)
|
|
69761
69783
|
),
|
|
69762
69784
|
definition2.type.kind !== "NonNullType"
|
|
@@ -69819,7 +69841,8 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
69819
69841
|
visitedTypes,
|
|
69820
69842
|
missingScalars,
|
|
69821
69843
|
includeFragments: true,
|
|
69822
|
-
field: null
|
|
69844
|
+
field: null,
|
|
69845
|
+
input: false
|
|
69823
69846
|
})
|
|
69824
69847
|
})
|
|
69825
69848
|
)
|
|
@@ -69915,7 +69938,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
69915
69938
|
{
|
|
69916
69939
|
field: key,
|
|
69917
69940
|
parent: type.name
|
|
69918
|
-
}
|
|
69941
|
+
},
|
|
69942
|
+
false
|
|
69919
69943
|
)
|
|
69920
69944
|
)
|
|
69921
69945
|
);
|
|
@@ -69942,7 +69966,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
69942
69966
|
{
|
|
69943
69967
|
field: key,
|
|
69944
69968
|
parent: type.name
|
|
69945
|
-
}
|
|
69969
|
+
},
|
|
69970
|
+
false
|
|
69946
69971
|
)
|
|
69947
69972
|
);
|
|
69948
69973
|
} else if (graphql21.isEnumType(unwrapped.type)) {
|
|
@@ -69980,7 +70005,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
69980
70005
|
body,
|
|
69981
70006
|
visitedTypes,
|
|
69982
70007
|
/* @__PURE__ */ new Set(),
|
|
69983
|
-
arg.type
|
|
70008
|
+
arg.type,
|
|
70009
|
+
true
|
|
69984
70010
|
);
|
|
69985
70011
|
const prop = AST13.tsPropertySignature(
|
|
69986
70012
|
AST13.identifier(arg.name),
|
|
@@ -69990,7 +70016,8 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
69990
70016
|
filepath,
|
|
69991
70017
|
/* @__PURE__ */ new Set(),
|
|
69992
70018
|
arg,
|
|
69993
|
-
body
|
|
70019
|
+
body,
|
|
70020
|
+
graphql21.isInputType(arg.type)
|
|
69994
70021
|
)
|
|
69995
70022
|
)
|
|
69996
70023
|
);
|
|
@@ -70102,7 +70129,8 @@ function listDefinitions(config, filepath, body, docs) {
|
|
|
70102
70129
|
filepath,
|
|
70103
70130
|
/* @__PURE__ */ new Set(),
|
|
70104
70131
|
arg,
|
|
70105
|
-
body
|
|
70132
|
+
body,
|
|
70133
|
+
graphql21.isInputType(arg.type)
|
|
70106
70134
|
)
|
|
70107
70135
|
)
|
|
70108
70136
|
);
|
|
@@ -6,15 +6,15 @@ import { TypeWrapper } from './graphql';
|
|
|
6
6
|
export declare function unwrappedTsTypeReference(config: Config, filepath: string, missingScalars: Set<string>, { type, wrappers, }: {
|
|
7
7
|
type: graphql.GraphQLNamedType;
|
|
8
8
|
wrappers: TypeWrapper[];
|
|
9
|
-
}, body: StatementKind[]): TSTypeKind;
|
|
9
|
+
}, body: StatementKind[], input: boolean): TSTypeKind;
|
|
10
10
|
export declare function tsTypeReference(config: Config, filepath: string, missingScalars: Set<string>, definition: {
|
|
11
11
|
type: graphql.GraphQLScalarType | graphql.GraphQLInputType | graphql.GraphQLNamedType | graphql.TypeNode;
|
|
12
|
-
}, body: StatementKind[]): TSTypeKind;
|
|
12
|
+
}, body: StatementKind[], input: boolean): TSTypeKind;
|
|
13
13
|
export declare function enumReference(config: Config, body: StatementKind[], name: string): recast.types.namedTypes.TSTypeReference;
|
|
14
14
|
export declare function readonlyProperty(prop: recast.types.namedTypes.TSPropertySignature, enable?: boolean): recast.types.namedTypes.TSPropertySignature;
|
|
15
15
|
export declare function nullableField(inner: TSTypeKind, input?: boolean): recast.types.namedTypes.TSUnionType;
|
|
16
16
|
export declare function scalarPropertyValue(config: Config, filepath: string, missingScalars: Set<string>, target: graphql.GraphQLNamedType, body: StatementKind[], field: {
|
|
17
17
|
parent: string;
|
|
18
18
|
field: string;
|
|
19
|
-
} | null): TSTypeKind;
|
|
19
|
+
} | null, input: boolean): TSTypeKind;
|
|
20
20
|
export declare function writeTsConfig(config: Config): Promise<void>;
|
package/build/lib-cjs/index.js
CHANGED
|
@@ -78913,10 +78913,10 @@ var AST3 = recast2.types.builders;
|
|
|
78913
78913
|
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
78914
78914
|
type,
|
|
78915
78915
|
wrappers
|
|
78916
|
-
}, body) {
|
|
78916
|
+
}, body, input) {
|
|
78917
78917
|
let result;
|
|
78918
78918
|
if (graphql6.isScalarType(type)) {
|
|
78919
|
-
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
78919
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null, input);
|
|
78920
78920
|
} else if (graphql6.isEnumType(type)) {
|
|
78921
78921
|
result = enumReference(config, body, type.name);
|
|
78922
78922
|
} else {
|
|
@@ -78933,14 +78933,15 @@ function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
|
78933
78933
|
}
|
|
78934
78934
|
return result;
|
|
78935
78935
|
}
|
|
78936
|
-
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
78936
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body, input) {
|
|
78937
78937
|
const { type, wrappers } = unwrapType(config, definition.type);
|
|
78938
78938
|
return unwrappedTsTypeReference(
|
|
78939
78939
|
config,
|
|
78940
78940
|
filepath,
|
|
78941
78941
|
missingScalars,
|
|
78942
78942
|
{ type, wrappers },
|
|
78943
|
-
body
|
|
78943
|
+
body,
|
|
78944
|
+
input
|
|
78944
78945
|
);
|
|
78945
78946
|
}
|
|
78946
78947
|
function enumReference(config, body, name) {
|
|
@@ -78969,7 +78970,7 @@ function nullableField(inner, input = false) {
|
|
|
78969
78970
|
}
|
|
78970
78971
|
return AST3.tsUnionType(members);
|
|
78971
78972
|
}
|
|
78972
|
-
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
78973
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field, input) {
|
|
78973
78974
|
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
78974
78975
|
if (!field) {
|
|
78975
78976
|
return AST3.tsNeverKeyword();
|
|
@@ -79028,6 +79029,9 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
79028
79029
|
return AST3.tsBooleanKeyword();
|
|
79029
79030
|
}
|
|
79030
79031
|
case "ID": {
|
|
79032
|
+
if (input) {
|
|
79033
|
+
return AST3.tsUnionType([AST3.tsStringKeyword(), AST3.tsNumberKeyword()]);
|
|
79034
|
+
}
|
|
79031
79035
|
return AST3.tsStringKeyword();
|
|
79032
79036
|
}
|
|
79033
79037
|
default: {
|
|
@@ -79038,7 +79042,8 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
79038
79042
|
missingScalars,
|
|
79039
79043
|
target.ofType,
|
|
79040
79044
|
body,
|
|
79041
|
-
field
|
|
79045
|
+
field,
|
|
79046
|
+
input
|
|
79042
79047
|
);
|
|
79043
79048
|
}
|
|
79044
79049
|
if (config.scalars?.[target.name]) {
|
package/build/lib-esm/index.js
CHANGED
|
@@ -78823,10 +78823,10 @@ var AST3 = recast2.types.builders;
|
|
|
78823
78823
|
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
78824
78824
|
type,
|
|
78825
78825
|
wrappers
|
|
78826
|
-
}, body) {
|
|
78826
|
+
}, body, input) {
|
|
78827
78827
|
let result;
|
|
78828
78828
|
if (graphql6.isScalarType(type)) {
|
|
78829
|
-
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
78829
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null, input);
|
|
78830
78830
|
} else if (graphql6.isEnumType(type)) {
|
|
78831
78831
|
result = enumReference(config, body, type.name);
|
|
78832
78832
|
} else {
|
|
@@ -78843,14 +78843,15 @@ function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
|
78843
78843
|
}
|
|
78844
78844
|
return result;
|
|
78845
78845
|
}
|
|
78846
|
-
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
78846
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body, input) {
|
|
78847
78847
|
const { type, wrappers } = unwrapType(config, definition.type);
|
|
78848
78848
|
return unwrappedTsTypeReference(
|
|
78849
78849
|
config,
|
|
78850
78850
|
filepath,
|
|
78851
78851
|
missingScalars,
|
|
78852
78852
|
{ type, wrappers },
|
|
78853
|
-
body
|
|
78853
|
+
body,
|
|
78854
|
+
input
|
|
78854
78855
|
);
|
|
78855
78856
|
}
|
|
78856
78857
|
function enumReference(config, body, name) {
|
|
@@ -78879,7 +78880,7 @@ function nullableField(inner, input = false) {
|
|
|
78879
78880
|
}
|
|
78880
78881
|
return AST3.tsUnionType(members);
|
|
78881
78882
|
}
|
|
78882
|
-
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
78883
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field, input) {
|
|
78883
78884
|
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
78884
78885
|
if (!field) {
|
|
78885
78886
|
return AST3.tsNeverKeyword();
|
|
@@ -78938,6 +78939,9 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
78938
78939
|
return AST3.tsBooleanKeyword();
|
|
78939
78940
|
}
|
|
78940
78941
|
case "ID": {
|
|
78942
|
+
if (input) {
|
|
78943
|
+
return AST3.tsUnionType([AST3.tsStringKeyword(), AST3.tsNumberKeyword()]);
|
|
78944
|
+
}
|
|
78941
78945
|
return AST3.tsStringKeyword();
|
|
78942
78946
|
}
|
|
78943
78947
|
default: {
|
|
@@ -78948,7 +78952,8 @@ function scalarPropertyValue(config, filepath, missingScalars, target, body, fie
|
|
|
78948
78952
|
missingScalars,
|
|
78949
78953
|
target.ofType,
|
|
78950
78954
|
body,
|
|
78951
|
-
field
|
|
78955
|
+
field,
|
|
78956
|
+
input
|
|
78952
78957
|
);
|
|
78953
78958
|
}
|
|
78954
78959
|
if (config.scalars?.[target.name]) {
|