houdini 1.2.44 → 1.2.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cmd-cjs/index.js +651 -844
- package/build/cmd-esm/index.js +501 -694
- package/build/codegen/generators/comments/jsdoc.d.ts +2 -0
- package/build/codegen-cjs/index.js +649 -842
- package/build/codegen-esm/index.js +499 -692
- package/build/lib/graphql.d.ts +1 -1
- package/build/lib/index.d.ts +1 -0
- package/build/lib/typescript.d.ts +19 -0
- package/build/lib-cjs/index.js +667 -464
- package/build/lib-esm/index.js +661 -464
- package/build/runtime/client/index.d.ts +7 -1
- package/build/runtime/client/plugins/fragment.d.ts +2 -2
- package/build/runtime/client/plugins/mutation.d.ts +2 -1
- package/build/runtime/client/plugins/query.d.ts +2 -2
- package/build/runtime/lib/scalars.d.ts +1 -1
- package/build/runtime/lib/types.d.ts +13 -2
- package/build/runtime/router/types.d.ts +3 -1
- package/build/runtime-cjs/client/index.d.ts +7 -1
- package/build/runtime-cjs/client/index.js +26 -11
- package/build/runtime-cjs/client/plugins/fragment.d.ts +2 -2
- package/build/runtime-cjs/client/plugins/fragment.js +4 -11
- package/build/runtime-cjs/client/plugins/mutation.d.ts +2 -1
- package/build/runtime-cjs/client/plugins/mutation.js +8 -15
- package/build/runtime-cjs/client/plugins/query.d.ts +2 -2
- package/build/runtime-cjs/client/plugins/query.js +4 -11
- package/build/runtime-cjs/lib/scalars.d.ts +1 -1
- package/build/runtime-cjs/lib/scalars.js +4 -0
- package/build/runtime-cjs/lib/types.d.ts +13 -2
- package/build/runtime-cjs/router/types.d.ts +3 -1
- package/build/runtime-esm/client/index.d.ts +7 -1
- package/build/runtime-esm/client/index.js +26 -11
- package/build/runtime-esm/client/plugins/fragment.d.ts +2 -2
- package/build/runtime-esm/client/plugins/fragment.js +1 -2
- package/build/runtime-esm/client/plugins/mutation.d.ts +2 -1
- package/build/runtime-esm/client/plugins/mutation.js +1 -2
- package/build/runtime-esm/client/plugins/query.d.ts +2 -2
- package/build/runtime-esm/client/plugins/query.js +1 -2
- package/build/runtime-esm/lib/scalars.d.ts +1 -1
- package/build/runtime-esm/lib/scalars.js +6 -0
- package/build/runtime-esm/lib/types.d.ts +13 -2
- package/build/runtime-esm/router/types.d.ts +3 -1
- package/build/test-cjs/index.js +664 -840
- package/build/test-esm/index.js +514 -690
- package/build/vite-cjs/index.js +761 -852
- package/build/vite-esm/index.js +611 -702
- package/package.json +1 -1
- package/build/codegen/generators/typescript/typeReference.d.ts +0 -8
- package/build/codegen/generators/typescript/types.d.ts +0 -10
package/build/test-cjs/index.js
CHANGED
|
@@ -53827,11 +53827,11 @@ __export(test_exports, {
|
|
|
53827
53827
|
testConfigFile: () => testConfigFile
|
|
53828
53828
|
});
|
|
53829
53829
|
module.exports = __toCommonJS(test_exports);
|
|
53830
|
-
var
|
|
53830
|
+
var graphql33 = __toESM(require("graphql"), 1);
|
|
53831
53831
|
var import_memfs2 = __toESM(require_lib(), 1);
|
|
53832
53832
|
|
|
53833
53833
|
// src/codegen/index.ts
|
|
53834
|
-
var
|
|
53834
|
+
var graphql32 = __toESM(require("graphql"), 1);
|
|
53835
53835
|
|
|
53836
53836
|
// src/lib/pipeline.ts
|
|
53837
53837
|
async function runPipeline(config, pipeline, target) {
|
|
@@ -53975,47 +53975,6 @@ function deepMerge(...objects) {
|
|
|
53975
53975
|
return mergedObj;
|
|
53976
53976
|
}
|
|
53977
53977
|
|
|
53978
|
-
// src/runtime/lib/scalars.ts
|
|
53979
|
-
async function marshalSelection({
|
|
53980
|
-
selection,
|
|
53981
|
-
data
|
|
53982
|
-
}) {
|
|
53983
|
-
const config = getCurrentConfig();
|
|
53984
|
-
if (data === null || typeof data === "undefined") {
|
|
53985
|
-
return data;
|
|
53986
|
-
}
|
|
53987
|
-
if (Array.isArray(data)) {
|
|
53988
|
-
return await Promise.all(data.map((val) => marshalSelection({ selection, data: val })));
|
|
53989
|
-
}
|
|
53990
|
-
const targetSelection = getFieldsForType(selection, data["__typename"], false);
|
|
53991
|
-
return Object.fromEntries(
|
|
53992
|
-
await Promise.all(
|
|
53993
|
-
Object.entries(data).map(async ([fieldName, value]) => {
|
|
53994
|
-
const { type, selection: selection2 } = targetSelection[fieldName];
|
|
53995
|
-
if (!type) {
|
|
53996
|
-
return [fieldName, value];
|
|
53997
|
-
}
|
|
53998
|
-
if (selection2) {
|
|
53999
|
-
return [fieldName, await marshalSelection({ selection: selection2, data: value })];
|
|
54000
|
-
}
|
|
54001
|
-
if (config.scalars?.[type]) {
|
|
54002
|
-
const marshalFn = config.scalars[type].marshal;
|
|
54003
|
-
if (!marshalFn) {
|
|
54004
|
-
throw new Error(
|
|
54005
|
-
`scalar type ${type} is missing a \`marshal\` function. see https://github.com/AlecAivazis/houdini#%EF%B8%8Fcustom-scalars`
|
|
54006
|
-
);
|
|
54007
|
-
}
|
|
54008
|
-
if (Array.isArray(value)) {
|
|
54009
|
-
return [fieldName, value.map(marshalFn)];
|
|
54010
|
-
}
|
|
54011
|
-
return [fieldName, marshalFn(value)];
|
|
54012
|
-
}
|
|
54013
|
-
return [fieldName, value];
|
|
54014
|
-
})
|
|
54015
|
-
)
|
|
54016
|
-
);
|
|
54017
|
-
}
|
|
54018
|
-
|
|
54019
53978
|
// src/runtime/lib/types.ts
|
|
54020
53979
|
var CachePolicy = {
|
|
54021
53980
|
CacheOrNetwork: "CacheOrNetwork",
|
|
@@ -54043,11 +54002,6 @@ var RefetchUpdateMode = {
|
|
|
54043
54002
|
prepend: "prepend",
|
|
54044
54003
|
replace: "replace"
|
|
54045
54004
|
};
|
|
54046
|
-
var DataSource = {
|
|
54047
|
-
Cache: "cache",
|
|
54048
|
-
Network: "network",
|
|
54049
|
-
Ssr: "ssr"
|
|
54050
|
-
};
|
|
54051
54005
|
var fragmentKey = " $fragments";
|
|
54052
54006
|
var PendingValue = Symbol("houdini_loading");
|
|
54053
54007
|
|
|
@@ -56669,202 +56623,6 @@ var cache_default = new Cache();
|
|
|
56669
56623
|
// src/runtime/client/plugins/cache.ts
|
|
56670
56624
|
var serverSide = typeof globalThis.window === "undefined";
|
|
56671
56625
|
|
|
56672
|
-
// src/runtime/client/utils/documentPlugins.ts
|
|
56673
|
-
var documentPlugin = (kind, source) => {
|
|
56674
|
-
return () => {
|
|
56675
|
-
const sourceHandlers = source();
|
|
56676
|
-
const enterWrapper = (handler) => {
|
|
56677
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
56678
|
-
if (ctx.artifact.kind !== kind) {
|
|
56679
|
-
return handlers.next(ctx);
|
|
56680
|
-
}
|
|
56681
|
-
return handler(ctx, handlers);
|
|
56682
|
-
};
|
|
56683
|
-
};
|
|
56684
|
-
const exitWrapper = (handler) => {
|
|
56685
|
-
return !handler ? void 0 : (ctx, handlers) => {
|
|
56686
|
-
if (ctx.artifact.kind !== kind) {
|
|
56687
|
-
return handlers.resolve(ctx);
|
|
56688
|
-
}
|
|
56689
|
-
return handler(ctx, handlers);
|
|
56690
|
-
};
|
|
56691
|
-
};
|
|
56692
|
-
return {
|
|
56693
|
-
start: enterWrapper(sourceHandlers.start),
|
|
56694
|
-
network: enterWrapper(sourceHandlers.network),
|
|
56695
|
-
afterNetwork: exitWrapper(sourceHandlers.afterNetwork),
|
|
56696
|
-
end: exitWrapper(sourceHandlers.end),
|
|
56697
|
-
catch: sourceHandlers.catch ? (ctx, handlers) => sourceHandlers.catch(ctx, handlers) : void 0,
|
|
56698
|
-
cleanup: (...args) => sourceHandlers.cleanup?.(...args)
|
|
56699
|
-
};
|
|
56700
|
-
};
|
|
56701
|
-
};
|
|
56702
|
-
|
|
56703
|
-
// src/runtime/client/plugins/query.ts
|
|
56704
|
-
var query = documentPlugin(ArtifactKind.Query, function() {
|
|
56705
|
-
let subscriptionSpec = null;
|
|
56706
|
-
let lastVariables = null;
|
|
56707
|
-
return {
|
|
56708
|
-
start(ctx, { next }) {
|
|
56709
|
-
const runtimeScalarPayload = {
|
|
56710
|
-
session: ctx.session
|
|
56711
|
-
};
|
|
56712
|
-
ctx.variables = {
|
|
56713
|
-
...lastVariables,
|
|
56714
|
-
...Object.fromEntries(
|
|
56715
|
-
Object.entries(ctx.artifact.input?.runtimeScalars ?? {}).map(
|
|
56716
|
-
([field, type]) => {
|
|
56717
|
-
const runtimeScalar = ctx.config.features?.runtimeScalars?.[type];
|
|
56718
|
-
if (!runtimeScalar) {
|
|
56719
|
-
return [field, type];
|
|
56720
|
-
}
|
|
56721
|
-
return [field, runtimeScalar.resolve(runtimeScalarPayload)];
|
|
56722
|
-
}
|
|
56723
|
-
)
|
|
56724
|
-
),
|
|
56725
|
-
...ctx.variables
|
|
56726
|
-
};
|
|
56727
|
-
next(ctx);
|
|
56728
|
-
},
|
|
56729
|
-
end(ctx, { resolve: resolve2, marshalVariables, variablesChanged }) {
|
|
56730
|
-
if (variablesChanged(ctx) && !ctx.cacheParams?.disableSubscriptions) {
|
|
56731
|
-
if (subscriptionSpec) {
|
|
56732
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
56733
|
-
}
|
|
56734
|
-
lastVariables = { ...marshalVariables(ctx) };
|
|
56735
|
-
const variables = lastVariables;
|
|
56736
|
-
subscriptionSpec = {
|
|
56737
|
-
rootType: ctx.artifact.rootType,
|
|
56738
|
-
selection: ctx.artifact.selection,
|
|
56739
|
-
variables: () => variables,
|
|
56740
|
-
set: (newValue) => {
|
|
56741
|
-
resolve2(ctx, {
|
|
56742
|
-
data: newValue,
|
|
56743
|
-
errors: null,
|
|
56744
|
-
fetching: false,
|
|
56745
|
-
partial: false,
|
|
56746
|
-
stale: false,
|
|
56747
|
-
source: DataSource.Cache,
|
|
56748
|
-
variables: ctx.variables ?? {}
|
|
56749
|
-
});
|
|
56750
|
-
}
|
|
56751
|
-
};
|
|
56752
|
-
cache_default.subscribe(subscriptionSpec, lastVariables);
|
|
56753
|
-
}
|
|
56754
|
-
resolve2(ctx);
|
|
56755
|
-
},
|
|
56756
|
-
cleanup() {
|
|
56757
|
-
if (subscriptionSpec) {
|
|
56758
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
56759
|
-
lastVariables = null;
|
|
56760
|
-
}
|
|
56761
|
-
}
|
|
56762
|
-
};
|
|
56763
|
-
});
|
|
56764
|
-
|
|
56765
|
-
// src/runtime/client/plugins/fragment.ts
|
|
56766
|
-
var fragment = documentPlugin(ArtifactKind.Fragment, function() {
|
|
56767
|
-
let subscriptionSpec = null;
|
|
56768
|
-
let lastReference = null;
|
|
56769
|
-
return {
|
|
56770
|
-
start(ctx, { next, resolve: resolve2, variablesChanged, marshalVariables }) {
|
|
56771
|
-
if (!ctx.stuff.parentID) {
|
|
56772
|
-
return next(ctx);
|
|
56773
|
-
}
|
|
56774
|
-
const currentReference = {
|
|
56775
|
-
parent: ctx.stuff.parentID,
|
|
56776
|
-
variables: marshalVariables(ctx)
|
|
56777
|
-
};
|
|
56778
|
-
if (!ctx.cacheParams?.disableSubscriptions && (!deepEquals(lastReference, currentReference) || variablesChanged(ctx))) {
|
|
56779
|
-
if (subscriptionSpec) {
|
|
56780
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.() || {});
|
|
56781
|
-
}
|
|
56782
|
-
const variables = marshalVariables(ctx);
|
|
56783
|
-
subscriptionSpec = {
|
|
56784
|
-
rootType: ctx.artifact.rootType,
|
|
56785
|
-
selection: ctx.artifact.selection,
|
|
56786
|
-
variables: () => variables,
|
|
56787
|
-
parentID: ctx.stuff.parentID,
|
|
56788
|
-
set: (newValue) => {
|
|
56789
|
-
resolve2(ctx, {
|
|
56790
|
-
data: newValue,
|
|
56791
|
-
errors: null,
|
|
56792
|
-
fetching: false,
|
|
56793
|
-
partial: false,
|
|
56794
|
-
stale: false,
|
|
56795
|
-
source: DataSource.Cache,
|
|
56796
|
-
variables
|
|
56797
|
-
});
|
|
56798
|
-
}
|
|
56799
|
-
};
|
|
56800
|
-
cache_default.subscribe(subscriptionSpec, variables);
|
|
56801
|
-
lastReference = currentReference;
|
|
56802
|
-
}
|
|
56803
|
-
next(ctx);
|
|
56804
|
-
},
|
|
56805
|
-
cleanup() {
|
|
56806
|
-
if (subscriptionSpec) {
|
|
56807
|
-
cache_default.unsubscribe(subscriptionSpec, subscriptionSpec.variables?.());
|
|
56808
|
-
}
|
|
56809
|
-
}
|
|
56810
|
-
};
|
|
56811
|
-
});
|
|
56812
|
-
|
|
56813
|
-
// src/runtime/client/plugins/mutation.ts
|
|
56814
|
-
var mutation = documentPlugin(ArtifactKind.Mutation, () => {
|
|
56815
|
-
return {
|
|
56816
|
-
async start(ctx, { next, marshalVariables }) {
|
|
56817
|
-
const layerOptimistic = cache_default._internal_unstable.storage.createLayer(true);
|
|
56818
|
-
const optimisticResponse = ctx.stuff.optimisticResponse;
|
|
56819
|
-
let toNotify = [];
|
|
56820
|
-
if (optimisticResponse) {
|
|
56821
|
-
toNotify = cache_default.write({
|
|
56822
|
-
selection: ctx.artifact.selection,
|
|
56823
|
-
data: await marshalSelection({
|
|
56824
|
-
selection: ctx.artifact.selection,
|
|
56825
|
-
data: optimisticResponse
|
|
56826
|
-
}),
|
|
56827
|
-
variables: marshalVariables(ctx),
|
|
56828
|
-
layer: layerOptimistic.id
|
|
56829
|
-
});
|
|
56830
|
-
}
|
|
56831
|
-
ctx.cacheParams = {
|
|
56832
|
-
...ctx.cacheParams,
|
|
56833
|
-
layer: layerOptimistic,
|
|
56834
|
-
notifySubscribers: toNotify,
|
|
56835
|
-
forceNotify: true
|
|
56836
|
-
};
|
|
56837
|
-
next(ctx);
|
|
56838
|
-
},
|
|
56839
|
-
afterNetwork(ctx, { resolve: resolve2 }) {
|
|
56840
|
-
if (ctx.cacheParams?.layer) {
|
|
56841
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
56842
|
-
}
|
|
56843
|
-
resolve2(ctx);
|
|
56844
|
-
},
|
|
56845
|
-
end(ctx, { resolve: resolve2, value }) {
|
|
56846
|
-
const hasErrors = value.errors && value.errors.length > 0;
|
|
56847
|
-
if (hasErrors) {
|
|
56848
|
-
if (ctx.cacheParams?.layer) {
|
|
56849
|
-
cache_default.clearLayer(ctx.cacheParams.layer.id);
|
|
56850
|
-
}
|
|
56851
|
-
}
|
|
56852
|
-
if (ctx.cacheParams?.layer) {
|
|
56853
|
-
cache_default._internal_unstable.storage.resolveLayer(ctx.cacheParams.layer.id);
|
|
56854
|
-
}
|
|
56855
|
-
resolve2(ctx);
|
|
56856
|
-
},
|
|
56857
|
-
catch(ctx, { error }) {
|
|
56858
|
-
if (ctx.cacheParams?.layer) {
|
|
56859
|
-
const { layer } = ctx.cacheParams;
|
|
56860
|
-
cache_default.clearLayer(layer.id);
|
|
56861
|
-
cache_default._internal_unstable.storage.resolveLayer(layer.id);
|
|
56862
|
-
}
|
|
56863
|
-
throw error;
|
|
56864
|
-
}
|
|
56865
|
-
};
|
|
56866
|
-
});
|
|
56867
|
-
|
|
56868
56626
|
// src/lib/types.ts
|
|
56869
56627
|
var LogLevel = {
|
|
56870
56628
|
Full: "full",
|
|
@@ -57640,7 +57398,7 @@ function definitionFromAncestors(ancestors) {
|
|
|
57640
57398
|
}
|
|
57641
57399
|
return { parents, definition };
|
|
57642
57400
|
}
|
|
57643
|
-
function unwrapType(config, type, wrappers = []) {
|
|
57401
|
+
function unwrapType(config, type, wrappers = [], convertRuntimeScalars) {
|
|
57644
57402
|
if (type.kind === "NonNullType") {
|
|
57645
57403
|
return unwrapType(config, type.type, [TypeWrapper.NonNull, ...wrappers]);
|
|
57646
57404
|
}
|
|
@@ -57656,6 +57414,11 @@ function unwrapType(config, type, wrappers = []) {
|
|
|
57656
57414
|
if (type instanceof graphql3.GraphQLList) {
|
|
57657
57415
|
return unwrapType(config, type.ofType, [TypeWrapper.List, ...wrappers]);
|
|
57658
57416
|
}
|
|
57417
|
+
if (convertRuntimeScalars && config.configFile.features?.runtimeScalars?.[type.name.value]) {
|
|
57418
|
+
type = config.schema.getType(
|
|
57419
|
+
config.configFile.features?.runtimeScalars?.[type.name.value].type
|
|
57420
|
+
);
|
|
57421
|
+
}
|
|
57659
57422
|
const namedType = config.schema.getType(type.name.value || type.name);
|
|
57660
57423
|
if (!namedType) {
|
|
57661
57424
|
throw new Error("Unknown type: " + type.name.value || type.name);
|
|
@@ -57795,16 +57558,162 @@ async function cleanupFiles(pathFolder, listOfObj) {
|
|
|
57795
57558
|
return allFilesNotInList;
|
|
57796
57559
|
}
|
|
57797
57560
|
|
|
57798
|
-
// src/lib/
|
|
57561
|
+
// src/lib/typescript.ts
|
|
57799
57562
|
var graphql4 = __toESM(require("graphql"), 1);
|
|
57563
|
+
var recast2 = __toESM(require_main2(), 1);
|
|
57564
|
+
var AST2 = recast2.types.builders;
|
|
57565
|
+
function unwrappedTsTypeReference(config, filepath, missingScalars, {
|
|
57566
|
+
type,
|
|
57567
|
+
wrappers
|
|
57568
|
+
}, body) {
|
|
57569
|
+
let result;
|
|
57570
|
+
if (graphql4.isScalarType(type)) {
|
|
57571
|
+
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
57572
|
+
} else if (graphql4.isEnumType(type)) {
|
|
57573
|
+
result = enumReference(config, body, type.name);
|
|
57574
|
+
} else {
|
|
57575
|
+
result = AST2.tsTypeReference(AST2.identifier(type.name));
|
|
57576
|
+
}
|
|
57577
|
+
for (const toWrap of wrappers) {
|
|
57578
|
+
if (toWrap === "NonNull" /* NonNull */) {
|
|
57579
|
+
continue;
|
|
57580
|
+
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
57581
|
+
result = nullableField(result, true);
|
|
57582
|
+
} else if (toWrap === "List" /* List */) {
|
|
57583
|
+
result = AST2.tsArrayType(AST2.tsParenthesizedType(result));
|
|
57584
|
+
}
|
|
57585
|
+
}
|
|
57586
|
+
return result;
|
|
57587
|
+
}
|
|
57588
|
+
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
57589
|
+
const { type, wrappers } = unwrapType(config, definition.type);
|
|
57590
|
+
return unwrappedTsTypeReference(
|
|
57591
|
+
config,
|
|
57592
|
+
filepath,
|
|
57593
|
+
missingScalars,
|
|
57594
|
+
{ type, wrappers },
|
|
57595
|
+
body
|
|
57596
|
+
);
|
|
57597
|
+
}
|
|
57598
|
+
function enumReference(config, body, name) {
|
|
57599
|
+
ensureImports({
|
|
57600
|
+
config,
|
|
57601
|
+
body,
|
|
57602
|
+
import: ["ValueOf"],
|
|
57603
|
+
importKind: "type",
|
|
57604
|
+
sourceModule: "$houdini/runtime/lib/types"
|
|
57605
|
+
});
|
|
57606
|
+
return AST2.tsTypeReference(
|
|
57607
|
+
AST2.identifier("ValueOf"),
|
|
57608
|
+
AST2.tsTypeParameterInstantiation([AST2.tsTypeQuery(AST2.identifier(name))])
|
|
57609
|
+
);
|
|
57610
|
+
}
|
|
57611
|
+
function readonlyProperty(prop, enable = true) {
|
|
57612
|
+
if (enable) {
|
|
57613
|
+
prop.readonly = true;
|
|
57614
|
+
}
|
|
57615
|
+
return prop;
|
|
57616
|
+
}
|
|
57617
|
+
function nullableField(inner, input = false) {
|
|
57618
|
+
const members = [inner, AST2.tsNullKeyword()];
|
|
57619
|
+
if (input) {
|
|
57620
|
+
members.push(AST2.tsUndefinedKeyword());
|
|
57621
|
+
}
|
|
57622
|
+
return AST2.tsUnionType(members);
|
|
57623
|
+
}
|
|
57624
|
+
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
57625
|
+
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
57626
|
+
if (!field) {
|
|
57627
|
+
return AST2.tsNeverKeyword();
|
|
57628
|
+
}
|
|
57629
|
+
const component = config.componentFields[field.parent][field.field];
|
|
57630
|
+
const sourcePathRelative = path_exports.relative(
|
|
57631
|
+
path_exports.join(config.projectRoot, "src"),
|
|
57632
|
+
component.filepath
|
|
57633
|
+
);
|
|
57634
|
+
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
57635
|
+
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
57636
|
+
const localImport = ensureImports({
|
|
57637
|
+
config,
|
|
57638
|
+
body,
|
|
57639
|
+
import: "__component__" + component.fragment,
|
|
57640
|
+
sourceModule: path_exports.join(
|
|
57641
|
+
path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
|
|
57642
|
+
"src",
|
|
57643
|
+
sourcePath
|
|
57644
|
+
)
|
|
57645
|
+
}) ?? "__component__" + component.fragment;
|
|
57646
|
+
const parameters = AST2.tsTypeReference(AST2.identifier("Parameters"));
|
|
57647
|
+
parameters.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
57648
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
57649
|
+
]);
|
|
57650
|
+
const indexed = AST2.tsIndexedAccessType(
|
|
57651
|
+
parameters,
|
|
57652
|
+
AST2.tsLiteralType(AST2.numericLiteral(0))
|
|
57653
|
+
);
|
|
57654
|
+
const omit = AST2.tsTypeReference(AST2.identifier("Omit"));
|
|
57655
|
+
omit.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
57656
|
+
indexed,
|
|
57657
|
+
AST2.tsLiteralType(AST2.stringLiteral(component.prop))
|
|
57658
|
+
]);
|
|
57659
|
+
const arg = AST2.identifier("props");
|
|
57660
|
+
arg.typeAnnotation = AST2.tsTypeAnnotation(omit);
|
|
57661
|
+
const returnType = AST2.tsTypeReference(AST2.identifier("ReturnType"));
|
|
57662
|
+
returnType.typeParameters = AST2.tsTypeParameterInstantiation([
|
|
57663
|
+
AST2.tsTypeQuery(AST2.identifier(localImport))
|
|
57664
|
+
]);
|
|
57665
|
+
const fnType = AST2.tsFunctionType([arg]);
|
|
57666
|
+
fnType.typeAnnotation = AST2.tsTypeAnnotation(returnType);
|
|
57667
|
+
return fnType;
|
|
57668
|
+
}
|
|
57669
|
+
switch (target.name) {
|
|
57670
|
+
case "String": {
|
|
57671
|
+
return AST2.tsStringKeyword();
|
|
57672
|
+
}
|
|
57673
|
+
case "Int": {
|
|
57674
|
+
return AST2.tsNumberKeyword();
|
|
57675
|
+
}
|
|
57676
|
+
case "Float": {
|
|
57677
|
+
return AST2.tsNumberKeyword();
|
|
57678
|
+
}
|
|
57679
|
+
case "Boolean": {
|
|
57680
|
+
return AST2.tsBooleanKeyword();
|
|
57681
|
+
}
|
|
57682
|
+
case "ID": {
|
|
57683
|
+
return AST2.tsStringKeyword();
|
|
57684
|
+
}
|
|
57685
|
+
default: {
|
|
57686
|
+
if (graphql4.isNonNullType(target) && "ofType" in target) {
|
|
57687
|
+
return scalarPropertyValue(
|
|
57688
|
+
config,
|
|
57689
|
+
filepath,
|
|
57690
|
+
missingScalars,
|
|
57691
|
+
target.ofType,
|
|
57692
|
+
body,
|
|
57693
|
+
field
|
|
57694
|
+
);
|
|
57695
|
+
}
|
|
57696
|
+
if (config.scalars?.[target.name]) {
|
|
57697
|
+
return AST2.tsTypeReference(AST2.identifier(config.scalars?.[target.name].type));
|
|
57698
|
+
}
|
|
57699
|
+
if (target.name !== config.componentScalar) {
|
|
57700
|
+
missingScalars.add(target.name);
|
|
57701
|
+
}
|
|
57702
|
+
return AST2.tsAnyKeyword();
|
|
57703
|
+
}
|
|
57704
|
+
}
|
|
57705
|
+
}
|
|
57706
|
+
|
|
57707
|
+
// src/lib/walk.ts
|
|
57708
|
+
var graphql5 = __toESM(require("graphql"), 1);
|
|
57800
57709
|
|
|
57801
57710
|
// src/lib/router/manifest.ts
|
|
57802
57711
|
var t = __toESM(require_lib6(), 1);
|
|
57803
|
-
var
|
|
57712
|
+
var graphql6 = __toESM(require("graphql"), 1);
|
|
57804
57713
|
|
|
57805
57714
|
// src/codegen/generators/artifacts/index.ts
|
|
57806
|
-
var
|
|
57807
|
-
var
|
|
57715
|
+
var graphql17 = __toESM(require("graphql"), 1);
|
|
57716
|
+
var recast5 = __toESM(require_main2(), 1);
|
|
57808
57717
|
|
|
57809
57718
|
// src/codegen/utils/commonjs.ts
|
|
57810
57719
|
var cjsIndexFilePreamble = `"use strict";
|
|
@@ -58046,19 +57955,19 @@ var FieldCollection = class {
|
|
|
58046
57955
|
};
|
|
58047
57956
|
|
|
58048
57957
|
// src/codegen/utils/moduleExport.ts
|
|
58049
|
-
var
|
|
58050
|
-
var
|
|
57958
|
+
var recast3 = __toESM(require_main2(), 1);
|
|
57959
|
+
var AST3 = recast3.types.builders;
|
|
58051
57960
|
function moduleExport(config, key, value) {
|
|
58052
57961
|
if (config.module === "commonjs") {
|
|
58053
|
-
let target =
|
|
57962
|
+
let target = AST3.memberExpression(AST3.identifier("module"), AST3.identifier("exports"));
|
|
58054
57963
|
if (key !== "default") {
|
|
58055
|
-
target =
|
|
57964
|
+
target = AST3.memberExpression(target, AST3.identifier(key));
|
|
58056
57965
|
}
|
|
58057
|
-
return
|
|
57966
|
+
return AST3.expressionStatement(AST3.assignmentExpression("=", target, value));
|
|
58058
57967
|
}
|
|
58059
|
-
return key === "default" ?
|
|
58060
|
-
|
|
58061
|
-
|
|
57968
|
+
return key === "default" ? AST3.exportDefaultDeclaration(value) : AST3.exportNamedDeclaration(
|
|
57969
|
+
AST3.variableDeclaration("const", [
|
|
57970
|
+
AST3.variableDeclarator(AST3.identifier(key), value)
|
|
58062
57971
|
])
|
|
58063
57972
|
);
|
|
58064
57973
|
}
|
|
@@ -58315,7 +58224,7 @@ var serialize = (value, { json, lossy } = {}) => {
|
|
|
58315
58224
|
var esm_default = typeof structuredClone === "function" ? (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any) : (any, options) => deserialize(serialize(any, options));
|
|
58316
58225
|
|
|
58317
58226
|
// src/codegen/transforms/fragmentVariables.ts
|
|
58318
|
-
var
|
|
58227
|
+
var graphql8 = __toESM(require("graphql"), 1);
|
|
58319
58228
|
|
|
58320
58229
|
// src/codegen/utils/stripLoc.ts
|
|
58321
58230
|
function stripLoc(value) {
|
|
@@ -58336,13 +58245,13 @@ function stripLoc(value) {
|
|
|
58336
58245
|
}
|
|
58337
58246
|
|
|
58338
58247
|
// src/codegen/transforms/collectDefinitions.ts
|
|
58339
|
-
var
|
|
58340
|
-
var
|
|
58248
|
+
var graphql7 = __toESM(require("graphql"), 1);
|
|
58249
|
+
var import_graphql2 = require("graphql");
|
|
58341
58250
|
async function includeFragmentDefinitions(config, documents) {
|
|
58342
58251
|
const fragments = collectDefinitions(config, documents);
|
|
58343
58252
|
for (const [index, { name, document, filename }] of documents.entries()) {
|
|
58344
58253
|
const operation = document.definitions.find(
|
|
58345
|
-
(def) => def.kind ===
|
|
58254
|
+
(def) => def.kind === import_graphql2.Kind.OPERATION_DEFINITION || def.kind === "FragmentDefinition"
|
|
58346
58255
|
);
|
|
58347
58256
|
if (!operation) {
|
|
58348
58257
|
continue;
|
|
@@ -58386,10 +58295,10 @@ function collectDefinitions(config, docs) {
|
|
|
58386
58295
|
}
|
|
58387
58296
|
function findRequiredFragments(config, definition) {
|
|
58388
58297
|
const referencedFragments = [];
|
|
58389
|
-
const typeInfo = new
|
|
58390
|
-
definition.selectionSet =
|
|
58298
|
+
const typeInfo = new graphql7.TypeInfo(config.schema);
|
|
58299
|
+
definition.selectionSet = graphql7.visit(
|
|
58391
58300
|
definition,
|
|
58392
|
-
|
|
58301
|
+
graphql7.visitWithTypeInfo(typeInfo, {
|
|
58393
58302
|
FragmentSpread(node) {
|
|
58394
58303
|
referencedFragments.push(node.name.value);
|
|
58395
58304
|
}
|
|
@@ -58423,7 +58332,7 @@ function flattenFragments(filepath, operation, fragments) {
|
|
|
58423
58332
|
}
|
|
58424
58333
|
|
|
58425
58334
|
// src/codegen/transforms/fragmentVariables.ts
|
|
58426
|
-
var GraphqlKinds2 =
|
|
58335
|
+
var GraphqlKinds2 = graphql8.Kind;
|
|
58427
58336
|
async function fragmentVariables(config, documents) {
|
|
58428
58337
|
const fragments = collectDefinitions(config, documents);
|
|
58429
58338
|
const generatedFragments = {};
|
|
@@ -58446,7 +58355,7 @@ async function fragmentVariables(config, documents) {
|
|
|
58446
58355
|
});
|
|
58447
58356
|
}
|
|
58448
58357
|
const doc = {
|
|
58449
|
-
kind:
|
|
58358
|
+
kind: graphql8.Kind.DOCUMENT,
|
|
58450
58359
|
definitions: Object.values(generatedFragments)
|
|
58451
58360
|
};
|
|
58452
58361
|
documents.push({
|
|
@@ -58517,7 +58426,7 @@ function inlineFragmentArgs({
|
|
|
58517
58426
|
return null;
|
|
58518
58427
|
};
|
|
58519
58428
|
const result = esm_default(
|
|
58520
|
-
|
|
58429
|
+
graphql8.visit(document, {
|
|
58521
58430
|
FragmentSpread(node) {
|
|
58522
58431
|
if (!fragmentDefinitions[node.name.value]) {
|
|
58523
58432
|
throw new Error("Could not find definition for fragment" + node.name.value);
|
|
@@ -58603,7 +58512,7 @@ function inlineFragmentArgs({
|
|
|
58603
58512
|
);
|
|
58604
58513
|
if (newName) {
|
|
58605
58514
|
result.name = {
|
|
58606
|
-
kind:
|
|
58515
|
+
kind: graphql8.Kind.NAME,
|
|
58607
58516
|
value: newName
|
|
58608
58517
|
};
|
|
58609
58518
|
}
|
|
@@ -58770,7 +58679,7 @@ ${exportDefaultFrom(`./${doc.name}`, doc.name)}`,
|
|
|
58770
58679
|
}
|
|
58771
58680
|
|
|
58772
58681
|
// src/codegen/generators/artifacts/inputs.ts
|
|
58773
|
-
var
|
|
58682
|
+
var graphql9 = __toESM(require("graphql"), 1);
|
|
58774
58683
|
function inputObject(config, inputs, runtimeScalars) {
|
|
58775
58684
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
58776
58685
|
const inputObj = {
|
|
@@ -58800,10 +58709,10 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
|
|
|
58800
58709
|
if (visitedTypes.has(type.name)) {
|
|
58801
58710
|
return;
|
|
58802
58711
|
}
|
|
58803
|
-
if (
|
|
58712
|
+
if (graphql9.isEnumType(type) || graphql9.isScalarType(type)) {
|
|
58804
58713
|
return;
|
|
58805
58714
|
}
|
|
58806
|
-
if (
|
|
58715
|
+
if (graphql9.isUnionType(type)) {
|
|
58807
58716
|
return;
|
|
58808
58717
|
}
|
|
58809
58718
|
visitedTypes.add(type.name);
|
|
@@ -58821,50 +58730,50 @@ function walkInputs(config, visitedTypes, inputObj, rootType) {
|
|
|
58821
58730
|
}
|
|
58822
58731
|
|
|
58823
58732
|
// src/codegen/generators/artifacts/operations.ts
|
|
58824
|
-
var
|
|
58733
|
+
var graphql11 = __toESM(require("graphql"), 1);
|
|
58825
58734
|
|
|
58826
58735
|
// src/codegen/generators/artifacts/utils.ts
|
|
58827
|
-
var
|
|
58828
|
-
var
|
|
58829
|
-
var
|
|
58736
|
+
var graphql10 = __toESM(require("graphql"), 1);
|
|
58737
|
+
var recast4 = __toESM(require_main2(), 1);
|
|
58738
|
+
var AST4 = recast4.types.builders;
|
|
58830
58739
|
function serializeValue(value) {
|
|
58831
58740
|
if (Array.isArray(value)) {
|
|
58832
|
-
return
|
|
58741
|
+
return AST4.arrayExpression(value.map(serializeValue));
|
|
58833
58742
|
}
|
|
58834
58743
|
if (typeof value === "object" && value !== null) {
|
|
58835
|
-
return
|
|
58744
|
+
return AST4.objectExpression(
|
|
58836
58745
|
Object.entries(value).filter(([key, value2]) => typeof value2 !== "undefined").map(([key, val]) => {
|
|
58837
|
-
return
|
|
58746
|
+
return AST4.objectProperty(AST4.stringLiteral(key), serializeValue(val));
|
|
58838
58747
|
})
|
|
58839
58748
|
);
|
|
58840
58749
|
}
|
|
58841
58750
|
if (typeof value === "string") {
|
|
58842
58751
|
if (value.indexOf("\n") !== -1) {
|
|
58843
|
-
return
|
|
58844
|
-
[
|
|
58752
|
+
return AST4.templateLiteral(
|
|
58753
|
+
[AST4.templateElement({ raw: value, cooked: value }, true)],
|
|
58845
58754
|
[]
|
|
58846
58755
|
);
|
|
58847
58756
|
}
|
|
58848
|
-
return
|
|
58757
|
+
return AST4.stringLiteral(value);
|
|
58849
58758
|
}
|
|
58850
|
-
return
|
|
58759
|
+
return AST4.literal(value);
|
|
58851
58760
|
}
|
|
58852
58761
|
function convertValue(config, val) {
|
|
58853
58762
|
let value;
|
|
58854
58763
|
let kind;
|
|
58855
|
-
if (val.kind ===
|
|
58764
|
+
if (val.kind === graphql10.Kind.INT) {
|
|
58856
58765
|
value = parseInt(val.value, 10);
|
|
58857
58766
|
kind = "Int";
|
|
58858
|
-
} else if (val.kind ===
|
|
58767
|
+
} else if (val.kind === graphql10.Kind.FLOAT) {
|
|
58859
58768
|
value = parseFloat(val.value);
|
|
58860
58769
|
kind = "Float";
|
|
58861
|
-
} else if (val.kind ===
|
|
58770
|
+
} else if (val.kind === graphql10.Kind.BOOLEAN) {
|
|
58862
58771
|
value = val.value;
|
|
58863
58772
|
kind = "Boolean";
|
|
58864
|
-
} else if (val.kind ===
|
|
58773
|
+
} else if (val.kind === graphql10.Kind.VARIABLE) {
|
|
58865
58774
|
value = val.name.value;
|
|
58866
58775
|
kind = "Variable";
|
|
58867
|
-
} else if (val.kind ===
|
|
58776
|
+
} else if (val.kind === graphql10.Kind.STRING) {
|
|
58868
58777
|
value = val.value;
|
|
58869
58778
|
kind = "String";
|
|
58870
58779
|
}
|
|
@@ -58877,7 +58786,7 @@ function operationsByPath(config, filepath, definition, filterTypes) {
|
|
|
58877
58786
|
return {};
|
|
58878
58787
|
}
|
|
58879
58788
|
const pathOperations = {};
|
|
58880
|
-
|
|
58789
|
+
graphql11.visit(definition, {
|
|
58881
58790
|
FragmentSpread(node, _, __, ___, ancestors) {
|
|
58882
58791
|
if (!config.isListFragment(node.name.value)) {
|
|
58883
58792
|
return;
|
|
@@ -59036,19 +58945,19 @@ function ancestorKey(ancestors) {
|
|
|
59036
58945
|
}
|
|
59037
58946
|
|
|
59038
58947
|
// src/codegen/generators/artifacts/selection.ts
|
|
59039
|
-
var
|
|
58948
|
+
var graphql16 = __toESM(require("graphql"), 1);
|
|
59040
58949
|
|
|
59041
58950
|
// src/codegen/transforms/list.ts
|
|
59042
|
-
var
|
|
58951
|
+
var graphql14 = __toESM(require("graphql"), 1);
|
|
59043
58952
|
|
|
59044
58953
|
// src/codegen/utils/objectIdentificationSelection.ts
|
|
59045
|
-
var
|
|
58954
|
+
var graphql12 = __toESM(require("graphql"), 1);
|
|
59046
58955
|
var objectIdentificationSelection = (config, type) => {
|
|
59047
58956
|
return config.keyFieldsForType(type.name).map((key) => {
|
|
59048
58957
|
return {
|
|
59049
|
-
kind:
|
|
58958
|
+
kind: graphql12.Kind.FIELD,
|
|
59050
58959
|
name: {
|
|
59051
|
-
kind:
|
|
58960
|
+
kind: graphql12.Kind.NAME,
|
|
59052
58961
|
value: key
|
|
59053
58962
|
}
|
|
59054
58963
|
};
|
|
@@ -59056,7 +58965,7 @@ var objectIdentificationSelection = (config, type) => {
|
|
|
59056
58965
|
};
|
|
59057
58966
|
|
|
59058
58967
|
// src/codegen/transforms/paginate.ts
|
|
59059
|
-
var
|
|
58968
|
+
var graphql13 = __toESM(require("graphql"), 1);
|
|
59060
58969
|
async function paginate(config, documents) {
|
|
59061
58970
|
const newDocs = [];
|
|
59062
58971
|
for (const doc of documents) {
|
|
@@ -59089,7 +58998,7 @@ async function paginate(config, documents) {
|
|
|
59089
58998
|
};
|
|
59090
58999
|
let cursorType = "String";
|
|
59091
59000
|
let paginationPath = [];
|
|
59092
|
-
doc.document =
|
|
59001
|
+
doc.document = graphql13.visit(doc.document, {
|
|
59093
59002
|
Field(node, _, __, ___, ancestors) {
|
|
59094
59003
|
const paginateDirective = node.directives?.find(
|
|
59095
59004
|
(directive) => directive.name.value === config.paginateDirective
|
|
@@ -59115,7 +59024,7 @@ async function paginate(config, documents) {
|
|
|
59115
59024
|
flags.offset.enabled = offsetPagination;
|
|
59116
59025
|
flags.limit.enabled = offsetPagination;
|
|
59117
59026
|
paginationPath = ancestors.filter(
|
|
59118
|
-
(ancestor) => !Array.isArray(ancestor) && ancestor.kind ===
|
|
59027
|
+
(ancestor) => !Array.isArray(ancestor) && ancestor.kind === graphql13.Kind.FIELD
|
|
59119
59028
|
).concat(node).map((field) => field.alias?.value || field.name.value);
|
|
59120
59029
|
return {
|
|
59121
59030
|
...node,
|
|
@@ -59134,7 +59043,7 @@ async function paginate(config, documents) {
|
|
|
59134
59043
|
let fragment2 = "";
|
|
59135
59044
|
let paginateMode = config.defaultPaginateMode;
|
|
59136
59045
|
const requiredArgs = [];
|
|
59137
|
-
doc.document =
|
|
59046
|
+
doc.document = graphql13.visit(doc.document, {
|
|
59138
59047
|
OperationDefinition(node) {
|
|
59139
59048
|
if (node.operation !== "query") {
|
|
59140
59049
|
throw new HoudiniError({
|
|
@@ -59193,9 +59102,9 @@ async function paginate(config, documents) {
|
|
|
59193
59102
|
directives: [
|
|
59194
59103
|
...node.directives || [],
|
|
59195
59104
|
{
|
|
59196
|
-
kind:
|
|
59105
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
59197
59106
|
name: {
|
|
59198
|
-
kind:
|
|
59107
|
+
kind: graphql13.Kind.NAME,
|
|
59199
59108
|
value: config.argumentsDirective
|
|
59200
59109
|
}
|
|
59201
59110
|
}
|
|
@@ -59265,22 +59174,22 @@ async function paginate(config, documents) {
|
|
|
59265
59174
|
const paginationArgs = Object.entries(flags).filter(([_, { enabled }]) => enabled).map(([key, value]) => ({ name: key, ...value }));
|
|
59266
59175
|
const fragmentSpreadSelection = [
|
|
59267
59176
|
{
|
|
59268
|
-
kind:
|
|
59177
|
+
kind: graphql13.Kind.FRAGMENT_SPREAD,
|
|
59269
59178
|
name: {
|
|
59270
|
-
kind:
|
|
59179
|
+
kind: graphql13.Kind.NAME,
|
|
59271
59180
|
value: fragmentName
|
|
59272
59181
|
},
|
|
59273
59182
|
directives: [
|
|
59274
59183
|
{
|
|
59275
|
-
kind:
|
|
59184
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
59276
59185
|
name: {
|
|
59277
|
-
kind:
|
|
59186
|
+
kind: graphql13.Kind.NAME,
|
|
59278
59187
|
value: config.withDirective
|
|
59279
59188
|
},
|
|
59280
59189
|
["arguments"]: requiredArgs.map((arg) => variableAsArgument(arg.name)).concat(paginationArgs.map(({ name }) => variableAsArgument(name)))
|
|
59281
59190
|
},
|
|
59282
59191
|
{
|
|
59283
|
-
kind:
|
|
59192
|
+
kind: graphql13.Kind.DIRECTIVE,
|
|
59284
59193
|
name: {
|
|
59285
59194
|
kind: "Name",
|
|
59286
59195
|
value: config.maskDisableDirective
|
|
@@ -59307,23 +59216,23 @@ async function paginate(config, documents) {
|
|
|
59307
59216
|
});
|
|
59308
59217
|
const typeConfig = config.typeConfig?.[fragment2];
|
|
59309
59218
|
const queryDoc = {
|
|
59310
|
-
kind:
|
|
59219
|
+
kind: graphql13.Kind.DOCUMENT,
|
|
59311
59220
|
definitions: [
|
|
59312
59221
|
{
|
|
59313
|
-
kind:
|
|
59222
|
+
kind: graphql13.Kind.OPERATION_DEFINITION,
|
|
59314
59223
|
name: {
|
|
59315
|
-
kind:
|
|
59224
|
+
kind: graphql13.Kind.NAME,
|
|
59316
59225
|
value: refetchQueryName
|
|
59317
59226
|
},
|
|
59318
59227
|
operation: "query",
|
|
59319
59228
|
variableDefinitions: requiredArgs.map(
|
|
59320
59229
|
(arg) => ({
|
|
59321
|
-
kind:
|
|
59230
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
59322
59231
|
type: arg.type,
|
|
59323
59232
|
variable: {
|
|
59324
|
-
kind:
|
|
59233
|
+
kind: graphql13.Kind.VARIABLE,
|
|
59325
59234
|
name: {
|
|
59326
|
-
kind:
|
|
59235
|
+
kind: graphql13.Kind.NAME,
|
|
59327
59236
|
value: arg.name
|
|
59328
59237
|
}
|
|
59329
59238
|
}
|
|
@@ -59331,18 +59240,18 @@ async function paginate(config, documents) {
|
|
|
59331
59240
|
).concat(
|
|
59332
59241
|
paginationArgs.map(
|
|
59333
59242
|
(arg) => ({
|
|
59334
|
-
kind:
|
|
59243
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
59335
59244
|
type: {
|
|
59336
|
-
kind:
|
|
59245
|
+
kind: graphql13.Kind.NAMED_TYPE,
|
|
59337
59246
|
name: {
|
|
59338
|
-
kind:
|
|
59247
|
+
kind: graphql13.Kind.NAME,
|
|
59339
59248
|
value: arg.type
|
|
59340
59249
|
}
|
|
59341
59250
|
},
|
|
59342
59251
|
variable: {
|
|
59343
|
-
kind:
|
|
59252
|
+
kind: graphql13.Kind.VARIABLE,
|
|
59344
59253
|
name: {
|
|
59345
|
-
kind:
|
|
59254
|
+
kind: graphql13.Kind.NAME,
|
|
59346
59255
|
value: arg.name
|
|
59347
59256
|
}
|
|
59348
59257
|
},
|
|
@@ -59354,12 +59263,12 @@ async function paginate(config, documents) {
|
|
|
59354
59263
|
).concat(
|
|
59355
59264
|
!nodeQuery ? [] : keys2.map(
|
|
59356
59265
|
(key) => ({
|
|
59357
|
-
kind:
|
|
59266
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
59358
59267
|
type: key.type,
|
|
59359
59268
|
variable: {
|
|
59360
|
-
kind:
|
|
59269
|
+
kind: graphql13.Kind.VARIABLE,
|
|
59361
59270
|
name: {
|
|
59362
|
-
kind:
|
|
59271
|
+
kind: graphql13.Kind.NAME,
|
|
59363
59272
|
value: key.name
|
|
59364
59273
|
}
|
|
59365
59274
|
}
|
|
@@ -59368,42 +59277,42 @@ async function paginate(config, documents) {
|
|
|
59368
59277
|
)
|
|
59369
59278
|
),
|
|
59370
59279
|
selectionSet: {
|
|
59371
|
-
kind:
|
|
59280
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
59372
59281
|
selections: !nodeQuery ? fragmentSpreadSelection : [
|
|
59373
59282
|
{
|
|
59374
|
-
kind:
|
|
59283
|
+
kind: graphql13.Kind.FIELD,
|
|
59375
59284
|
name: {
|
|
59376
|
-
kind:
|
|
59285
|
+
kind: graphql13.Kind.NAME,
|
|
59377
59286
|
value: typeConfig?.resolve?.queryField || "node"
|
|
59378
59287
|
},
|
|
59379
59288
|
["arguments"]: keys2.map((key) => ({
|
|
59380
|
-
kind:
|
|
59289
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
59381
59290
|
name: {
|
|
59382
|
-
kind:
|
|
59291
|
+
kind: graphql13.Kind.NAME,
|
|
59383
59292
|
value: key.name
|
|
59384
59293
|
},
|
|
59385
59294
|
value: {
|
|
59386
|
-
kind:
|
|
59295
|
+
kind: graphql13.Kind.VARIABLE,
|
|
59387
59296
|
name: {
|
|
59388
|
-
kind:
|
|
59297
|
+
kind: graphql13.Kind.NAME,
|
|
59389
59298
|
value: key.name
|
|
59390
59299
|
}
|
|
59391
59300
|
}
|
|
59392
59301
|
})),
|
|
59393
59302
|
selectionSet: {
|
|
59394
|
-
kind:
|
|
59303
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
59395
59304
|
selections: [
|
|
59396
59305
|
{
|
|
59397
|
-
kind:
|
|
59306
|
+
kind: graphql13.Kind.FIELD,
|
|
59398
59307
|
name: {
|
|
59399
|
-
kind:
|
|
59308
|
+
kind: graphql13.Kind.NAME,
|
|
59400
59309
|
value: "__typename"
|
|
59401
59310
|
}
|
|
59402
59311
|
},
|
|
59403
59312
|
...(typeConfig?.keys || [config.defaultKeys[0]]).map((key) => ({
|
|
59404
|
-
kind:
|
|
59313
|
+
kind: graphql13.Kind.FIELD,
|
|
59405
59314
|
name: {
|
|
59406
|
-
kind:
|
|
59315
|
+
kind: graphql13.Kind.NAME,
|
|
59407
59316
|
value: key
|
|
59408
59317
|
}
|
|
59409
59318
|
})),
|
|
@@ -59460,15 +59369,15 @@ function replaceArgumentsWithVariables(args, flags) {
|
|
|
59460
59369
|
}
|
|
59461
59370
|
function variableAsArgument(name, variable) {
|
|
59462
59371
|
return {
|
|
59463
|
-
kind:
|
|
59372
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
59464
59373
|
name: {
|
|
59465
|
-
kind:
|
|
59374
|
+
kind: graphql13.Kind.NAME,
|
|
59466
59375
|
value: name
|
|
59467
59376
|
},
|
|
59468
59377
|
value: {
|
|
59469
|
-
kind:
|
|
59378
|
+
kind: graphql13.Kind.VARIABLE,
|
|
59470
59379
|
name: {
|
|
59471
|
-
kind:
|
|
59380
|
+
kind: graphql13.Kind.NAME,
|
|
59472
59381
|
value: variable ?? name
|
|
59473
59382
|
}
|
|
59474
59383
|
}
|
|
@@ -59476,18 +59385,18 @@ function variableAsArgument(name, variable) {
|
|
|
59476
59385
|
}
|
|
59477
59386
|
function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
59478
59387
|
return {
|
|
59479
|
-
kind:
|
|
59388
|
+
kind: graphql13.Kind.VARIABLE_DEFINITION,
|
|
59480
59389
|
type: {
|
|
59481
|
-
kind:
|
|
59390
|
+
kind: graphql13.Kind.NAMED_TYPE,
|
|
59482
59391
|
name: {
|
|
59483
|
-
kind:
|
|
59392
|
+
kind: graphql13.Kind.NAME,
|
|
59484
59393
|
value: type
|
|
59485
59394
|
}
|
|
59486
59395
|
},
|
|
59487
59396
|
variable: {
|
|
59488
|
-
kind:
|
|
59397
|
+
kind: graphql13.Kind.VARIABLE,
|
|
59489
59398
|
name: {
|
|
59490
|
-
kind:
|
|
59399
|
+
kind: graphql13.Kind.NAME,
|
|
59491
59400
|
value: variableName ?? name
|
|
59492
59401
|
}
|
|
59493
59402
|
},
|
|
@@ -59499,9 +59408,9 @@ function staticVariableDefinition(name, type, defaultValue, variableName) {
|
|
|
59499
59408
|
}
|
|
59500
59409
|
function argumentNode(name, value) {
|
|
59501
59410
|
return {
|
|
59502
|
-
kind:
|
|
59411
|
+
kind: graphql13.Kind.ARGUMENT,
|
|
59503
59412
|
name: {
|
|
59504
|
-
kind:
|
|
59413
|
+
kind: graphql13.Kind.NAME,
|
|
59505
59414
|
value: name
|
|
59506
59415
|
},
|
|
59507
59416
|
value: objectNode(value)
|
|
@@ -59509,16 +59418,16 @@ function argumentNode(name, value) {
|
|
|
59509
59418
|
}
|
|
59510
59419
|
function objectNode([type, defaultValue]) {
|
|
59511
59420
|
const node = {
|
|
59512
|
-
kind:
|
|
59421
|
+
kind: graphql13.Kind.OBJECT,
|
|
59513
59422
|
fields: [
|
|
59514
59423
|
{
|
|
59515
|
-
kind:
|
|
59424
|
+
kind: graphql13.Kind.OBJECT_FIELD,
|
|
59516
59425
|
name: {
|
|
59517
|
-
kind:
|
|
59426
|
+
kind: graphql13.Kind.NAME,
|
|
59518
59427
|
value: "type"
|
|
59519
59428
|
},
|
|
59520
59429
|
value: {
|
|
59521
|
-
kind:
|
|
59430
|
+
kind: graphql13.Kind.STRING,
|
|
59522
59431
|
value: type
|
|
59523
59432
|
}
|
|
59524
59433
|
}
|
|
@@ -59526,8 +59435,8 @@ function objectNode([type, defaultValue]) {
|
|
|
59526
59435
|
};
|
|
59527
59436
|
if (defaultValue) {
|
|
59528
59437
|
node.fields.push({
|
|
59529
|
-
kind:
|
|
59530
|
-
name: { kind:
|
|
59438
|
+
kind: graphql13.Kind.OBJECT_FIELD,
|
|
59439
|
+
name: { kind: graphql13.Kind.NAME, value: "default" },
|
|
59531
59440
|
value: {
|
|
59532
59441
|
kind: typeof defaultValue === "number" ? "IntValue" : "StringValue",
|
|
59533
59442
|
value: defaultValue.toString()
|
|
@@ -59538,34 +59447,34 @@ function objectNode([type, defaultValue]) {
|
|
|
59538
59447
|
}
|
|
59539
59448
|
var pageInfoSelection = [
|
|
59540
59449
|
{
|
|
59541
|
-
kind:
|
|
59450
|
+
kind: graphql13.Kind.FIELD,
|
|
59542
59451
|
name: {
|
|
59543
|
-
kind:
|
|
59452
|
+
kind: graphql13.Kind.NAME,
|
|
59544
59453
|
value: "edges"
|
|
59545
59454
|
},
|
|
59546
59455
|
selectionSet: {
|
|
59547
|
-
kind:
|
|
59456
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
59548
59457
|
selections: [
|
|
59549
59458
|
{
|
|
59550
|
-
kind:
|
|
59459
|
+
kind: graphql13.Kind.FIELD,
|
|
59551
59460
|
name: {
|
|
59552
|
-
kind:
|
|
59461
|
+
kind: graphql13.Kind.NAME,
|
|
59553
59462
|
value: "cursor"
|
|
59554
59463
|
}
|
|
59555
59464
|
},
|
|
59556
59465
|
{
|
|
59557
|
-
kind:
|
|
59466
|
+
kind: graphql13.Kind.FIELD,
|
|
59558
59467
|
name: {
|
|
59559
|
-
kind:
|
|
59468
|
+
kind: graphql13.Kind.NAME,
|
|
59560
59469
|
value: "node"
|
|
59561
59470
|
},
|
|
59562
59471
|
selectionSet: {
|
|
59563
|
-
kind:
|
|
59472
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
59564
59473
|
selections: [
|
|
59565
59474
|
{
|
|
59566
|
-
kind:
|
|
59475
|
+
kind: graphql13.Kind.FIELD,
|
|
59567
59476
|
name: {
|
|
59568
|
-
kind:
|
|
59477
|
+
kind: graphql13.Kind.NAME,
|
|
59569
59478
|
value: "__typename"
|
|
59570
59479
|
}
|
|
59571
59480
|
}
|
|
@@ -59576,39 +59485,39 @@ var pageInfoSelection = [
|
|
|
59576
59485
|
}
|
|
59577
59486
|
},
|
|
59578
59487
|
{
|
|
59579
|
-
kind:
|
|
59488
|
+
kind: graphql13.Kind.FIELD,
|
|
59580
59489
|
name: {
|
|
59581
|
-
kind:
|
|
59490
|
+
kind: graphql13.Kind.NAME,
|
|
59582
59491
|
value: "pageInfo"
|
|
59583
59492
|
},
|
|
59584
59493
|
selectionSet: {
|
|
59585
|
-
kind:
|
|
59494
|
+
kind: graphql13.Kind.SELECTION_SET,
|
|
59586
59495
|
selections: [
|
|
59587
59496
|
{
|
|
59588
|
-
kind:
|
|
59497
|
+
kind: graphql13.Kind.FIELD,
|
|
59589
59498
|
name: {
|
|
59590
|
-
kind:
|
|
59499
|
+
kind: graphql13.Kind.NAME,
|
|
59591
59500
|
value: "hasPreviousPage"
|
|
59592
59501
|
}
|
|
59593
59502
|
},
|
|
59594
59503
|
{
|
|
59595
|
-
kind:
|
|
59504
|
+
kind: graphql13.Kind.FIELD,
|
|
59596
59505
|
name: {
|
|
59597
|
-
kind:
|
|
59506
|
+
kind: graphql13.Kind.NAME,
|
|
59598
59507
|
value: "hasNextPage"
|
|
59599
59508
|
}
|
|
59600
59509
|
},
|
|
59601
59510
|
{
|
|
59602
|
-
kind:
|
|
59511
|
+
kind: graphql13.Kind.FIELD,
|
|
59603
59512
|
name: {
|
|
59604
|
-
kind:
|
|
59513
|
+
kind: graphql13.Kind.NAME,
|
|
59605
59514
|
value: "startCursor"
|
|
59606
59515
|
}
|
|
59607
59516
|
},
|
|
59608
59517
|
{
|
|
59609
|
-
kind:
|
|
59518
|
+
kind: graphql13.Kind.FIELD,
|
|
59610
59519
|
name: {
|
|
59611
|
-
kind:
|
|
59520
|
+
kind: graphql13.Kind.NAME,
|
|
59612
59521
|
value: "endCursor"
|
|
59613
59522
|
}
|
|
59614
59523
|
}
|
|
@@ -59622,17 +59531,17 @@ async function addListFragments(config, documents) {
|
|
|
59622
59531
|
const lists = {};
|
|
59623
59532
|
const errors = [];
|
|
59624
59533
|
for (const doc of documents) {
|
|
59625
|
-
doc.document =
|
|
59534
|
+
doc.document = graphql14.visit(doc.document, {
|
|
59626
59535
|
Directive(node, key, parent2, path2, ancestors) {
|
|
59627
59536
|
if ([config.listDirective, config.paginateDirective].includes(node.name.value)) {
|
|
59628
59537
|
const nameArg = node.arguments?.find(
|
|
59629
59538
|
(arg) => arg.name.value === config.listOrPaginateNameArg
|
|
59630
59539
|
);
|
|
59631
59540
|
let error = {
|
|
59632
|
-
...new
|
|
59541
|
+
...new graphql14.GraphQLError(
|
|
59633
59542
|
"",
|
|
59634
59543
|
node,
|
|
59635
|
-
new
|
|
59544
|
+
new graphql14.Source(""),
|
|
59636
59545
|
node.loc ? [node.loc.start, node.loc.end] : null,
|
|
59637
59546
|
path2
|
|
59638
59547
|
),
|
|
@@ -59684,7 +59593,7 @@ async function addListFragments(config, documents) {
|
|
|
59684
59593
|
{
|
|
59685
59594
|
kind: "Argument",
|
|
59686
59595
|
name: {
|
|
59687
|
-
kind:
|
|
59596
|
+
kind: graphql14.Kind.NAME,
|
|
59688
59597
|
value: "connection"
|
|
59689
59598
|
},
|
|
59690
59599
|
value: {
|
|
@@ -59734,7 +59643,7 @@ async function addListFragments(config, documents) {
|
|
|
59734
59643
|
const validDeletes = [
|
|
59735
59644
|
...new Set(
|
|
59736
59645
|
Object.values(lists).map(({ type }) => {
|
|
59737
|
-
if (!(type instanceof
|
|
59646
|
+
if (!(type instanceof graphql14.GraphQLObjectType)) {
|
|
59738
59647
|
return "";
|
|
59739
59648
|
}
|
|
59740
59649
|
if (config.keyFieldsForType(type.name).length !== 1) {
|
|
@@ -59748,7 +59657,7 @@ async function addListFragments(config, documents) {
|
|
|
59748
59657
|
return;
|
|
59749
59658
|
}
|
|
59750
59659
|
const generatedDoc = {
|
|
59751
|
-
kind:
|
|
59660
|
+
kind: graphql14.Kind.DOCUMENT,
|
|
59752
59661
|
definitions: Object.entries(lists).flatMap(
|
|
59753
59662
|
([name, { selection, type }]) => {
|
|
59754
59663
|
const schemaType = config.schema.getType(type.name);
|
|
@@ -59756,7 +59665,7 @@ async function addListFragments(config, documents) {
|
|
|
59756
59665
|
throw new HoudiniError({ message: "Lists must have a selection" });
|
|
59757
59666
|
}
|
|
59758
59667
|
const fragmentSelection = {
|
|
59759
|
-
kind:
|
|
59668
|
+
kind: graphql14.Kind.SELECTION_SET,
|
|
59760
59669
|
selections: [...selection.selections]
|
|
59761
59670
|
};
|
|
59762
59671
|
if (schemaType && fragmentSelection && !fragmentSelection?.selections.find(
|
|
@@ -59771,14 +59680,14 @@ async function addListFragments(config, documents) {
|
|
|
59771
59680
|
{
|
|
59772
59681
|
name: {
|
|
59773
59682
|
value: config.listInsertFragment(name),
|
|
59774
|
-
kind:
|
|
59683
|
+
kind: graphql14.Kind.NAME
|
|
59775
59684
|
},
|
|
59776
|
-
kind:
|
|
59685
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
59777
59686
|
selectionSet: fragmentSelection,
|
|
59778
59687
|
typeCondition: {
|
|
59779
|
-
kind:
|
|
59688
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
59780
59689
|
name: {
|
|
59781
|
-
kind:
|
|
59690
|
+
kind: graphql14.Kind.NAME,
|
|
59782
59691
|
value: type.name
|
|
59783
59692
|
}
|
|
59784
59693
|
}
|
|
@@ -59786,32 +59695,32 @@ async function addListFragments(config, documents) {
|
|
|
59786
59695
|
{
|
|
59787
59696
|
name: {
|
|
59788
59697
|
value: config.listToggleFragment(name),
|
|
59789
|
-
kind:
|
|
59698
|
+
kind: graphql14.Kind.NAME
|
|
59790
59699
|
},
|
|
59791
|
-
kind:
|
|
59700
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
59792
59701
|
selectionSet: fragmentSelection,
|
|
59793
59702
|
typeCondition: {
|
|
59794
|
-
kind:
|
|
59703
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
59795
59704
|
name: {
|
|
59796
|
-
kind:
|
|
59705
|
+
kind: graphql14.Kind.NAME,
|
|
59797
59706
|
value: type.name
|
|
59798
59707
|
}
|
|
59799
59708
|
}
|
|
59800
59709
|
},
|
|
59801
59710
|
{
|
|
59802
|
-
kind:
|
|
59711
|
+
kind: graphql14.Kind.FRAGMENT_DEFINITION,
|
|
59803
59712
|
name: {
|
|
59804
59713
|
value: config.listRemoveFragment(name),
|
|
59805
|
-
kind:
|
|
59714
|
+
kind: graphql14.Kind.NAME
|
|
59806
59715
|
},
|
|
59807
59716
|
selectionSet: {
|
|
59808
|
-
kind:
|
|
59717
|
+
kind: graphql14.Kind.SELECTION_SET,
|
|
59809
59718
|
selections: [...objectIdentificationSelection(config, type)]
|
|
59810
59719
|
},
|
|
59811
59720
|
typeCondition: {
|
|
59812
|
-
kind:
|
|
59721
|
+
kind: graphql14.Kind.NAMED_TYPE,
|
|
59813
59722
|
name: {
|
|
59814
|
-
kind:
|
|
59723
|
+
kind: graphql14.Kind.NAME,
|
|
59815
59724
|
value: type.name
|
|
59816
59725
|
}
|
|
59817
59726
|
}
|
|
@@ -59820,14 +59729,14 @@ async function addListFragments(config, documents) {
|
|
|
59820
59729
|
}
|
|
59821
59730
|
).concat(
|
|
59822
59731
|
...validDeletes.map((typeName) => ({
|
|
59823
|
-
kind:
|
|
59732
|
+
kind: graphql14.Kind.DIRECTIVE_DEFINITION,
|
|
59824
59733
|
name: {
|
|
59825
|
-
kind:
|
|
59734
|
+
kind: graphql14.Kind.NAME,
|
|
59826
59735
|
value: config.listDeleteDirective(typeName)
|
|
59827
59736
|
},
|
|
59828
59737
|
locations: [
|
|
59829
59738
|
{
|
|
59830
|
-
kind:
|
|
59739
|
+
kind: graphql14.Kind.NAME,
|
|
59831
59740
|
value: "FIELD"
|
|
59832
59741
|
}
|
|
59833
59742
|
],
|
|
@@ -59835,8 +59744,8 @@ async function addListFragments(config, documents) {
|
|
|
59835
59744
|
}))
|
|
59836
59745
|
)
|
|
59837
59746
|
};
|
|
59838
|
-
config.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(
|
|
59839
|
-
config.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(
|
|
59747
|
+
config.newSchema += "\n" + generatedDoc.definitions.filter((c) => c.kind !== "FragmentDefinition").map(graphql14.print).join("\n\n");
|
|
59748
|
+
config.newDocuments += "\n" + generatedDoc.definitions.filter((c) => c.kind === "FragmentDefinition").map(graphql14.print).join("\n\n");
|
|
59840
59749
|
documents.push({
|
|
59841
59750
|
name: "generated::lists",
|
|
59842
59751
|
kind: ArtifactKind.Fragment,
|
|
@@ -59922,11 +59831,11 @@ var nodeNotDefinedMessage = (config) => `Looks like you are trying to use the ${
|
|
|
59922
59831
|
For more information, visit this link: ${siteURL}/guides/pagination`;
|
|
59923
59832
|
|
|
59924
59833
|
// src/codegen/generators/artifacts/fieldKey.ts
|
|
59925
|
-
var
|
|
59834
|
+
var graphql15 = __toESM(require("graphql"), 1);
|
|
59926
59835
|
function fieldKey(config, field) {
|
|
59927
59836
|
const attributeName = field.alias?.value || field.name.value;
|
|
59928
|
-
const printed =
|
|
59929
|
-
const secondParse =
|
|
59837
|
+
const printed = graphql15.print(field);
|
|
59838
|
+
const secondParse = graphql15.parse(`{${printed}}`).definitions[0].selectionSet.selections[0];
|
|
59930
59839
|
let paginateMode = config.defaultPaginateMode;
|
|
59931
59840
|
const paginatedDirective = field.directives?.find(
|
|
59932
59841
|
(directive) => directive.name.value === config.paginateDirective
|
|
@@ -60049,13 +59958,13 @@ function prepareSelection({
|
|
|
60049
59958
|
} else if ("getFields" in type) {
|
|
60050
59959
|
let typeRef = type.getFields()[field.name.value].type;
|
|
60051
59960
|
fieldType = getRootType(typeRef);
|
|
60052
|
-
nullable = !
|
|
60053
|
-
} else if (
|
|
59961
|
+
nullable = !graphql16.isNonNullType(typeRef);
|
|
59962
|
+
} else if (graphql16.isAbstractType(type)) {
|
|
60054
59963
|
for (const possible of config.schema.getPossibleTypes(type)) {
|
|
60055
|
-
if (
|
|
59964
|
+
if (graphql16.isObjectType(possible)) {
|
|
60056
59965
|
if (possible.getFields()[field.name.value]) {
|
|
60057
59966
|
fieldType = possible.getFields()[field.name.value].type;
|
|
60058
|
-
nullable = !
|
|
59967
|
+
nullable = !graphql16.isNonNullType(fieldType);
|
|
60059
59968
|
break;
|
|
60060
59969
|
}
|
|
60061
59970
|
}
|
|
@@ -60192,7 +60101,7 @@ function prepareSelection({
|
|
|
60192
60101
|
kind: "value"
|
|
60193
60102
|
} : { kind: "continue" };
|
|
60194
60103
|
const parentType = config.schema.getType(rootType);
|
|
60195
|
-
if (
|
|
60104
|
+
if (graphql16.isObjectType(parentType) || graphql16.isInterfaceType(parentType)) {
|
|
60196
60105
|
const fieldType2 = parentType.getFields()[field.name.value]?.type;
|
|
60197
60106
|
if (fieldType2) {
|
|
60198
60107
|
const listCount = unwrapType(config, fieldType2).wrappers.filter(
|
|
@@ -60215,7 +60124,7 @@ function prepareSelection({
|
|
|
60215
60124
|
}
|
|
60216
60125
|
fieldObj.loading = loadingValue;
|
|
60217
60126
|
}
|
|
60218
|
-
if (
|
|
60127
|
+
if (graphql16.isInterfaceType(fieldType) || graphql16.isUnionType(fieldType)) {
|
|
60219
60128
|
fieldObj.abstract = true;
|
|
60220
60129
|
if (Object.values(fieldObj.selection?.abstractFields?.fields ?? {}).some(
|
|
60221
60130
|
(fields) => Object.values(fields ?? {}).some((field2) => field2.required)
|
|
@@ -60297,7 +60206,7 @@ function mergeSelection({
|
|
|
60297
60206
|
typeSelection,
|
|
60298
60207
|
abstractSelection.fields[typeName] ?? {}
|
|
60299
60208
|
);
|
|
60300
|
-
if (
|
|
60209
|
+
if (graphql16.isAbstractType(gqlType)) {
|
|
60301
60210
|
for (const possible of config.schema.getPossibleTypes(gqlType)) {
|
|
60302
60211
|
if (!possibleSelectionTypes[typeName]) {
|
|
60303
60212
|
possibleSelectionTypes[typeName] = [];
|
|
@@ -60332,7 +60241,7 @@ function mergeSelection({
|
|
|
60332
60241
|
}
|
|
60333
60242
|
}
|
|
60334
60243
|
const parentType = config.schema.getType(rootType);
|
|
60335
|
-
const possibleParents =
|
|
60244
|
+
const possibleParents = graphql16.isAbstractType(parentType) ? config.schema.getPossibleTypes(parentType)?.map((t2) => t2.name) : [parentType.name];
|
|
60336
60245
|
for (const key of Object.keys(abstractSelection.typeMap)) {
|
|
60337
60246
|
if (!possibleParents.includes(key) && rootType !== key || abstractSelection.fields[key]) {
|
|
60338
60247
|
delete abstractSelection.typeMap[key];
|
|
@@ -60389,12 +60298,12 @@ function mergeSelection({
|
|
|
60389
60298
|
}
|
|
60390
60299
|
|
|
60391
60300
|
// src/codegen/generators/artifacts/index.ts
|
|
60392
|
-
var
|
|
60301
|
+
var AST5 = recast5.types.builders;
|
|
60393
60302
|
function artifactGenerator(stats) {
|
|
60394
60303
|
return async function(config, docs) {
|
|
60395
60304
|
const filterTypes = {};
|
|
60396
60305
|
for (const doc of docs) {
|
|
60397
|
-
|
|
60306
|
+
graphql17.visit(doc.document, {
|
|
60398
60307
|
Directive(node, _, __, ___, ancestors) {
|
|
60399
60308
|
if (node.name.value !== config.listDirective) {
|
|
60400
60309
|
return;
|
|
@@ -60454,7 +60363,7 @@ function artifactGenerator(stats) {
|
|
|
60454
60363
|
return;
|
|
60455
60364
|
}
|
|
60456
60365
|
const usedVariableNames = /* @__PURE__ */ new Set();
|
|
60457
|
-
let documentWithoutInternalDirectives =
|
|
60366
|
+
let documentWithoutInternalDirectives = graphql17.visit(document, {
|
|
60458
60367
|
Directive(node) {
|
|
60459
60368
|
if (config.isInternalDirective(node.name.value)) {
|
|
60460
60369
|
return null;
|
|
@@ -60467,7 +60376,7 @@ function artifactGenerator(stats) {
|
|
|
60467
60376
|
}
|
|
60468
60377
|
}
|
|
60469
60378
|
});
|
|
60470
|
-
let documentWithoutExtraVariables =
|
|
60379
|
+
let documentWithoutExtraVariables = graphql17.visit(
|
|
60471
60380
|
documentWithoutInternalDirectives,
|
|
60472
60381
|
{
|
|
60473
60382
|
VariableDefinition(variableDefinitionNode) {
|
|
@@ -60478,13 +60387,13 @@ function artifactGenerator(stats) {
|
|
|
60478
60387
|
}
|
|
60479
60388
|
}
|
|
60480
60389
|
);
|
|
60481
|
-
let rawString =
|
|
60390
|
+
let rawString = graphql17.print(documentWithoutExtraVariables);
|
|
60482
60391
|
let docKind = doc.kind;
|
|
60483
60392
|
const operations = document.definitions.filter(
|
|
60484
|
-
({ kind }) => kind ===
|
|
60393
|
+
({ kind }) => kind === graphql17.Kind.OPERATION_DEFINITION
|
|
60485
60394
|
);
|
|
60486
60395
|
const fragments = document.definitions.filter(
|
|
60487
|
-
({ kind }) => kind ===
|
|
60396
|
+
({ kind }) => kind === graphql17.Kind.FRAGMENT_DEFINITION
|
|
60488
60397
|
);
|
|
60489
60398
|
let rootType = "";
|
|
60490
60399
|
let selectionSet;
|
|
@@ -60684,9 +60593,9 @@ function artifactGenerator(stats) {
|
|
|
60684
60593
|
plugin2.artifactEnd({ config, document: doc });
|
|
60685
60594
|
}
|
|
60686
60595
|
const _houdiniHash = hashOriginal({ document: doc });
|
|
60687
|
-
const file =
|
|
60596
|
+
const file = AST5.program([
|
|
60688
60597
|
moduleExport(config, "default", serializeValue(artifact)),
|
|
60689
|
-
|
|
60598
|
+
AST5.expressionStatement(AST5.stringLiteral(`HoudiniHash=${_houdiniHash}`))
|
|
60690
60599
|
]);
|
|
60691
60600
|
const artifactPath = config.artifactPath(document);
|
|
60692
60601
|
const countDocument = doc.generateStore;
|
|
@@ -60744,7 +60653,7 @@ function applyMask(config, target, mask) {
|
|
|
60744
60653
|
if (!targetType) {
|
|
60745
60654
|
continue;
|
|
60746
60655
|
}
|
|
60747
|
-
if (
|
|
60656
|
+
if (graphql17.isAbstractType(targetType)) {
|
|
60748
60657
|
for (const possible of config.schema.getPossibleTypes(targetType)) {
|
|
60749
60658
|
if (target.abstractFields?.fields[possible.name]) {
|
|
60750
60659
|
applyMask(
|
|
@@ -60767,8 +60676,8 @@ function applyMask(config, target, mask) {
|
|
|
60767
60676
|
}
|
|
60768
60677
|
|
|
60769
60678
|
// src/codegen/generators/runtime/graphqlFunction.ts
|
|
60770
|
-
var
|
|
60771
|
-
var
|
|
60679
|
+
var recast6 = __toESM(require_main2(), 1);
|
|
60680
|
+
var AST6 = recast6.types.builders;
|
|
60772
60681
|
async function generateGraphqlReturnTypes(config, docs) {
|
|
60773
60682
|
const indexPath = path_exports.join(config.runtimeDirectory, "index.d.ts");
|
|
60774
60683
|
const fileContent = await fs_exports.readFile(indexPath) || "";
|
|
@@ -60803,18 +60712,18 @@ async function generateGraphqlReturnTypes(config, docs) {
|
|
|
60803
60712
|
continue;
|
|
60804
60713
|
}
|
|
60805
60714
|
for (const [queryString, returnValue] of Object.entries(overloaded_returns)) {
|
|
60806
|
-
const input =
|
|
60807
|
-
input.typeAnnotation =
|
|
60808
|
-
|
|
60715
|
+
const input = AST6.identifier("str");
|
|
60716
|
+
input.typeAnnotation = AST6.tsTypeAnnotation(
|
|
60717
|
+
AST6.tsLiteralType(AST6.stringLiteral(queryString))
|
|
60809
60718
|
);
|
|
60810
60719
|
script.body.splice(
|
|
60811
60720
|
i,
|
|
60812
60721
|
0,
|
|
60813
|
-
|
|
60814
|
-
|
|
60815
|
-
|
|
60722
|
+
AST6.exportNamedDeclaration(
|
|
60723
|
+
AST6.tsDeclareFunction(
|
|
60724
|
+
AST6.identifier("graphql"),
|
|
60816
60725
|
[input],
|
|
60817
|
-
|
|
60726
|
+
AST6.tsTypeAnnotation(AST6.tsTypeReference(AST6.identifier(returnValue)))
|
|
60818
60727
|
)
|
|
60819
60728
|
)
|
|
60820
60729
|
);
|
|
@@ -60989,165 +60898,22 @@ function moduleStatments(config) {
|
|
|
60989
60898
|
var recast11 = __toESM(require_main2(), 1);
|
|
60990
60899
|
|
|
60991
60900
|
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
60992
|
-
var graphql19 = __toESM(require("graphql"), 1);
|
|
60993
|
-
var recast8 = __toESM(require_main2(), 1);
|
|
60994
|
-
|
|
60995
|
-
// src/codegen/generators/typescript/typeReference.ts
|
|
60996
60901
|
var graphql18 = __toESM(require("graphql"), 1);
|
|
60997
60902
|
var recast7 = __toESM(require_main2(), 1);
|
|
60998
|
-
|
|
60999
|
-
// src/codegen/generators/typescript/types.ts
|
|
61000
|
-
var graphql17 = __toESM(require("graphql"), 1);
|
|
61001
|
-
var recast6 = __toESM(require_main2(), 1);
|
|
61002
|
-
var AST6 = recast6.types.builders;
|
|
61003
|
-
function readonlyProperty(prop, enable = true) {
|
|
61004
|
-
if (enable) {
|
|
61005
|
-
prop.readonly = true;
|
|
61006
|
-
}
|
|
61007
|
-
return prop;
|
|
61008
|
-
}
|
|
61009
|
-
function nullableField(inner, input = false) {
|
|
61010
|
-
const members = [inner, AST6.tsNullKeyword()];
|
|
61011
|
-
if (input) {
|
|
61012
|
-
members.push(AST6.tsUndefinedKeyword());
|
|
61013
|
-
}
|
|
61014
|
-
return AST6.tsUnionType(members);
|
|
61015
|
-
}
|
|
61016
|
-
function scalarPropertyValue(config, filepath, missingScalars, target, body, field) {
|
|
61017
|
-
if (config.configFile.features?.componentFields && target.name === config.componentScalar) {
|
|
61018
|
-
if (!field) {
|
|
61019
|
-
return AST6.tsNeverKeyword();
|
|
61020
|
-
}
|
|
61021
|
-
const component = config.componentFields[field.parent][field.field];
|
|
61022
|
-
const sourcePathRelative = path_exports.relative(
|
|
61023
|
-
path_exports.join(config.projectRoot, "src"),
|
|
61024
|
-
component.filepath
|
|
61025
|
-
);
|
|
61026
|
-
let sourcePathParsed = path_exports.parse(sourcePathRelative);
|
|
61027
|
-
let sourcePath = path_exports.join(sourcePathParsed.dir, sourcePathParsed.name);
|
|
61028
|
-
const localImport = ensureImports({
|
|
61029
|
-
config,
|
|
61030
|
-
body,
|
|
61031
|
-
import: "__component__" + component.fragment,
|
|
61032
|
-
sourceModule: path_exports.join(
|
|
61033
|
-
path_exports.relative(path_exports.dirname(filepath), config.projectRoot),
|
|
61034
|
-
"src",
|
|
61035
|
-
sourcePath
|
|
61036
|
-
)
|
|
61037
|
-
});
|
|
61038
|
-
const parameters = AST6.tsTypeReference(AST6.identifier("Parameters"));
|
|
61039
|
-
parameters.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
61040
|
-
AST6.tsTypeQuery(AST6.identifier(localImport))
|
|
61041
|
-
]);
|
|
61042
|
-
const indexed = AST6.tsIndexedAccessType(
|
|
61043
|
-
parameters,
|
|
61044
|
-
AST6.tsLiteralType(AST6.numericLiteral(0))
|
|
61045
|
-
);
|
|
61046
|
-
const omit = AST6.tsTypeReference(AST6.identifier("Omit"));
|
|
61047
|
-
omit.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
61048
|
-
indexed,
|
|
61049
|
-
AST6.tsLiteralType(AST6.stringLiteral(component.prop))
|
|
61050
|
-
]);
|
|
61051
|
-
const arg = AST6.identifier("props");
|
|
61052
|
-
arg.typeAnnotation = AST6.tsTypeAnnotation(omit);
|
|
61053
|
-
const returnType = AST6.tsTypeReference(AST6.identifier("ReturnType"));
|
|
61054
|
-
returnType.typeParameters = AST6.tsTypeParameterInstantiation([
|
|
61055
|
-
AST6.tsTypeQuery(AST6.identifier(localImport))
|
|
61056
|
-
]);
|
|
61057
|
-
const fnType = AST6.tsFunctionType([arg]);
|
|
61058
|
-
fnType.typeAnnotation = AST6.tsTypeAnnotation(returnType);
|
|
61059
|
-
return fnType;
|
|
61060
|
-
}
|
|
61061
|
-
switch (target.name) {
|
|
61062
|
-
case "String": {
|
|
61063
|
-
return AST6.tsStringKeyword();
|
|
61064
|
-
}
|
|
61065
|
-
case "Int": {
|
|
61066
|
-
return AST6.tsNumberKeyword();
|
|
61067
|
-
}
|
|
61068
|
-
case "Float": {
|
|
61069
|
-
return AST6.tsNumberKeyword();
|
|
61070
|
-
}
|
|
61071
|
-
case "Boolean": {
|
|
61072
|
-
return AST6.tsBooleanKeyword();
|
|
61073
|
-
}
|
|
61074
|
-
case "ID": {
|
|
61075
|
-
return AST6.tsStringKeyword();
|
|
61076
|
-
}
|
|
61077
|
-
default: {
|
|
61078
|
-
if (graphql17.isNonNullType(target) && "ofType" in target) {
|
|
61079
|
-
return scalarPropertyValue(
|
|
61080
|
-
config,
|
|
61081
|
-
filepath,
|
|
61082
|
-
missingScalars,
|
|
61083
|
-
target.ofType,
|
|
61084
|
-
body,
|
|
61085
|
-
field
|
|
61086
|
-
);
|
|
61087
|
-
}
|
|
61088
|
-
if (config.scalars?.[target.name]) {
|
|
61089
|
-
return AST6.tsTypeReference(AST6.identifier(config.scalars?.[target.name].type));
|
|
61090
|
-
}
|
|
61091
|
-
if (target.name !== config.componentScalar) {
|
|
61092
|
-
missingScalars.add(target.name);
|
|
61093
|
-
}
|
|
61094
|
-
return AST6.tsAnyKeyword();
|
|
61095
|
-
}
|
|
61096
|
-
}
|
|
61097
|
-
}
|
|
61098
|
-
|
|
61099
|
-
// src/codegen/generators/typescript/typeReference.ts
|
|
61100
60903
|
var AST7 = recast7.types.builders;
|
|
61101
|
-
function tsTypeReference(config, filepath, missingScalars, definition, body) {
|
|
61102
|
-
const { type, wrappers } = unwrapType(config, definition.type);
|
|
61103
|
-
let result;
|
|
61104
|
-
if (graphql18.isScalarType(type)) {
|
|
61105
|
-
result = scalarPropertyValue(config, filepath, missingScalars, type, body, null);
|
|
61106
|
-
} else if (graphql18.isEnumType(type)) {
|
|
61107
|
-
result = enumReference(config, body, type.name);
|
|
61108
|
-
} else {
|
|
61109
|
-
result = AST7.tsTypeReference(AST7.identifier(type.name));
|
|
61110
|
-
}
|
|
61111
|
-
for (const toWrap of wrappers) {
|
|
61112
|
-
if (toWrap === "NonNull" /* NonNull */) {
|
|
61113
|
-
continue;
|
|
61114
|
-
} else if (toWrap === "Nullable" /* Nullable */) {
|
|
61115
|
-
result = nullableField(result, true);
|
|
61116
|
-
} else if (toWrap === "List" /* List */) {
|
|
61117
|
-
result = AST7.tsArrayType(AST7.tsParenthesizedType(result));
|
|
61118
|
-
}
|
|
61119
|
-
}
|
|
61120
|
-
return result;
|
|
61121
|
-
}
|
|
61122
|
-
function enumReference(config, body, name) {
|
|
61123
|
-
ensureImports({
|
|
61124
|
-
config,
|
|
61125
|
-
body,
|
|
61126
|
-
import: ["ValueOf"],
|
|
61127
|
-
importKind: "type",
|
|
61128
|
-
sourceModule: "$houdini/runtime/lib/types"
|
|
61129
|
-
});
|
|
61130
|
-
return AST7.tsTypeReference(
|
|
61131
|
-
AST7.identifier("ValueOf"),
|
|
61132
|
-
AST7.tsTypeParameterInstantiation([AST7.tsTypeQuery(AST7.identifier(name))])
|
|
61133
|
-
);
|
|
61134
|
-
}
|
|
61135
|
-
|
|
61136
|
-
// src/codegen/generators/typescript/addReferencedInputTypes.ts
|
|
61137
|
-
var AST8 = recast8.types.builders;
|
|
61138
60904
|
function addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, rootType) {
|
|
61139
60905
|
const { type } = unwrapType(config, rootType);
|
|
61140
|
-
if (
|
|
60906
|
+
if (graphql18.isScalarType(type)) {
|
|
61141
60907
|
return;
|
|
61142
60908
|
}
|
|
61143
60909
|
if (visitedTypes.has(type.name)) {
|
|
61144
60910
|
return;
|
|
61145
60911
|
}
|
|
61146
|
-
if (
|
|
60912
|
+
if (graphql18.isUnionType(type)) {
|
|
61147
60913
|
throw new HoudiniError({ filepath, message: "Input Unions are not supported yet. Sorry!" });
|
|
61148
60914
|
}
|
|
61149
60915
|
visitedTypes.add(type.name);
|
|
61150
|
-
if (
|
|
60916
|
+
if (graphql18.isEnumType(type)) {
|
|
61151
60917
|
ensureImports({
|
|
61152
60918
|
config,
|
|
61153
60919
|
body,
|
|
@@ -61161,21 +60927,37 @@ function addReferencedInputTypes(config, filepath, body, visitedTypes, missingSc
|
|
|
61161
60927
|
for (const field of Object.values(type.getFields())) {
|
|
61162
60928
|
addReferencedInputTypes(config, filepath, body, visitedTypes, missingScalars, field.type);
|
|
61163
60929
|
members.push(
|
|
61164
|
-
|
|
61165
|
-
|
|
61166
|
-
|
|
60930
|
+
AST7.tsPropertySignature(
|
|
60931
|
+
AST7.identifier(field.name),
|
|
60932
|
+
AST7.tsTypeAnnotation(
|
|
61167
60933
|
tsTypeReference(config, filepath, missingScalars, field, body)
|
|
61168
60934
|
),
|
|
61169
|
-
|
|
60935
|
+
graphql18.isNullableType(field.type)
|
|
61170
60936
|
)
|
|
61171
60937
|
);
|
|
61172
60938
|
}
|
|
61173
|
-
body.push(
|
|
60939
|
+
body.push(AST7.tsTypeAliasDeclaration(AST7.identifier(type.name), AST7.tsTypeLiteral(members)));
|
|
61174
60940
|
}
|
|
61175
60941
|
|
|
61176
60942
|
// src/codegen/generators/typescript/inlineType.ts
|
|
61177
|
-
var
|
|
60943
|
+
var graphql19 = __toESM(require("graphql"), 1);
|
|
61178
60944
|
var recast9 = __toESM(require_main2(), 1);
|
|
60945
|
+
|
|
60946
|
+
// src/codegen/generators/comments/jsdoc.ts
|
|
60947
|
+
var recast8 = __toESM(require_main2(), 1);
|
|
60948
|
+
var AST8 = recast8.types.builders;
|
|
60949
|
+
function jsdocComment(text, deprecated) {
|
|
60950
|
+
let commentContent = `*
|
|
60951
|
+
* ${text}
|
|
60952
|
+
`;
|
|
60953
|
+
if (deprecated) {
|
|
60954
|
+
commentContent = `${commentContent} * @deprecated ${deprecated}
|
|
60955
|
+
`;
|
|
60956
|
+
}
|
|
60957
|
+
return AST8.commentBlock(commentContent, true);
|
|
60958
|
+
}
|
|
60959
|
+
|
|
60960
|
+
// src/codegen/generators/typescript/inlineType.ts
|
|
61179
60961
|
var AST9 = recast9.types.builders;
|
|
61180
60962
|
var fragmentKey2 = " $fragments";
|
|
61181
60963
|
function inlineType({
|
|
@@ -61196,7 +60978,7 @@ function inlineType({
|
|
|
61196
60978
|
const { type, wrappers } = unwrapType(config, rootType);
|
|
61197
60979
|
let result;
|
|
61198
60980
|
let forceNullable = false;
|
|
61199
|
-
if (
|
|
60981
|
+
if (graphql19.isScalarType(type)) {
|
|
61200
60982
|
result = scalarPropertyValue(
|
|
61201
60983
|
config,
|
|
61202
60984
|
filepath,
|
|
@@ -61205,7 +60987,7 @@ function inlineType({
|
|
|
61205
60987
|
body,
|
|
61206
60988
|
field
|
|
61207
60989
|
);
|
|
61208
|
-
} else if (
|
|
60990
|
+
} else if (graphql19.isEnumType(type)) {
|
|
61209
60991
|
ensureImports({
|
|
61210
60992
|
config,
|
|
61211
60993
|
body,
|
|
@@ -61230,11 +61012,11 @@ function inlineType({
|
|
|
61230
61012
|
for (const selection of selections) {
|
|
61231
61013
|
if (selection.kind === "InlineFragment" && selection.typeCondition) {
|
|
61232
61014
|
const fragmentType = config.schema.getType(selection.typeCondition.name.value);
|
|
61233
|
-
if (!
|
|
61015
|
+
if (!graphql19.isInterfaceType(type) && !graphql19.isUnionType(type)) {
|
|
61234
61016
|
selectedFields.push(...selection.selectionSet.selections);
|
|
61235
61017
|
continue;
|
|
61236
61018
|
}
|
|
61237
|
-
if (!
|
|
61019
|
+
if (!graphql19.isInterfaceType(fragmentType) && !graphql19.isUnionType(fragmentType)) {
|
|
61238
61020
|
if (!inlineFragments[fragmentType.name]) {
|
|
61239
61021
|
inlineFragments[fragmentType.name] = [];
|
|
61240
61022
|
}
|
|
@@ -61326,6 +61108,11 @@ function inlineType({
|
|
|
61326
61108
|
if (allOptional) {
|
|
61327
61109
|
prop.optional = true;
|
|
61328
61110
|
}
|
|
61111
|
+
if (field2.description || field2.deprecationReason) {
|
|
61112
|
+
prop.comments = [
|
|
61113
|
+
jsdocComment(field2.description ?? "", field2.deprecationReason ?? void 0)
|
|
61114
|
+
];
|
|
61115
|
+
}
|
|
61329
61116
|
return prop;
|
|
61330
61117
|
})
|
|
61331
61118
|
]);
|
|
@@ -61377,7 +61164,7 @@ function inlineType({
|
|
|
61377
61164
|
}
|
|
61378
61165
|
}
|
|
61379
61166
|
}
|
|
61380
|
-
if (objectType.type === "TSTypeLiteral" && !
|
|
61167
|
+
if (objectType.type === "TSTypeLiteral" && !graphql19.isInterfaceType(fragmentRootType) && !graphql19.isUnionType(fragmentRootType)) {
|
|
61381
61168
|
const existingTypenameIndex = objectType.members.findIndex(
|
|
61382
61169
|
(member) => member.type === "TSPropertySignature" && member.key.type === "Identifier" && member.key.name === "__typename"
|
|
61383
61170
|
);
|
|
@@ -61402,11 +61189,11 @@ function inlineType({
|
|
|
61402
61189
|
];
|
|
61403
61190
|
}
|
|
61404
61191
|
let coveredTypenames;
|
|
61405
|
-
if (
|
|
61192
|
+
if (graphql19.isInterfaceType(fragmentRootType)) {
|
|
61406
61193
|
coveredTypenames = interfaceCoveredTypenames(fragmentRootType);
|
|
61407
|
-
} else if (
|
|
61194
|
+
} else if (graphql19.isUnionType(fragmentRootType)) {
|
|
61408
61195
|
coveredTypenames = fragmentRootType.getTypes().map((type2) => type2.name);
|
|
61409
|
-
} else if (
|
|
61196
|
+
} else if (graphql19.isObjectType(fragmentRootType)) {
|
|
61410
61197
|
coveredTypenames = [fragmentRootType.name];
|
|
61411
61198
|
} else {
|
|
61412
61199
|
throw Error("unreachable code");
|
|
@@ -61442,7 +61229,7 @@ function inlineType({
|
|
|
61442
61229
|
);
|
|
61443
61230
|
}
|
|
61444
61231
|
);
|
|
61445
|
-
const parentIsUnionOrInterface = !
|
|
61232
|
+
const parentIsUnionOrInterface = !graphql19.isInterfaceType(type) && !graphql19.isUnionType(type);
|
|
61446
61233
|
const possibleTypenames = parentIsUnionOrInterface ? [parent.name] : config.schema.getPossibleTypes(type).map((type2) => type2.name);
|
|
61447
61234
|
const coveredTypenames = new Set(
|
|
61448
61235
|
Object.values(inlineFragmentSelections).flatMap((sel) => sel.coveredTypenames)
|
|
@@ -61509,7 +61296,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
61509
61296
|
},
|
|
61510
61297
|
type: schema.getType("String")
|
|
61511
61298
|
};
|
|
61512
|
-
} else if (
|
|
61299
|
+
} else if (graphql19.isNonNullType(rootType) && "getFields" in rootType.ofType) {
|
|
61513
61300
|
fields = rootType.ofType.getFields();
|
|
61514
61301
|
} else {
|
|
61515
61302
|
fields = rootType.getFields();
|
|
@@ -61521,7 +61308,7 @@ function selectionTypeInfo(schema, filepath, rootType, selection) {
|
|
|
61521
61308
|
message: `Could not find type information for field ${rootType.toString()}.${selectionName} ${field}`
|
|
61522
61309
|
});
|
|
61523
61310
|
}
|
|
61524
|
-
const fieldType =
|
|
61311
|
+
const fieldType = graphql19.getNamedType(field.type);
|
|
61525
61312
|
if (!fieldType) {
|
|
61526
61313
|
throw new HoudiniError({
|
|
61527
61314
|
filepath,
|
|
@@ -62029,7 +61816,7 @@ async function generateFragmentTypeDefs(config, filepath, body, selections, defi
|
|
|
62029
61816
|
}
|
|
62030
61817
|
|
|
62031
61818
|
// src/codegen/generators/typescript/imperativeTypeDef.ts
|
|
62032
|
-
var
|
|
61819
|
+
var graphql20 = __toESM(require("graphql"), 1);
|
|
62033
61820
|
var recast12 = __toESM(require_main2(), 1);
|
|
62034
61821
|
var AST12 = recast12.types.builders;
|
|
62035
61822
|
async function imperativeCacheTypef(config, docs) {
|
|
@@ -62081,7 +61868,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
62081
61868
|
const operationTypes = [config.schema.getMutationType(), config.schema.getSubscriptionType()].filter(Boolean).map((type) => type?.name);
|
|
62082
61869
|
const visitedTypes = /* @__PURE__ */ new Set();
|
|
62083
61870
|
const types14 = Object.values(config.schema.getTypeMap()).filter(
|
|
62084
|
-
(type) => !
|
|
61871
|
+
(type) => !graphql20.isAbstractType(type) && !graphql20.isScalarType(type) && !graphql20.isEnumType(type) && !graphql20.isInputObjectType(type) && !type.name.startsWith("__") && !operationTypes.includes(type.name)
|
|
62085
61872
|
);
|
|
62086
61873
|
const fragmentMap = fragmentListMap(
|
|
62087
61874
|
config,
|
|
@@ -62098,7 +61885,7 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
62098
61885
|
}
|
|
62099
61886
|
let idFields = AST12.tsNeverKeyword();
|
|
62100
61887
|
const keys2 = keyFieldsForType(config.configFile, type.name);
|
|
62101
|
-
if (
|
|
61888
|
+
if (graphql20.isObjectType(type) && keys2.length > 0 && keys2.every((key) => type.getFields()[key])) {
|
|
62102
61889
|
idFields = AST12.tsTypeLiteral(
|
|
62103
61890
|
keys2.map((key) => {
|
|
62104
61891
|
const fieldType = type.getFields()[key];
|
|
@@ -62125,13 +61912,13 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
62125
61912
|
idFields = AST12.tsTypeLiteral([]);
|
|
62126
61913
|
}
|
|
62127
61914
|
let fields = AST12.tsTypeLiteral([]);
|
|
62128
|
-
if (
|
|
61915
|
+
if (graphql20.isObjectType(type)) {
|
|
62129
61916
|
fields = AST12.tsTypeLiteral(
|
|
62130
61917
|
Object.entries(type.getFields()).map(
|
|
62131
61918
|
([key, fieldType]) => {
|
|
62132
61919
|
const unwrapped = unwrapType(config, fieldType.type);
|
|
62133
61920
|
let typeOptions = AST12.tsUnionType([]);
|
|
62134
|
-
if (
|
|
61921
|
+
if (graphql20.isScalarType(unwrapped.type)) {
|
|
62135
61922
|
typeOptions.types.push(
|
|
62136
61923
|
scalarPropertyValue(
|
|
62137
61924
|
config,
|
|
@@ -62145,11 +61932,11 @@ function typeDefinitions(config, filepath, body, docs, returnType) {
|
|
|
62145
61932
|
}
|
|
62146
61933
|
)
|
|
62147
61934
|
);
|
|
62148
|
-
} else if (
|
|
61935
|
+
} else if (graphql20.isEnumType(unwrapped.type)) {
|
|
62149
61936
|
typeOptions.types.push(
|
|
62150
61937
|
AST12.tsTypeReference(AST12.identifier(unwrapped.type.name))
|
|
62151
61938
|
);
|
|
62152
|
-
} else if (!
|
|
61939
|
+
} else if (!graphql20.isAbstractType(unwrapped.type)) {
|
|
62153
61940
|
typeOptions.types.push(record(unwrapped.type.name));
|
|
62154
61941
|
} else {
|
|
62155
61942
|
typeOptions.types.push(
|
|
@@ -62245,7 +62032,7 @@ function listDefinitions(config, filepath, body, docs) {
|
|
|
62245
62032
|
const lists = [];
|
|
62246
62033
|
const visitedLists = /* @__PURE__ */ new Set();
|
|
62247
62034
|
for (const doc of docs) {
|
|
62248
|
-
|
|
62035
|
+
graphql20.visit(doc.document, {
|
|
62249
62036
|
Directive(node, key, parent2, path2, ancestors) {
|
|
62250
62037
|
if (![config.listDirective, config.paginateDirective].includes(node.name.value)) {
|
|
62251
62038
|
return;
|
|
@@ -62267,7 +62054,7 @@ function listDefinitions(config, filepath, body, docs) {
|
|
|
62267
62054
|
const targetFieldDefinition = parentType.getFields()[targetField.name.value];
|
|
62268
62055
|
const { type: listType } = unwrapType(config, targetFieldDefinition.type);
|
|
62269
62056
|
const possibleTypes = [];
|
|
62270
|
-
if (
|
|
62057
|
+
if (graphql20.isAbstractType(listType)) {
|
|
62271
62058
|
possibleTypes.push(
|
|
62272
62059
|
...config.schema.getPossibleTypes(listType).map((possible) => possible.name)
|
|
62273
62060
|
);
|
|
@@ -62429,7 +62216,7 @@ async function typescriptGenerator(config, docs) {
|
|
|
62429
62216
|
}
|
|
62430
62217
|
|
|
62431
62218
|
// src/codegen/generators/persistedQueries/index.ts
|
|
62432
|
-
var
|
|
62219
|
+
var graphql21 = __toESM(require("graphql"), 1);
|
|
62433
62220
|
async function persistOutputGenerator(config, docs) {
|
|
62434
62221
|
if (!config.persistedQueriesPath.endsWith(".json")) {
|
|
62435
62222
|
throw new Error('Can write Persisted Queries only in a ".json" file.');
|
|
@@ -62439,8 +62226,8 @@ async function persistOutputGenerator(config, docs) {
|
|
|
62439
62226
|
if (!generateArtifact) {
|
|
62440
62227
|
return acc;
|
|
62441
62228
|
}
|
|
62442
|
-
let rawString =
|
|
62443
|
-
|
|
62229
|
+
let rawString = graphql21.print(
|
|
62230
|
+
graphql21.visit(document, {
|
|
62444
62231
|
Directive(node) {
|
|
62445
62232
|
if (config.isInternalDirective(node.name.value)) {
|
|
62446
62233
|
return null;
|
|
@@ -62449,7 +62236,7 @@ async function persistOutputGenerator(config, docs) {
|
|
|
62449
62236
|
})
|
|
62450
62237
|
);
|
|
62451
62238
|
const operations = document.definitions.filter(
|
|
62452
|
-
({ kind }) => kind ===
|
|
62239
|
+
({ kind }) => kind === graphql21.Kind.OPERATION_DEFINITION
|
|
62453
62240
|
);
|
|
62454
62241
|
if (operations.length > 0 && operations[0].kind === "OperationDefinition") {
|
|
62455
62242
|
if (artifact) {
|
|
@@ -62464,33 +62251,45 @@ async function persistOutputGenerator(config, docs) {
|
|
|
62464
62251
|
}
|
|
62465
62252
|
|
|
62466
62253
|
// src/codegen/generators/definitions/index.ts
|
|
62467
|
-
var
|
|
62254
|
+
var graphql23 = __toESM(require("graphql"), 1);
|
|
62468
62255
|
|
|
62469
62256
|
// src/codegen/generators/definitions/enums.ts
|
|
62470
|
-
var
|
|
62257
|
+
var graphql22 = __toESM(require("graphql"), 1);
|
|
62471
62258
|
var recast13 = __toESM(require_main2(), 1);
|
|
62472
62259
|
var AST13 = recast13.types.builders;
|
|
62473
62260
|
async function definitionsGenerator(config) {
|
|
62474
|
-
const enums =
|
|
62261
|
+
const enums = graphql22.parse(graphql22.printSchema(config.schema)).definitions.filter(
|
|
62475
62262
|
(definition) => definition.kind === "EnumTypeDefinition"
|
|
62476
62263
|
).filter((def) => !config.isInternalEnum(def));
|
|
62477
62264
|
const { code: runtimeDefinitions } = await printJS(
|
|
62478
62265
|
AST13.program(
|
|
62479
62266
|
enums.map((defn) => {
|
|
62480
62267
|
const name = defn.name.value;
|
|
62481
|
-
|
|
62268
|
+
const declaration = moduleExport(
|
|
62482
62269
|
config,
|
|
62483
62270
|
name,
|
|
62484
62271
|
AST13.objectExpression(
|
|
62485
62272
|
defn.values?.map((value) => {
|
|
62486
62273
|
const str = value.name.value;
|
|
62487
|
-
|
|
62274
|
+
const prop = AST13.objectProperty(
|
|
62488
62275
|
AST13.stringLiteral(str),
|
|
62489
62276
|
AST13.stringLiteral(str)
|
|
62490
62277
|
);
|
|
62278
|
+
const deprecationReason = value.directives?.find((d) => d.name.value === "deprecated")?.arguments?.find((a) => a.name.value === "reason")?.value?.value;
|
|
62279
|
+
if (value.description || deprecationReason)
|
|
62280
|
+
prop.comments = [
|
|
62281
|
+
jsdocComment(value.description?.value ?? "", deprecationReason)
|
|
62282
|
+
];
|
|
62283
|
+
return prop;
|
|
62491
62284
|
}) || []
|
|
62492
62285
|
)
|
|
62493
62286
|
);
|
|
62287
|
+
if (defn.description) {
|
|
62288
|
+
declaration.comments = [
|
|
62289
|
+
AST13.commentBlock(`* ${defn.description.value} `, true, false)
|
|
62290
|
+
];
|
|
62291
|
+
}
|
|
62292
|
+
return declaration;
|
|
62494
62293
|
})
|
|
62495
62294
|
)
|
|
62496
62295
|
);
|
|
@@ -62499,11 +62298,19 @@ type ValuesOf<T> = T[keyof T]
|
|
|
62499
62298
|
` + enums.sort((a, b) => a.name.value.localeCompare(b.name.value)).map((definition) => {
|
|
62500
62299
|
const name = definition.name.value;
|
|
62501
62300
|
const values = definition.values;
|
|
62502
|
-
|
|
62301
|
+
let jsdoc = "";
|
|
62302
|
+
if (definition.description) {
|
|
62303
|
+
jsdoc = `
|
|
62304
|
+
/** ${definition.description.value} */`;
|
|
62305
|
+
}
|
|
62306
|
+
return `${jsdoc}
|
|
62503
62307
|
export declare const ${name}: {
|
|
62504
|
-
${values?.map(
|
|
62308
|
+
${values?.map(
|
|
62309
|
+
(value) => (value.description ? ` /** ${value.description.value} */
|
|
62310
|
+
` : "") + ` readonly ${value.name.value}: "${value.name.value}";`
|
|
62311
|
+
).join("\n")}
|
|
62505
62312
|
}
|
|
62506
|
-
|
|
62313
|
+
${jsdoc}
|
|
62507
62314
|
export type ${name}$options = ValuesOf<typeof ${name}>
|
|
62508
62315
|
`;
|
|
62509
62316
|
}).join("");
|
|
@@ -62523,7 +62330,7 @@ async function schemaGenerator(config) {
|
|
|
62523
62330
|
await Promise.all([
|
|
62524
62331
|
fs_exports.writeFile(
|
|
62525
62332
|
config.definitionsSchemaPath,
|
|
62526
|
-
config.localSchema ?
|
|
62333
|
+
config.localSchema ? graphql23.printSchema(config.schema) : config.newSchema
|
|
62527
62334
|
),
|
|
62528
62335
|
fs_exports.writeFile(config.definitionsDocumentsPath, config.newDocuments),
|
|
62529
62336
|
definitionsGenerator(config)
|
|
@@ -62568,7 +62375,7 @@ async function writeIndexFile2(config, docs) {
|
|
|
62568
62375
|
}
|
|
62569
62376
|
|
|
62570
62377
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/helpers.js
|
|
62571
|
-
var
|
|
62378
|
+
var import_graphql3 = require("graphql");
|
|
62572
62379
|
function compareStrings(a, b) {
|
|
62573
62380
|
if (String(a) < String(b)) {
|
|
62574
62381
|
return -1;
|
|
@@ -62604,7 +62411,7 @@ function isSome(input) {
|
|
|
62604
62411
|
}
|
|
62605
62412
|
|
|
62606
62413
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/inspect.js
|
|
62607
|
-
var
|
|
62414
|
+
var import_graphql4 = require("graphql");
|
|
62608
62415
|
var MAX_RECURSIVE_DEPTH = 3;
|
|
62609
62416
|
function inspect(value) {
|
|
62610
62417
|
return formatValue(value, []);
|
|
@@ -62622,7 +62429,7 @@ function formatValue(value, seenValues) {
|
|
|
62622
62429
|
}
|
|
62623
62430
|
}
|
|
62624
62431
|
function formatError(value) {
|
|
62625
|
-
if (value instanceof
|
|
62432
|
+
if (value instanceof import_graphql4.GraphQLError) {
|
|
62626
62433
|
return value.toString();
|
|
62627
62434
|
}
|
|
62628
62435
|
return `${value.name}: ${value.message};
|
|
@@ -62705,43 +62512,43 @@ function getDirectivesInExtensions(node, pathToDirectivesInExtensions = ["direct
|
|
|
62705
62512
|
}
|
|
62706
62513
|
|
|
62707
62514
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/print-schema-with-directives.js
|
|
62708
|
-
var
|
|
62515
|
+
var import_graphql8 = require("graphql");
|
|
62709
62516
|
|
|
62710
62517
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromType.js
|
|
62711
|
-
var
|
|
62518
|
+
var import_graphql5 = require("graphql");
|
|
62712
62519
|
function astFromType(type) {
|
|
62713
|
-
if ((0,
|
|
62520
|
+
if ((0, import_graphql5.isNonNullType)(type)) {
|
|
62714
62521
|
const innerType = astFromType(type.ofType);
|
|
62715
|
-
if (innerType.kind ===
|
|
62522
|
+
if (innerType.kind === import_graphql5.Kind.NON_NULL_TYPE) {
|
|
62716
62523
|
throw new Error(`Invalid type node ${inspect(type)}. Inner type of non-null type cannot be a non-null type.`);
|
|
62717
62524
|
}
|
|
62718
62525
|
return {
|
|
62719
|
-
kind:
|
|
62526
|
+
kind: import_graphql5.Kind.NON_NULL_TYPE,
|
|
62720
62527
|
type: innerType
|
|
62721
62528
|
};
|
|
62722
|
-
} else if ((0,
|
|
62529
|
+
} else if ((0, import_graphql5.isListType)(type)) {
|
|
62723
62530
|
return {
|
|
62724
|
-
kind:
|
|
62531
|
+
kind: import_graphql5.Kind.LIST_TYPE,
|
|
62725
62532
|
type: astFromType(type.ofType)
|
|
62726
62533
|
};
|
|
62727
62534
|
}
|
|
62728
62535
|
return {
|
|
62729
|
-
kind:
|
|
62536
|
+
kind: import_graphql5.Kind.NAMED_TYPE,
|
|
62730
62537
|
name: {
|
|
62731
|
-
kind:
|
|
62538
|
+
kind: import_graphql5.Kind.NAME,
|
|
62732
62539
|
value: type.name
|
|
62733
62540
|
}
|
|
62734
62541
|
};
|
|
62735
62542
|
}
|
|
62736
62543
|
|
|
62737
62544
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
|
|
62738
|
-
var
|
|
62545
|
+
var import_graphql7 = require("graphql");
|
|
62739
62546
|
|
|
62740
62547
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValueUntyped.js
|
|
62741
|
-
var
|
|
62548
|
+
var import_graphql6 = require("graphql");
|
|
62742
62549
|
function astFromValueUntyped(value) {
|
|
62743
62550
|
if (value === null) {
|
|
62744
|
-
return { kind:
|
|
62551
|
+
return { kind: import_graphql6.Kind.NULL };
|
|
62745
62552
|
}
|
|
62746
62553
|
if (value === void 0) {
|
|
62747
62554
|
return null;
|
|
@@ -62754,7 +62561,7 @@ function astFromValueUntyped(value) {
|
|
|
62754
62561
|
valuesNodes.push(itemNode);
|
|
62755
62562
|
}
|
|
62756
62563
|
}
|
|
62757
|
-
return { kind:
|
|
62564
|
+
return { kind: import_graphql6.Kind.LIST, values: valuesNodes };
|
|
62758
62565
|
}
|
|
62759
62566
|
if (typeof value === "object") {
|
|
62760
62567
|
const fieldNodes = [];
|
|
@@ -62763,26 +62570,26 @@ function astFromValueUntyped(value) {
|
|
|
62763
62570
|
const ast = astFromValueUntyped(fieldValue);
|
|
62764
62571
|
if (ast) {
|
|
62765
62572
|
fieldNodes.push({
|
|
62766
|
-
kind:
|
|
62767
|
-
name: { kind:
|
|
62573
|
+
kind: import_graphql6.Kind.OBJECT_FIELD,
|
|
62574
|
+
name: { kind: import_graphql6.Kind.NAME, value: fieldName },
|
|
62768
62575
|
value: ast
|
|
62769
62576
|
});
|
|
62770
62577
|
}
|
|
62771
62578
|
}
|
|
62772
|
-
return { kind:
|
|
62579
|
+
return { kind: import_graphql6.Kind.OBJECT, fields: fieldNodes };
|
|
62773
62580
|
}
|
|
62774
62581
|
if (typeof value === "boolean") {
|
|
62775
|
-
return { kind:
|
|
62582
|
+
return { kind: import_graphql6.Kind.BOOLEAN, value };
|
|
62776
62583
|
}
|
|
62777
62584
|
if (typeof value === "bigint") {
|
|
62778
|
-
return { kind:
|
|
62585
|
+
return { kind: import_graphql6.Kind.INT, value: String(value) };
|
|
62779
62586
|
}
|
|
62780
62587
|
if (typeof value === "number" && isFinite(value)) {
|
|
62781
62588
|
const stringNum = String(value);
|
|
62782
|
-
return integerStringRegExp.test(stringNum) ? { kind:
|
|
62589
|
+
return integerStringRegExp.test(stringNum) ? { kind: import_graphql6.Kind.INT, value: stringNum } : { kind: import_graphql6.Kind.FLOAT, value: stringNum };
|
|
62783
62590
|
}
|
|
62784
62591
|
if (typeof value === "string") {
|
|
62785
|
-
return { kind:
|
|
62592
|
+
return { kind: import_graphql6.Kind.STRING, value };
|
|
62786
62593
|
}
|
|
62787
62594
|
throw new TypeError(`Cannot convert value to AST: ${value}.`);
|
|
62788
62595
|
}
|
|
@@ -62790,20 +62597,20 @@ var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;
|
|
|
62790
62597
|
|
|
62791
62598
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/astFromValue.js
|
|
62792
62599
|
function astFromValue(value, type) {
|
|
62793
|
-
if ((0,
|
|
62600
|
+
if ((0, import_graphql7.isNonNullType)(type)) {
|
|
62794
62601
|
const astValue = astFromValue(value, type.ofType);
|
|
62795
|
-
if (astValue?.kind ===
|
|
62602
|
+
if (astValue?.kind === import_graphql7.Kind.NULL) {
|
|
62796
62603
|
return null;
|
|
62797
62604
|
}
|
|
62798
62605
|
return astValue;
|
|
62799
62606
|
}
|
|
62800
62607
|
if (value === null) {
|
|
62801
|
-
return { kind:
|
|
62608
|
+
return { kind: import_graphql7.Kind.NULL };
|
|
62802
62609
|
}
|
|
62803
62610
|
if (value === void 0) {
|
|
62804
62611
|
return null;
|
|
62805
62612
|
}
|
|
62806
|
-
if ((0,
|
|
62613
|
+
if ((0, import_graphql7.isListType)(type)) {
|
|
62807
62614
|
const itemType = type.ofType;
|
|
62808
62615
|
if (isIterableObject(value)) {
|
|
62809
62616
|
const valuesNodes = [];
|
|
@@ -62813,11 +62620,11 @@ function astFromValue(value, type) {
|
|
|
62813
62620
|
valuesNodes.push(itemNode);
|
|
62814
62621
|
}
|
|
62815
62622
|
}
|
|
62816
|
-
return { kind:
|
|
62623
|
+
return { kind: import_graphql7.Kind.LIST, values: valuesNodes };
|
|
62817
62624
|
}
|
|
62818
62625
|
return astFromValue(value, itemType);
|
|
62819
62626
|
}
|
|
62820
|
-
if ((0,
|
|
62627
|
+
if ((0, import_graphql7.isInputObjectType)(type)) {
|
|
62821
62628
|
if (!isObjectLike(value)) {
|
|
62822
62629
|
return null;
|
|
62823
62630
|
}
|
|
@@ -62826,24 +62633,24 @@ function astFromValue(value, type) {
|
|
|
62826
62633
|
const fieldValue = astFromValue(value[field.name], field.type);
|
|
62827
62634
|
if (fieldValue) {
|
|
62828
62635
|
fieldNodes.push({
|
|
62829
|
-
kind:
|
|
62830
|
-
name: { kind:
|
|
62636
|
+
kind: import_graphql7.Kind.OBJECT_FIELD,
|
|
62637
|
+
name: { kind: import_graphql7.Kind.NAME, value: field.name },
|
|
62831
62638
|
value: fieldValue
|
|
62832
62639
|
});
|
|
62833
62640
|
}
|
|
62834
62641
|
}
|
|
62835
|
-
return { kind:
|
|
62642
|
+
return { kind: import_graphql7.Kind.OBJECT, fields: fieldNodes };
|
|
62836
62643
|
}
|
|
62837
|
-
if ((0,
|
|
62644
|
+
if ((0, import_graphql7.isLeafType)(type)) {
|
|
62838
62645
|
const serialized = type.serialize(value);
|
|
62839
62646
|
if (serialized == null) {
|
|
62840
62647
|
return null;
|
|
62841
62648
|
}
|
|
62842
|
-
if ((0,
|
|
62843
|
-
return { kind:
|
|
62649
|
+
if ((0, import_graphql7.isEnumType)(type)) {
|
|
62650
|
+
return { kind: import_graphql7.Kind.ENUM, value: serialized };
|
|
62844
62651
|
}
|
|
62845
62652
|
if (type.name === "ID" && typeof serialized === "string" && integerStringRegExp2.test(serialized)) {
|
|
62846
|
-
return { kind:
|
|
62653
|
+
return { kind: import_graphql7.Kind.INT, value: serialized };
|
|
62847
62654
|
}
|
|
62848
62655
|
return astFromValueUntyped(serialized);
|
|
62849
62656
|
}
|
|
@@ -62899,36 +62706,36 @@ function getDocumentNodeFromSchema(schema, options = {}) {
|
|
|
62899
62706
|
const definitions = schemaNode != null ? [schemaNode] : [];
|
|
62900
62707
|
const directives = schema.getDirectives();
|
|
62901
62708
|
for (const directive of directives) {
|
|
62902
|
-
if ((0,
|
|
62709
|
+
if ((0, import_graphql8.isSpecifiedDirective)(directive)) {
|
|
62903
62710
|
continue;
|
|
62904
62711
|
}
|
|
62905
62712
|
definitions.push(astFromDirective(directive, schema, pathToDirectivesInExtensions));
|
|
62906
62713
|
}
|
|
62907
62714
|
for (const typeName in typesMap) {
|
|
62908
62715
|
const type = typesMap[typeName];
|
|
62909
|
-
const isPredefinedScalar = (0,
|
|
62910
|
-
const isIntrospection = (0,
|
|
62716
|
+
const isPredefinedScalar = (0, import_graphql8.isSpecifiedScalarType)(type);
|
|
62717
|
+
const isIntrospection = (0, import_graphql8.isIntrospectionType)(type);
|
|
62911
62718
|
if (isPredefinedScalar || isIntrospection) {
|
|
62912
62719
|
continue;
|
|
62913
62720
|
}
|
|
62914
|
-
if ((0,
|
|
62721
|
+
if ((0, import_graphql8.isObjectType)(type)) {
|
|
62915
62722
|
definitions.push(astFromObjectType(type, schema, pathToDirectivesInExtensions));
|
|
62916
|
-
} else if ((0,
|
|
62723
|
+
} else if ((0, import_graphql8.isInterfaceType)(type)) {
|
|
62917
62724
|
definitions.push(astFromInterfaceType(type, schema, pathToDirectivesInExtensions));
|
|
62918
|
-
} else if ((0,
|
|
62725
|
+
} else if ((0, import_graphql8.isUnionType)(type)) {
|
|
62919
62726
|
definitions.push(astFromUnionType(type, schema, pathToDirectivesInExtensions));
|
|
62920
|
-
} else if ((0,
|
|
62727
|
+
} else if ((0, import_graphql8.isInputObjectType)(type)) {
|
|
62921
62728
|
definitions.push(astFromInputObjectType(type, schema, pathToDirectivesInExtensions));
|
|
62922
|
-
} else if ((0,
|
|
62729
|
+
} else if ((0, import_graphql8.isEnumType)(type)) {
|
|
62923
62730
|
definitions.push(astFromEnumType(type, schema, pathToDirectivesInExtensions));
|
|
62924
|
-
} else if ((0,
|
|
62731
|
+
} else if ((0, import_graphql8.isScalarType)(type)) {
|
|
62925
62732
|
definitions.push(astFromScalarType(type, schema, pathToDirectivesInExtensions));
|
|
62926
62733
|
} else {
|
|
62927
62734
|
throw new Error(`Unknown type ${type}.`);
|
|
62928
62735
|
}
|
|
62929
62736
|
}
|
|
62930
62737
|
return {
|
|
62931
|
-
kind:
|
|
62738
|
+
kind: import_graphql8.Kind.DOCUMENT,
|
|
62932
62739
|
definitions
|
|
62933
62740
|
};
|
|
62934
62741
|
}
|
|
@@ -62963,7 +62770,7 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
|
|
|
62963
62770
|
operationTypeDefinitionNode.type = rootTypeAST;
|
|
62964
62771
|
} else {
|
|
62965
62772
|
operationTypeMap.set(operationTypeNode, {
|
|
62966
|
-
kind:
|
|
62773
|
+
kind: import_graphql8.Kind.OPERATION_TYPE_DEFINITION,
|
|
62967
62774
|
operation: operationTypeNode,
|
|
62968
62775
|
type: rootTypeAST
|
|
62969
62776
|
});
|
|
@@ -62976,12 +62783,12 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
|
|
|
62976
62783
|
return null;
|
|
62977
62784
|
}
|
|
62978
62785
|
const schemaNode = {
|
|
62979
|
-
kind: operationTypes != null ?
|
|
62786
|
+
kind: operationTypes != null ? import_graphql8.Kind.SCHEMA_DEFINITION : import_graphql8.Kind.SCHEMA_EXTENSION,
|
|
62980
62787
|
operationTypes,
|
|
62981
62788
|
directives
|
|
62982
62789
|
};
|
|
62983
62790
|
schemaNode.description = schema.astNode?.description ?? schema.description != null ? {
|
|
62984
|
-
kind:
|
|
62791
|
+
kind: import_graphql8.Kind.STRING,
|
|
62985
62792
|
value: schema.description,
|
|
62986
62793
|
block: true
|
|
62987
62794
|
} : void 0;
|
|
@@ -62989,19 +62796,19 @@ function astFromSchema(schema, pathToDirectivesInExtensions) {
|
|
|
62989
62796
|
}
|
|
62990
62797
|
function astFromDirective(directive, schema, pathToDirectivesInExtensions) {
|
|
62991
62798
|
return {
|
|
62992
|
-
kind:
|
|
62799
|
+
kind: import_graphql8.Kind.DIRECTIVE_DEFINITION,
|
|
62993
62800
|
description: directive.astNode?.description ?? (directive.description ? {
|
|
62994
|
-
kind:
|
|
62801
|
+
kind: import_graphql8.Kind.STRING,
|
|
62995
62802
|
value: directive.description
|
|
62996
62803
|
} : void 0),
|
|
62997
62804
|
name: {
|
|
62998
|
-
kind:
|
|
62805
|
+
kind: import_graphql8.Kind.NAME,
|
|
62999
62806
|
value: directive.name
|
|
63000
62807
|
},
|
|
63001
62808
|
arguments: directive.args?.map((arg) => astFromArg(arg, schema, pathToDirectivesInExtensions)),
|
|
63002
62809
|
repeatable: directive.isRepeatable,
|
|
63003
62810
|
locations: directive.locations?.map((location) => ({
|
|
63004
|
-
kind:
|
|
62811
|
+
kind: import_graphql8.Kind.NAME,
|
|
63005
62812
|
value: location
|
|
63006
62813
|
})) || []
|
|
63007
62814
|
};
|
|
@@ -63051,14 +62858,14 @@ function getDeprecatableDirectiveNodes(entity, schema, pathToDirectivesInExtensi
|
|
|
63051
62858
|
}
|
|
63052
62859
|
function astFromArg(arg, schema, pathToDirectivesInExtensions) {
|
|
63053
62860
|
return {
|
|
63054
|
-
kind:
|
|
62861
|
+
kind: import_graphql8.Kind.INPUT_VALUE_DEFINITION,
|
|
63055
62862
|
description: arg.astNode?.description ?? (arg.description ? {
|
|
63056
|
-
kind:
|
|
62863
|
+
kind: import_graphql8.Kind.STRING,
|
|
63057
62864
|
value: arg.description,
|
|
63058
62865
|
block: true
|
|
63059
62866
|
} : void 0),
|
|
63060
62867
|
name: {
|
|
63061
|
-
kind:
|
|
62868
|
+
kind: import_graphql8.Kind.NAME,
|
|
63062
62869
|
value: arg.name
|
|
63063
62870
|
},
|
|
63064
62871
|
type: astFromType(arg.type),
|
|
@@ -63068,14 +62875,14 @@ function astFromArg(arg, schema, pathToDirectivesInExtensions) {
|
|
|
63068
62875
|
}
|
|
63069
62876
|
function astFromObjectType(type, schema, pathToDirectivesInExtensions) {
|
|
63070
62877
|
return {
|
|
63071
|
-
kind:
|
|
62878
|
+
kind: import_graphql8.Kind.OBJECT_TYPE_DEFINITION,
|
|
63072
62879
|
description: type.astNode?.description ?? (type.description ? {
|
|
63073
|
-
kind:
|
|
62880
|
+
kind: import_graphql8.Kind.STRING,
|
|
63074
62881
|
value: type.description,
|
|
63075
62882
|
block: true
|
|
63076
62883
|
} : void 0),
|
|
63077
62884
|
name: {
|
|
63078
|
-
kind:
|
|
62885
|
+
kind: import_graphql8.Kind.NAME,
|
|
63079
62886
|
value: type.name
|
|
63080
62887
|
},
|
|
63081
62888
|
fields: Object.values(type.getFields()).map((field) => astFromField(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -63085,14 +62892,14 @@ function astFromObjectType(type, schema, pathToDirectivesInExtensions) {
|
|
|
63085
62892
|
}
|
|
63086
62893
|
function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) {
|
|
63087
62894
|
const node = {
|
|
63088
|
-
kind:
|
|
62895
|
+
kind: import_graphql8.Kind.INTERFACE_TYPE_DEFINITION,
|
|
63089
62896
|
description: type.astNode?.description ?? (type.description ? {
|
|
63090
|
-
kind:
|
|
62897
|
+
kind: import_graphql8.Kind.STRING,
|
|
63091
62898
|
value: type.description,
|
|
63092
62899
|
block: true
|
|
63093
62900
|
} : void 0),
|
|
63094
62901
|
name: {
|
|
63095
|
-
kind:
|
|
62902
|
+
kind: import_graphql8.Kind.NAME,
|
|
63096
62903
|
value: type.name
|
|
63097
62904
|
},
|
|
63098
62905
|
fields: Object.values(type.getFields()).map((field) => astFromField(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -63105,14 +62912,14 @@ function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) {
|
|
|
63105
62912
|
}
|
|
63106
62913
|
function astFromUnionType(type, schema, pathToDirectivesInExtensions) {
|
|
63107
62914
|
return {
|
|
63108
|
-
kind:
|
|
62915
|
+
kind: import_graphql8.Kind.UNION_TYPE_DEFINITION,
|
|
63109
62916
|
description: type.astNode?.description ?? (type.description ? {
|
|
63110
|
-
kind:
|
|
62917
|
+
kind: import_graphql8.Kind.STRING,
|
|
63111
62918
|
value: type.description,
|
|
63112
62919
|
block: true
|
|
63113
62920
|
} : void 0),
|
|
63114
62921
|
name: {
|
|
63115
|
-
kind:
|
|
62922
|
+
kind: import_graphql8.Kind.NAME,
|
|
63116
62923
|
value: type.name
|
|
63117
62924
|
},
|
|
63118
62925
|
directives: getDirectiveNodes(type, schema, pathToDirectivesInExtensions),
|
|
@@ -63121,14 +62928,14 @@ function astFromUnionType(type, schema, pathToDirectivesInExtensions) {
|
|
|
63121
62928
|
}
|
|
63122
62929
|
function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) {
|
|
63123
62930
|
return {
|
|
63124
|
-
kind:
|
|
62931
|
+
kind: import_graphql8.Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
63125
62932
|
description: type.astNode?.description ?? (type.description ? {
|
|
63126
|
-
kind:
|
|
62933
|
+
kind: import_graphql8.Kind.STRING,
|
|
63127
62934
|
value: type.description,
|
|
63128
62935
|
block: true
|
|
63129
62936
|
} : void 0),
|
|
63130
62937
|
name: {
|
|
63131
|
-
kind:
|
|
62938
|
+
kind: import_graphql8.Kind.NAME,
|
|
63132
62939
|
value: type.name
|
|
63133
62940
|
},
|
|
63134
62941
|
fields: Object.values(type.getFields()).map((field) => astFromInputField(field, schema, pathToDirectivesInExtensions)),
|
|
@@ -63137,14 +62944,14 @@ function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) {
|
|
|
63137
62944
|
}
|
|
63138
62945
|
function astFromEnumType(type, schema, pathToDirectivesInExtensions) {
|
|
63139
62946
|
return {
|
|
63140
|
-
kind:
|
|
62947
|
+
kind: import_graphql8.Kind.ENUM_TYPE_DEFINITION,
|
|
63141
62948
|
description: type.astNode?.description ?? (type.description ? {
|
|
63142
|
-
kind:
|
|
62949
|
+
kind: import_graphql8.Kind.STRING,
|
|
63143
62950
|
value: type.description,
|
|
63144
62951
|
block: true
|
|
63145
62952
|
} : void 0),
|
|
63146
62953
|
name: {
|
|
63147
|
-
kind:
|
|
62954
|
+
kind: import_graphql8.Kind.NAME,
|
|
63148
62955
|
value: type.name
|
|
63149
62956
|
},
|
|
63150
62957
|
values: Object.values(type.getValues()).map((value) => astFromEnumValue(value, schema, pathToDirectivesInExtensions)),
|
|
@@ -63162,14 +62969,14 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
|
|
|
63162
62969
|
directives.push(makeDirectiveNode("specifiedBy", specifiedByArgs));
|
|
63163
62970
|
}
|
|
63164
62971
|
return {
|
|
63165
|
-
kind:
|
|
62972
|
+
kind: import_graphql8.Kind.SCALAR_TYPE_DEFINITION,
|
|
63166
62973
|
description: type.astNode?.description ?? (type.description ? {
|
|
63167
|
-
kind:
|
|
62974
|
+
kind: import_graphql8.Kind.STRING,
|
|
63168
62975
|
value: type.description,
|
|
63169
62976
|
block: true
|
|
63170
62977
|
} : void 0),
|
|
63171
62978
|
name: {
|
|
63172
|
-
kind:
|
|
62979
|
+
kind: import_graphql8.Kind.NAME,
|
|
63173
62980
|
value: type.name
|
|
63174
62981
|
},
|
|
63175
62982
|
directives
|
|
@@ -63177,14 +62984,14 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
|
|
|
63177
62984
|
}
|
|
63178
62985
|
function astFromField(field, schema, pathToDirectivesInExtensions) {
|
|
63179
62986
|
return {
|
|
63180
|
-
kind:
|
|
62987
|
+
kind: import_graphql8.Kind.FIELD_DEFINITION,
|
|
63181
62988
|
description: field.astNode?.description ?? (field.description ? {
|
|
63182
|
-
kind:
|
|
62989
|
+
kind: import_graphql8.Kind.STRING,
|
|
63183
62990
|
value: field.description,
|
|
63184
62991
|
block: true
|
|
63185
62992
|
} : void 0),
|
|
63186
62993
|
name: {
|
|
63187
|
-
kind:
|
|
62994
|
+
kind: import_graphql8.Kind.NAME,
|
|
63188
62995
|
value: field.name
|
|
63189
62996
|
},
|
|
63190
62997
|
arguments: field.args.map((arg) => astFromArg(arg, schema, pathToDirectivesInExtensions)),
|
|
@@ -63194,14 +63001,14 @@ function astFromField(field, schema, pathToDirectivesInExtensions) {
|
|
|
63194
63001
|
}
|
|
63195
63002
|
function astFromInputField(field, schema, pathToDirectivesInExtensions) {
|
|
63196
63003
|
return {
|
|
63197
|
-
kind:
|
|
63004
|
+
kind: import_graphql8.Kind.INPUT_VALUE_DEFINITION,
|
|
63198
63005
|
description: field.astNode?.description ?? (field.description ? {
|
|
63199
|
-
kind:
|
|
63006
|
+
kind: import_graphql8.Kind.STRING,
|
|
63200
63007
|
value: field.description,
|
|
63201
63008
|
block: true
|
|
63202
63009
|
} : void 0),
|
|
63203
63010
|
name: {
|
|
63204
|
-
kind:
|
|
63011
|
+
kind: import_graphql8.Kind.NAME,
|
|
63205
63012
|
value: field.name
|
|
63206
63013
|
},
|
|
63207
63014
|
type: astFromType(field.type),
|
|
@@ -63211,21 +63018,21 @@ function astFromInputField(field, schema, pathToDirectivesInExtensions) {
|
|
|
63211
63018
|
}
|
|
63212
63019
|
function astFromEnumValue(value, schema, pathToDirectivesInExtensions) {
|
|
63213
63020
|
return {
|
|
63214
|
-
kind:
|
|
63021
|
+
kind: import_graphql8.Kind.ENUM_VALUE_DEFINITION,
|
|
63215
63022
|
description: value.astNode?.description ?? (value.description ? {
|
|
63216
|
-
kind:
|
|
63023
|
+
kind: import_graphql8.Kind.STRING,
|
|
63217
63024
|
value: value.description,
|
|
63218
63025
|
block: true
|
|
63219
63026
|
} : void 0),
|
|
63220
63027
|
name: {
|
|
63221
|
-
kind:
|
|
63028
|
+
kind: import_graphql8.Kind.NAME,
|
|
63222
63029
|
value: value.name
|
|
63223
63030
|
},
|
|
63224
63031
|
directives: getDeprecatableDirectiveNodes(value, schema, pathToDirectivesInExtensions)
|
|
63225
63032
|
};
|
|
63226
63033
|
}
|
|
63227
63034
|
function makeDeprecatedDirective(deprecationReason) {
|
|
63228
|
-
return makeDirectiveNode("deprecated", { reason: deprecationReason },
|
|
63035
|
+
return makeDirectiveNode("deprecated", { reason: deprecationReason }, import_graphql8.GraphQLDeprecatedDirective);
|
|
63229
63036
|
}
|
|
63230
63037
|
function makeDirectiveNode(name, args, directive) {
|
|
63231
63038
|
const directiveArguments = [];
|
|
@@ -63237,9 +63044,9 @@ function makeDirectiveNode(name, args, directive) {
|
|
|
63237
63044
|
const value = astFromValue(argValue, arg.type);
|
|
63238
63045
|
if (value) {
|
|
63239
63046
|
directiveArguments.push({
|
|
63240
|
-
kind:
|
|
63047
|
+
kind: import_graphql8.Kind.ARGUMENT,
|
|
63241
63048
|
name: {
|
|
63242
|
-
kind:
|
|
63049
|
+
kind: import_graphql8.Kind.NAME,
|
|
63243
63050
|
value: argName
|
|
63244
63051
|
},
|
|
63245
63052
|
value
|
|
@@ -63253,9 +63060,9 @@ function makeDirectiveNode(name, args, directive) {
|
|
|
63253
63060
|
const value = astFromValueUntyped(argValue);
|
|
63254
63061
|
if (value) {
|
|
63255
63062
|
directiveArguments.push({
|
|
63256
|
-
kind:
|
|
63063
|
+
kind: import_graphql8.Kind.ARGUMENT,
|
|
63257
63064
|
name: {
|
|
63258
|
-
kind:
|
|
63065
|
+
kind: import_graphql8.Kind.NAME,
|
|
63259
63066
|
value: argName
|
|
63260
63067
|
},
|
|
63261
63068
|
value
|
|
@@ -63264,9 +63071,9 @@ function makeDirectiveNode(name, args, directive) {
|
|
|
63264
63071
|
}
|
|
63265
63072
|
}
|
|
63266
63073
|
return {
|
|
63267
|
-
kind:
|
|
63074
|
+
kind: import_graphql8.Kind.DIRECTIVE,
|
|
63268
63075
|
name: {
|
|
63269
|
-
kind:
|
|
63076
|
+
kind: import_graphql8.Kind.NAME,
|
|
63270
63077
|
value: name
|
|
63271
63078
|
},
|
|
63272
63079
|
arguments: directiveArguments
|
|
@@ -63289,7 +63096,7 @@ function makeDirectiveNodes(schema, directiveValues) {
|
|
|
63289
63096
|
}
|
|
63290
63097
|
|
|
63291
63098
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/comments.js
|
|
63292
|
-
var
|
|
63099
|
+
var import_graphql9 = require("graphql");
|
|
63293
63100
|
var MAX_LINE_LENGTH = 80;
|
|
63294
63101
|
var commentsRegistry = {};
|
|
63295
63102
|
function resetComments() {
|
|
@@ -63534,7 +63341,7 @@ var printDocASTReducerWithComments = Object.keys(printDocASTReducer).reduce((pre
|
|
|
63534
63341
|
}
|
|
63535
63342
|
}), {});
|
|
63536
63343
|
function printWithComments(ast) {
|
|
63537
|
-
return (0,
|
|
63344
|
+
return (0, import_graphql9.visit)(ast, printDocASTReducerWithComments);
|
|
63538
63345
|
}
|
|
63539
63346
|
function isFieldDefinitionNode(node) {
|
|
63540
63347
|
return node.kind === "FieldDefinition";
|
|
@@ -63553,7 +63360,7 @@ function getLeadingCommentBlock(node) {
|
|
|
63553
63360
|
}
|
|
63554
63361
|
const comments = [];
|
|
63555
63362
|
let token = loc.startToken.prev;
|
|
63556
|
-
while (token != null && token.kind ===
|
|
63363
|
+
while (token != null && token.kind === import_graphql9.TokenKind.COMMENT && token.next != null && token.prev != null && token.line + 1 === token.next.line && token.line !== token.prev.line) {
|
|
63557
63364
|
const value = String(token.value);
|
|
63558
63365
|
comments.push(value);
|
|
63559
63366
|
token = token.prev;
|
|
@@ -63605,9 +63412,9 @@ function isBlank(str) {
|
|
|
63605
63412
|
}
|
|
63606
63413
|
|
|
63607
63414
|
// ../../node_modules/.pnpm/@graphql-tools+utils@10.0.6_graphql@15.5.0/node_modules/@graphql-tools/utils/esm/isDocumentNode.js
|
|
63608
|
-
var
|
|
63415
|
+
var import_graphql10 = require("graphql");
|
|
63609
63416
|
function isDocumentNode(object) {
|
|
63610
|
-
return object && typeof object === "object" && "kind" in object && object.kind ===
|
|
63417
|
+
return object && typeof object === "object" && "kind" in object && object.kind === import_graphql10.Kind.DOCUMENT;
|
|
63611
63418
|
}
|
|
63612
63419
|
|
|
63613
63420
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/arguments.js
|
|
@@ -63631,7 +63438,7 @@ function deduplicateArguments(args, config) {
|
|
|
63631
63438
|
}
|
|
63632
63439
|
|
|
63633
63440
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/directives.js
|
|
63634
|
-
var
|
|
63441
|
+
var import_graphql11 = require("graphql");
|
|
63635
63442
|
function directiveAlreadyExists(directivesArr, otherDirective) {
|
|
63636
63443
|
return !!directivesArr.find((directive) => directive.name.value === otherDirective.name.value);
|
|
63637
63444
|
}
|
|
@@ -63691,11 +63498,11 @@ function mergeDirectives(d1 = [], d2 = [], config, directives) {
|
|
|
63691
63498
|
return result;
|
|
63692
63499
|
}
|
|
63693
63500
|
function validateInputs(node, existingNode) {
|
|
63694
|
-
const printedNode = (0,
|
|
63501
|
+
const printedNode = (0, import_graphql11.print)({
|
|
63695
63502
|
...node,
|
|
63696
63503
|
description: void 0
|
|
63697
63504
|
});
|
|
63698
|
-
const printedExistingNode = (0,
|
|
63505
|
+
const printedExistingNode = (0, import_graphql11.print)({
|
|
63699
63506
|
...existingNode,
|
|
63700
63507
|
description: void 0
|
|
63701
63508
|
});
|
|
@@ -63762,7 +63569,7 @@ function mergeEnumValues(first, second, config, directives) {
|
|
|
63762
63569
|
}
|
|
63763
63570
|
|
|
63764
63571
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/enum.js
|
|
63765
|
-
var
|
|
63572
|
+
var import_graphql12 = require("graphql");
|
|
63766
63573
|
function mergeEnum(e1, e2, config, directives) {
|
|
63767
63574
|
if (e2) {
|
|
63768
63575
|
return {
|
|
@@ -63776,33 +63583,33 @@ function mergeEnum(e1, e2, config, directives) {
|
|
|
63776
63583
|
}
|
|
63777
63584
|
return config?.convertExtensions ? {
|
|
63778
63585
|
...e1,
|
|
63779
|
-
kind:
|
|
63586
|
+
kind: import_graphql12.Kind.ENUM_TYPE_DEFINITION
|
|
63780
63587
|
} : e1;
|
|
63781
63588
|
}
|
|
63782
63589
|
|
|
63783
63590
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/utils.js
|
|
63784
|
-
var
|
|
63591
|
+
var import_graphql13 = require("graphql");
|
|
63785
63592
|
function isStringTypes(types14) {
|
|
63786
63593
|
return typeof types14 === "string";
|
|
63787
63594
|
}
|
|
63788
63595
|
function isSourceTypes(types14) {
|
|
63789
|
-
return types14 instanceof
|
|
63596
|
+
return types14 instanceof import_graphql13.Source;
|
|
63790
63597
|
}
|
|
63791
63598
|
function extractType(type) {
|
|
63792
63599
|
let visitedType = type;
|
|
63793
|
-
while (visitedType.kind ===
|
|
63600
|
+
while (visitedType.kind === import_graphql13.Kind.LIST_TYPE || visitedType.kind === "NonNullType") {
|
|
63794
63601
|
visitedType = visitedType.type;
|
|
63795
63602
|
}
|
|
63796
63603
|
return visitedType;
|
|
63797
63604
|
}
|
|
63798
63605
|
function isWrappingTypeNode(type) {
|
|
63799
|
-
return type.kind !==
|
|
63606
|
+
return type.kind !== import_graphql13.Kind.NAMED_TYPE;
|
|
63800
63607
|
}
|
|
63801
63608
|
function isListTypeNode(type) {
|
|
63802
|
-
return type.kind ===
|
|
63609
|
+
return type.kind === import_graphql13.Kind.LIST_TYPE;
|
|
63803
63610
|
}
|
|
63804
63611
|
function isNonNullTypeNode(type) {
|
|
63805
|
-
return type.kind ===
|
|
63612
|
+
return type.kind === import_graphql13.Kind.NON_NULL_TYPE;
|
|
63806
63613
|
}
|
|
63807
63614
|
function printTypeNode(type) {
|
|
63808
63615
|
if (isListTypeNode(type)) {
|
|
@@ -63905,7 +63712,7 @@ function safeChangeForFieldType(oldType, newType, ignoreNullability = false) {
|
|
|
63905
63712
|
}
|
|
63906
63713
|
|
|
63907
63714
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/input-type.js
|
|
63908
|
-
var
|
|
63715
|
+
var import_graphql14 = require("graphql");
|
|
63909
63716
|
function mergeInputType(node, existingNode, config, directives) {
|
|
63910
63717
|
if (existingNode) {
|
|
63911
63718
|
try {
|
|
@@ -63923,12 +63730,12 @@ function mergeInputType(node, existingNode, config, directives) {
|
|
|
63923
63730
|
}
|
|
63924
63731
|
return config?.convertExtensions ? {
|
|
63925
63732
|
...node,
|
|
63926
|
-
kind:
|
|
63733
|
+
kind: import_graphql14.Kind.INPUT_OBJECT_TYPE_DEFINITION
|
|
63927
63734
|
} : node;
|
|
63928
63735
|
}
|
|
63929
63736
|
|
|
63930
63737
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/interface.js
|
|
63931
|
-
var
|
|
63738
|
+
var import_graphql15 = require("graphql");
|
|
63932
63739
|
|
|
63933
63740
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-named-type-array.js
|
|
63934
63741
|
function alreadyExists(arr, other) {
|
|
@@ -63961,15 +63768,15 @@ function mergeInterface(node, existingNode, config, directives) {
|
|
|
63961
63768
|
}
|
|
63962
63769
|
return config?.convertExtensions ? {
|
|
63963
63770
|
...node,
|
|
63964
|
-
kind:
|
|
63771
|
+
kind: import_graphql15.Kind.INTERFACE_TYPE_DEFINITION
|
|
63965
63772
|
} : node;
|
|
63966
63773
|
}
|
|
63967
63774
|
|
|
63968
63775
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-nodes.js
|
|
63969
|
-
var
|
|
63776
|
+
var import_graphql20 = require("graphql");
|
|
63970
63777
|
|
|
63971
63778
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/type.js
|
|
63972
|
-
var
|
|
63779
|
+
var import_graphql16 = require("graphql");
|
|
63973
63780
|
function mergeType(node, existingNode, config, directives) {
|
|
63974
63781
|
if (existingNode) {
|
|
63975
63782
|
try {
|
|
@@ -63988,12 +63795,12 @@ function mergeType(node, existingNode, config, directives) {
|
|
|
63988
63795
|
}
|
|
63989
63796
|
return config?.convertExtensions ? {
|
|
63990
63797
|
...node,
|
|
63991
|
-
kind:
|
|
63798
|
+
kind: import_graphql16.Kind.OBJECT_TYPE_DEFINITION
|
|
63992
63799
|
} : node;
|
|
63993
63800
|
}
|
|
63994
63801
|
|
|
63995
63802
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/scalar.js
|
|
63996
|
-
var
|
|
63803
|
+
var import_graphql17 = require("graphql");
|
|
63997
63804
|
function mergeScalar(node, existingNode, config, directives) {
|
|
63998
63805
|
if (existingNode) {
|
|
63999
63806
|
return {
|
|
@@ -64006,31 +63813,31 @@ function mergeScalar(node, existingNode, config, directives) {
|
|
|
64006
63813
|
}
|
|
64007
63814
|
return config?.convertExtensions ? {
|
|
64008
63815
|
...node,
|
|
64009
|
-
kind:
|
|
63816
|
+
kind: import_graphql17.Kind.SCALAR_TYPE_DEFINITION
|
|
64010
63817
|
} : node;
|
|
64011
63818
|
}
|
|
64012
63819
|
|
|
64013
63820
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/union.js
|
|
64014
|
-
var
|
|
63821
|
+
var import_graphql18 = require("graphql");
|
|
64015
63822
|
function mergeUnion(first, second, config, directives) {
|
|
64016
63823
|
if (second) {
|
|
64017
63824
|
return {
|
|
64018
63825
|
name: first.name,
|
|
64019
63826
|
description: first["description"] || second["description"],
|
|
64020
63827
|
directives: mergeDirectives(first.directives, second.directives, config, directives),
|
|
64021
|
-
kind: config?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ?
|
|
63828
|
+
kind: config?.convertExtensions || first.kind === "UnionTypeDefinition" || second.kind === "UnionTypeDefinition" ? import_graphql18.Kind.UNION_TYPE_DEFINITION : import_graphql18.Kind.UNION_TYPE_EXTENSION,
|
|
64022
63829
|
loc: first.loc,
|
|
64023
63830
|
types: mergeNamedTypeArray(first.types, second.types, config)
|
|
64024
63831
|
};
|
|
64025
63832
|
}
|
|
64026
63833
|
return config?.convertExtensions ? {
|
|
64027
63834
|
...first,
|
|
64028
|
-
kind:
|
|
63835
|
+
kind: import_graphql18.Kind.UNION_TYPE_DEFINITION
|
|
64029
63836
|
} : first;
|
|
64030
63837
|
}
|
|
64031
63838
|
|
|
64032
63839
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/schema-def.js
|
|
64033
|
-
var
|
|
63840
|
+
var import_graphql19 = require("graphql");
|
|
64034
63841
|
var DEFAULT_OPERATION_TYPE_NAME_MAP = {
|
|
64035
63842
|
query: "Query",
|
|
64036
63843
|
mutation: "Mutation",
|
|
@@ -64049,7 +63856,7 @@ function mergeOperationTypes(opNodeList = [], existingOpNodeList = []) {
|
|
|
64049
63856
|
function mergeSchemaDefs(node, existingNode, config, directives) {
|
|
64050
63857
|
if (existingNode) {
|
|
64051
63858
|
return {
|
|
64052
|
-
kind: node.kind ===
|
|
63859
|
+
kind: node.kind === import_graphql19.Kind.SCHEMA_DEFINITION || existingNode.kind === import_graphql19.Kind.SCHEMA_DEFINITION ? import_graphql19.Kind.SCHEMA_DEFINITION : import_graphql19.Kind.SCHEMA_EXTENSION,
|
|
64053
63860
|
description: node["description"] || existingNode["description"],
|
|
64054
63861
|
directives: mergeDirectives(node.directives, existingNode.directives, config, directives),
|
|
64055
63862
|
operationTypes: mergeOperationTypes(node.operationTypes, existingNode.operationTypes)
|
|
@@ -64057,7 +63864,7 @@ function mergeSchemaDefs(node, existingNode, config, directives) {
|
|
|
64057
63864
|
}
|
|
64058
63865
|
return config?.convertExtensions ? {
|
|
64059
63866
|
...node,
|
|
64060
|
-
kind:
|
|
63867
|
+
kind: import_graphql19.Kind.SCHEMA_DEFINITION
|
|
64061
63868
|
} : node;
|
|
64062
63869
|
}
|
|
64063
63870
|
|
|
@@ -64081,36 +63888,36 @@ function mergeGraphQLNodes(nodes, config, directives = {}) {
|
|
|
64081
63888
|
delete mergedResultMap[name];
|
|
64082
63889
|
} else {
|
|
64083
63890
|
switch (nodeDefinition.kind) {
|
|
64084
|
-
case
|
|
64085
|
-
case
|
|
63891
|
+
case import_graphql20.Kind.OBJECT_TYPE_DEFINITION:
|
|
63892
|
+
case import_graphql20.Kind.OBJECT_TYPE_EXTENSION:
|
|
64086
63893
|
mergedResultMap[name] = mergeType(nodeDefinition, mergedResultMap[name], config, directives);
|
|
64087
63894
|
break;
|
|
64088
|
-
case
|
|
64089
|
-
case
|
|
63895
|
+
case import_graphql20.Kind.ENUM_TYPE_DEFINITION:
|
|
63896
|
+
case import_graphql20.Kind.ENUM_TYPE_EXTENSION:
|
|
64090
63897
|
mergedResultMap[name] = mergeEnum(nodeDefinition, mergedResultMap[name], config, directives);
|
|
64091
63898
|
break;
|
|
64092
|
-
case
|
|
64093
|
-
case
|
|
63899
|
+
case import_graphql20.Kind.UNION_TYPE_DEFINITION:
|
|
63900
|
+
case import_graphql20.Kind.UNION_TYPE_EXTENSION:
|
|
64094
63901
|
mergedResultMap[name] = mergeUnion(nodeDefinition, mergedResultMap[name], config, directives);
|
|
64095
63902
|
break;
|
|
64096
|
-
case
|
|
64097
|
-
case
|
|
63903
|
+
case import_graphql20.Kind.SCALAR_TYPE_DEFINITION:
|
|
63904
|
+
case import_graphql20.Kind.SCALAR_TYPE_EXTENSION:
|
|
64098
63905
|
mergedResultMap[name] = mergeScalar(nodeDefinition, mergedResultMap[name], config, directives);
|
|
64099
63906
|
break;
|
|
64100
|
-
case
|
|
64101
|
-
case
|
|
63907
|
+
case import_graphql20.Kind.INPUT_OBJECT_TYPE_DEFINITION:
|
|
63908
|
+
case import_graphql20.Kind.INPUT_OBJECT_TYPE_EXTENSION:
|
|
64102
63909
|
mergedResultMap[name] = mergeInputType(nodeDefinition, mergedResultMap[name], config, directives);
|
|
64103
63910
|
break;
|
|
64104
|
-
case
|
|
64105
|
-
case
|
|
63911
|
+
case import_graphql20.Kind.INTERFACE_TYPE_DEFINITION:
|
|
63912
|
+
case import_graphql20.Kind.INTERFACE_TYPE_EXTENSION:
|
|
64106
63913
|
mergedResultMap[name] = mergeInterface(nodeDefinition, mergedResultMap[name], config, directives);
|
|
64107
63914
|
break;
|
|
64108
|
-
case
|
|
63915
|
+
case import_graphql20.Kind.DIRECTIVE_DEFINITION:
|
|
64109
63916
|
mergedResultMap[name] = mergeDirective(nodeDefinition, mergedResultMap[name]);
|
|
64110
63917
|
break;
|
|
64111
63918
|
}
|
|
64112
63919
|
}
|
|
64113
|
-
} else if (nodeDefinition.kind ===
|
|
63920
|
+
} else if (nodeDefinition.kind === import_graphql20.Kind.SCHEMA_DEFINITION || nodeDefinition.kind === import_graphql20.Kind.SCHEMA_EXTENSION) {
|
|
64114
63921
|
mergedResultMap[schemaDefSymbol] = mergeSchemaDefs(nodeDefinition, mergedResultMap[schemaDefSymbol], config);
|
|
64115
63922
|
}
|
|
64116
63923
|
}
|
|
@@ -64118,11 +63925,11 @@ function mergeGraphQLNodes(nodes, config, directives = {}) {
|
|
|
64118
63925
|
}
|
|
64119
63926
|
|
|
64120
63927
|
// ../../node_modules/.pnpm/@graphql-tools+merge@9.0.0_graphql@15.5.0/node_modules/@graphql-tools/merge/esm/typedefs-mergers/merge-typedefs.js
|
|
64121
|
-
var
|
|
63928
|
+
var import_graphql21 = require("graphql");
|
|
64122
63929
|
function mergeTypeDefs(typeSource, config) {
|
|
64123
63930
|
resetComments();
|
|
64124
63931
|
const doc = {
|
|
64125
|
-
kind:
|
|
63932
|
+
kind: import_graphql21.Kind.DOCUMENT,
|
|
64126
63933
|
definitions: mergeGraphQLTypes(typeSource, {
|
|
64127
63934
|
useSchemaDefinition: true,
|
|
64128
63935
|
forceSchemaDefinition: false,
|
|
@@ -64149,14 +63956,14 @@ function visitTypeSources(typeSource, options, allDirectives = [], allNodes = []
|
|
|
64149
63956
|
for (const type of typeSource) {
|
|
64150
63957
|
visitTypeSources(type, options, allDirectives, allNodes, visitedTypeSources);
|
|
64151
63958
|
}
|
|
64152
|
-
} else if ((0,
|
|
63959
|
+
} else if ((0, import_graphql21.isSchema)(typeSource)) {
|
|
64153
63960
|
const documentNode = getDocumentNodeFromSchema(typeSource, options);
|
|
64154
63961
|
visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
|
|
64155
63962
|
} else if (isStringTypes(typeSource) || isSourceTypes(typeSource)) {
|
|
64156
|
-
const documentNode = (0,
|
|
63963
|
+
const documentNode = (0, import_graphql21.parse)(typeSource, options);
|
|
64157
63964
|
visitTypeSources(documentNode.definitions, options, allDirectives, allNodes, visitedTypeSources);
|
|
64158
|
-
} else if (typeof typeSource === "object" && (0,
|
|
64159
|
-
if (typeSource.kind ===
|
|
63965
|
+
} else if (typeof typeSource === "object" && (0, import_graphql21.isDefinitionNode)(typeSource)) {
|
|
63966
|
+
if (typeSource.kind === import_graphql21.Kind.DIRECTIVE_DEFINITION) {
|
|
64160
63967
|
allDirectives.push(typeSource);
|
|
64161
63968
|
} else {
|
|
64162
63969
|
allNodes.push(typeSource);
|
|
@@ -64176,7 +63983,7 @@ function mergeGraphQLTypes(typeSource, config) {
|
|
|
64176
63983
|
const mergedNodes = mergeGraphQLNodes(allNodes, config, mergedDirectives);
|
|
64177
63984
|
if (config?.useSchemaDefinition) {
|
|
64178
63985
|
const schemaDef = mergedNodes[schemaDefSymbol] || {
|
|
64179
|
-
kind:
|
|
63986
|
+
kind: import_graphql21.Kind.SCHEMA_DEFINITION,
|
|
64180
63987
|
operationTypes: []
|
|
64181
63988
|
};
|
|
64182
63989
|
const operationTypes = schemaDef.operationTypes;
|
|
@@ -64187,9 +63994,9 @@ function mergeGraphQLTypes(typeSource, config) {
|
|
|
64187
63994
|
const existingPossibleRootType = mergedNodes[possibleRootTypeName];
|
|
64188
63995
|
if (existingPossibleRootType != null && existingPossibleRootType.name != null) {
|
|
64189
63996
|
operationTypes.push({
|
|
64190
|
-
kind:
|
|
63997
|
+
kind: import_graphql21.Kind.OPERATION_TYPE_DEFINITION,
|
|
64191
63998
|
type: {
|
|
64192
|
-
kind:
|
|
63999
|
+
kind: import_graphql21.Kind.NAMED_TYPE,
|
|
64193
64000
|
name: existingPossibleRootType.name
|
|
64194
64001
|
},
|
|
64195
64002
|
operation: opTypeDefNodeType
|
|
@@ -64203,15 +64010,15 @@ function mergeGraphQLTypes(typeSource, config) {
|
|
|
64203
64010
|
}
|
|
64204
64011
|
if (config?.forceSchemaDefinition && !mergedNodes[schemaDefSymbol]?.operationTypes?.length) {
|
|
64205
64012
|
mergedNodes[schemaDefSymbol] = {
|
|
64206
|
-
kind:
|
|
64013
|
+
kind: import_graphql21.Kind.SCHEMA_DEFINITION,
|
|
64207
64014
|
operationTypes: [
|
|
64208
64015
|
{
|
|
64209
|
-
kind:
|
|
64016
|
+
kind: import_graphql21.Kind.OPERATION_TYPE_DEFINITION,
|
|
64210
64017
|
operation: "query",
|
|
64211
64018
|
type: {
|
|
64212
|
-
kind:
|
|
64019
|
+
kind: import_graphql21.Kind.NAMED_TYPE,
|
|
64213
64020
|
name: {
|
|
64214
|
-
kind:
|
|
64021
|
+
kind: import_graphql21.Kind.NAME,
|
|
64215
64022
|
value: "Query"
|
|
64216
64023
|
}
|
|
64217
64024
|
}
|
|
@@ -64228,7 +64035,7 @@ function mergeGraphQLTypes(typeSource, config) {
|
|
|
64228
64035
|
}
|
|
64229
64036
|
|
|
64230
64037
|
// src/codegen/transforms/schema.ts
|
|
64231
|
-
var
|
|
64038
|
+
var graphql24 = __toESM(require("graphql"), 1);
|
|
64232
64039
|
async function graphqlExtensions(config, documents) {
|
|
64233
64040
|
let internalSchema = `
|
|
64234
64041
|
enum CachePolicy {
|
|
@@ -64351,7 +64158,7 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
|
|
|
64351
64158
|
const args = fragmentArguments(config, "", field.parent);
|
|
64352
64159
|
if (args.length > 0) {
|
|
64353
64160
|
argString = "(" + args.map((arg) => {
|
|
64354
|
-
const typeName =
|
|
64161
|
+
const typeName = graphql24.print(arg.type);
|
|
64355
64162
|
return `${arg.name}:${typeName}${arg.required ? "!" : ""}`;
|
|
64356
64163
|
}).join("\n") + ")";
|
|
64357
64164
|
}
|
|
@@ -64361,20 +64168,20 @@ directive @${config.componentFieldDirective}(field: String!, prop: String, expor
|
|
|
64361
64168
|
`;
|
|
64362
64169
|
}).join("\n");
|
|
64363
64170
|
extensions += `${Object.keys(config.configFile.features?.runtimeScalars ?? {}).map((scalar) => `scalar ${scalar}`).join("\n")}`;
|
|
64364
|
-
config.newSchema =
|
|
64171
|
+
config.newSchema = graphql24.print(mergeTypeDefs([internalSchema, config.newSchema]));
|
|
64365
64172
|
config.schemaString += extensions;
|
|
64366
|
-
config.schema =
|
|
64367
|
-
|
|
64368
|
-
mergeTypeDefs([
|
|
64173
|
+
config.schema = graphql24.buildSchema(
|
|
64174
|
+
graphql24.print(
|
|
64175
|
+
mergeTypeDefs([graphql24.printSchema(config.schema), internalSchema, extensions])
|
|
64369
64176
|
)
|
|
64370
64177
|
);
|
|
64371
64178
|
}
|
|
64372
64179
|
|
|
64373
64180
|
// src/codegen/transforms/typename.ts
|
|
64374
|
-
var
|
|
64181
|
+
var graphql25 = __toESM(require("graphql"), 1);
|
|
64375
64182
|
async function addTypename(config, documents) {
|
|
64376
64183
|
for (const doc of documents) {
|
|
64377
|
-
doc.document =
|
|
64184
|
+
doc.document = graphql25.visit(doc.document, {
|
|
64378
64185
|
Field(node, key, parent2, path2, ancestors) {
|
|
64379
64186
|
if (!node.selectionSet) {
|
|
64380
64187
|
return;
|
|
@@ -64386,7 +64193,7 @@ async function addTypename(config, documents) {
|
|
|
64386
64193
|
);
|
|
64387
64194
|
const field = type.getFields()[node.name.value];
|
|
64388
64195
|
const fieldType = unwrapType(config, field.type).type;
|
|
64389
|
-
if (
|
|
64196
|
+
if (graphql25.isInterfaceType(fieldType) || graphql25.isUnionType(fieldType)) {
|
|
64390
64197
|
return {
|
|
64391
64198
|
...node,
|
|
64392
64199
|
selectionSet: {
|
|
@@ -64394,9 +64201,9 @@ async function addTypename(config, documents) {
|
|
|
64394
64201
|
selections: [
|
|
64395
64202
|
...node.selectionSet.selections,
|
|
64396
64203
|
{
|
|
64397
|
-
kind:
|
|
64204
|
+
kind: graphql25.Kind.FIELD,
|
|
64398
64205
|
name: {
|
|
64399
|
-
kind:
|
|
64206
|
+
kind: graphql25.Kind.NAME,
|
|
64400
64207
|
value: "__typename"
|
|
64401
64208
|
}
|
|
64402
64209
|
}
|
|
@@ -64413,9 +64220,9 @@ async function addTypename(config, documents) {
|
|
|
64413
64220
|
selections: [
|
|
64414
64221
|
...node.selectionSet.selections,
|
|
64415
64222
|
{
|
|
64416
|
-
kind:
|
|
64223
|
+
kind: graphql25.Kind.FIELD,
|
|
64417
64224
|
name: {
|
|
64418
|
-
kind:
|
|
64225
|
+
kind: graphql25.Kind.NAME,
|
|
64419
64226
|
value: "__typename"
|
|
64420
64227
|
}
|
|
64421
64228
|
}
|
|
@@ -64428,10 +64235,10 @@ async function addTypename(config, documents) {
|
|
|
64428
64235
|
}
|
|
64429
64236
|
|
|
64430
64237
|
// src/codegen/transforms/addID.ts
|
|
64431
|
-
var
|
|
64238
|
+
var graphql26 = __toESM(require("graphql"), 1);
|
|
64432
64239
|
async function addID(config, documents) {
|
|
64433
64240
|
for (const doc of documents) {
|
|
64434
|
-
doc.document =
|
|
64241
|
+
doc.document = graphql26.visit(doc.document, {
|
|
64435
64242
|
Field(node, key, parent2, path2, ancestors) {
|
|
64436
64243
|
if (!node.selectionSet) {
|
|
64437
64244
|
return;
|
|
@@ -64469,7 +64276,7 @@ function addKeysToSelection(config, node, fieldType) {
|
|
|
64469
64276
|
if (!node.selectionSet || node.selectionSet.selections.length == 0) {
|
|
64470
64277
|
return;
|
|
64471
64278
|
}
|
|
64472
|
-
if (!
|
|
64279
|
+
if (!graphql26.isObjectType(fieldType) && !graphql26.isInterfaceType(fieldType)) {
|
|
64473
64280
|
return;
|
|
64474
64281
|
}
|
|
64475
64282
|
const keyFields = config.keyFieldsForType(fieldType.name);
|
|
@@ -64484,9 +64291,9 @@ function addKeysToSelection(config, node, fieldType) {
|
|
|
64484
64291
|
continue;
|
|
64485
64292
|
}
|
|
64486
64293
|
selections.push({
|
|
64487
|
-
kind:
|
|
64294
|
+
kind: graphql26.Kind.FIELD,
|
|
64488
64295
|
name: {
|
|
64489
|
-
kind:
|
|
64296
|
+
kind: graphql26.Kind.NAME,
|
|
64490
64297
|
value: keyField
|
|
64491
64298
|
}
|
|
64492
64299
|
});
|
|
@@ -64501,13 +64308,13 @@ function addKeysToSelection(config, node, fieldType) {
|
|
|
64501
64308
|
}
|
|
64502
64309
|
|
|
64503
64310
|
// src/codegen/transforms/componentFields.ts
|
|
64504
|
-
var
|
|
64311
|
+
var graphql27 = __toESM(require("graphql"), 1);
|
|
64505
64312
|
async function componentFields(config, documents) {
|
|
64506
64313
|
for (const document of documents) {
|
|
64507
|
-
const typeInfo = new
|
|
64508
|
-
document.document =
|
|
64314
|
+
const typeInfo = new graphql27.TypeInfo(config.schema);
|
|
64315
|
+
document.document = graphql27.visit(
|
|
64509
64316
|
document.document,
|
|
64510
|
-
|
|
64317
|
+
graphql27.visitWithTypeInfo(typeInfo, {
|
|
64511
64318
|
Field(node) {
|
|
64512
64319
|
const parentType = typeInfo.getParentType();
|
|
64513
64320
|
if (!parentType) {
|
|
@@ -64556,10 +64363,10 @@ async function componentFields(config, documents) {
|
|
|
64556
64363
|
}
|
|
64557
64364
|
|
|
64558
64365
|
// src/codegen/transforms/runtimeScalars.ts
|
|
64559
|
-
var
|
|
64366
|
+
var graphql28 = __toESM(require("graphql"), 1);
|
|
64560
64367
|
async function addTypename2(config, documents) {
|
|
64561
64368
|
for (const doc of documents) {
|
|
64562
|
-
doc.document =
|
|
64369
|
+
doc.document = graphql28.visit(doc.document, {
|
|
64563
64370
|
VariableDefinition(node) {
|
|
64564
64371
|
const { type, wrappers } = unwrapType(config, node.type);
|
|
64565
64372
|
const runtimeScalar = config.configFile.features?.runtimeScalars?.[type.name];
|
|
@@ -64598,7 +64405,7 @@ async function addTypename2(config, documents) {
|
|
|
64598
64405
|
}
|
|
64599
64406
|
|
|
64600
64407
|
// src/codegen/validators/typeCheck.ts
|
|
64601
|
-
var
|
|
64408
|
+
var graphql29 = __toESM(require("graphql"), 1);
|
|
64602
64409
|
async function typeCheck(config, docs) {
|
|
64603
64410
|
const errors = [];
|
|
64604
64411
|
const freeLists = [];
|
|
@@ -64606,7 +64413,7 @@ async function typeCheck(config, docs) {
|
|
|
64606
64413
|
const listTypes = [];
|
|
64607
64414
|
const fragments = {};
|
|
64608
64415
|
for (const { document: parsed, originalString, filename } of docs) {
|
|
64609
|
-
|
|
64416
|
+
graphql29.visit(parsed, {
|
|
64610
64417
|
FragmentDefinition(definition) {
|
|
64611
64418
|
fragments[definition.name.value] = definition;
|
|
64612
64419
|
},
|
|
@@ -64651,14 +64458,14 @@ async function typeCheck(config, docs) {
|
|
|
64651
64458
|
);
|
|
64652
64459
|
return;
|
|
64653
64460
|
}
|
|
64654
|
-
if (
|
|
64461
|
+
if (graphql29.isListType(rootType) || graphql29.isNonNullType(rootType) && graphql29.isListType(rootType.ofType)) {
|
|
64655
64462
|
needsParent = true;
|
|
64656
64463
|
break;
|
|
64657
64464
|
}
|
|
64658
|
-
if (
|
|
64465
|
+
if (graphql29.isNonNullType(rootType) && "ofType" in rootType) {
|
|
64659
64466
|
rootType = rootType.ofType;
|
|
64660
64467
|
}
|
|
64661
|
-
if (
|
|
64468
|
+
if (graphql29.isScalarType(rootType)) {
|
|
64662
64469
|
break;
|
|
64663
64470
|
}
|
|
64664
64471
|
rootType = rootType?.getFields()[parent3.name.value]?.type;
|
|
@@ -64734,9 +64541,9 @@ async function typeCheck(config, docs) {
|
|
|
64734
64541
|
);
|
|
64735
64542
|
}
|
|
64736
64543
|
let targetTypes = [type];
|
|
64737
|
-
if (
|
|
64544
|
+
if (graphql29.isUnionType(type)) {
|
|
64738
64545
|
targetTypes = config.schema.getPossibleTypes(type);
|
|
64739
|
-
} else if (
|
|
64546
|
+
} else if (graphql29.isInterfaceType(type)) {
|
|
64740
64547
|
try {
|
|
64741
64548
|
for (const key of config.keyFieldsForType(type.name)) {
|
|
64742
64549
|
if (!type.getFields()[key]) {
|
|
@@ -64772,13 +64579,13 @@ async function typeCheck(config, docs) {
|
|
|
64772
64579
|
if (errors.length > 0) {
|
|
64773
64580
|
throw errors;
|
|
64774
64581
|
}
|
|
64775
|
-
const rules = (filepath) => [...
|
|
64582
|
+
const rules = (filepath) => [...graphql29.specifiedRules].filter(
|
|
64776
64583
|
(rule) => ![
|
|
64777
|
-
|
|
64778
|
-
|
|
64779
|
-
|
|
64780
|
-
|
|
64781
|
-
|
|
64584
|
+
graphql29.NoUnusedFragmentsRule,
|
|
64585
|
+
graphql29.KnownFragmentNamesRule,
|
|
64586
|
+
graphql29.ExecutableDefinitionsRule,
|
|
64587
|
+
graphql29.KnownDirectivesRule,
|
|
64588
|
+
graphql29.KnownArgumentNamesRule
|
|
64782
64589
|
].includes(rule)
|
|
64783
64590
|
).concat(
|
|
64784
64591
|
validateLists({
|
|
@@ -64799,7 +64606,7 @@ async function typeCheck(config, docs) {
|
|
|
64799
64606
|
validateLoadingDirective(config)
|
|
64800
64607
|
);
|
|
64801
64608
|
for (const { filename, document: parsed, originalString } of docs) {
|
|
64802
|
-
for (const error of
|
|
64609
|
+
for (const error of graphql29.validate(config.schema, parsed, rules(filename))) {
|
|
64803
64610
|
errors.push(
|
|
64804
64611
|
new HoudiniError({
|
|
64805
64612
|
filepath: filename,
|
|
@@ -64828,20 +64635,20 @@ function validateRequiredDirective(config, filepath) {
|
|
|
64828
64635
|
if (!node.directives?.some(({ name }) => name.value === config.requiredDirective))
|
|
64829
64636
|
return;
|
|
64830
64637
|
const parentType = parentTypeFromAncestors(config.schema, filepath, ancestors);
|
|
64831
|
-
if (!
|
|
64638
|
+
if (!graphql29.isObjectType(parentType)) {
|
|
64832
64639
|
ctx.reportError(
|
|
64833
|
-
new
|
|
64640
|
+
new graphql29.GraphQLError(
|
|
64834
64641
|
`@${config.requiredDirective} may only be used on objects, not arguments`
|
|
64835
64642
|
)
|
|
64836
64643
|
);
|
|
64837
64644
|
return;
|
|
64838
64645
|
}
|
|
64839
64646
|
const type = parentType.getFields()[node.name.value].type;
|
|
64840
|
-
const isServerNullable = !
|
|
64647
|
+
const isServerNullable = !graphql29.isNonNullType(type);
|
|
64841
64648
|
const isAlreadyClientNullable = isClientNullable(node, true);
|
|
64842
64649
|
if (!isServerNullable && !isAlreadyClientNullable) {
|
|
64843
64650
|
ctx.reportError(
|
|
64844
|
-
new
|
|
64651
|
+
new graphql29.GraphQLError(
|
|
64845
64652
|
`@${config.requiredDirective} may only be used on nullable fields`
|
|
64846
64653
|
)
|
|
64847
64654
|
);
|
|
@@ -64863,7 +64670,7 @@ var validateLists = ({
|
|
|
64863
64670
|
if (!config.isListFragment(node.name.value)) {
|
|
64864
64671
|
if (!fragments[node.name.value]) {
|
|
64865
64672
|
ctx.reportError(
|
|
64866
|
-
new
|
|
64673
|
+
new graphql29.GraphQLError(
|
|
64867
64674
|
"Encountered unknown fragment: " + node.name.value
|
|
64868
64675
|
)
|
|
64869
64676
|
);
|
|
@@ -64873,7 +64680,7 @@ var validateLists = ({
|
|
|
64873
64680
|
const listName = config.listNameFromFragment(node.name.value);
|
|
64874
64681
|
if (!lists.includes(listName)) {
|
|
64875
64682
|
ctx.reportError(
|
|
64876
|
-
new
|
|
64683
|
+
new graphql29.GraphQLError(
|
|
64877
64684
|
"Encountered fragment referencing unknown list: " + listName
|
|
64878
64685
|
)
|
|
64879
64686
|
);
|
|
@@ -64898,7 +64705,7 @@ var validateLists = ({
|
|
|
64898
64705
|
);
|
|
64899
64706
|
if (parentArg) {
|
|
64900
64707
|
ctx.reportError(
|
|
64901
|
-
new
|
|
64708
|
+
new graphql29.GraphQLError(
|
|
64902
64709
|
`@${config.deprecatedlistDirectiveParentIDArg} should be defined only in it's own directive now`
|
|
64903
64710
|
)
|
|
64904
64711
|
);
|
|
@@ -64914,7 +64721,7 @@ var validateLists = ({
|
|
|
64914
64721
|
return;
|
|
64915
64722
|
}
|
|
64916
64723
|
ctx.reportError(
|
|
64917
|
-
new
|
|
64724
|
+
new graphql29.GraphQLError(
|
|
64918
64725
|
`For this list fragment, you need to add or @${config.listParentDirective} or @${config.listAllListsDirective} directive to specify the behavior`
|
|
64919
64726
|
)
|
|
64920
64727
|
);
|
|
@@ -64924,7 +64731,7 @@ var validateLists = ({
|
|
|
64924
64731
|
const directiveName = node.name.value;
|
|
64925
64732
|
if (directiveName === "connection") {
|
|
64926
64733
|
ctx.reportError(
|
|
64927
|
-
new
|
|
64734
|
+
new graphql29.GraphQLError(
|
|
64928
64735
|
"@connection was renamed to @list. Please change your components. If you were using `cache.connection` in your components, you will need to update that to `cache.list` too."
|
|
64929
64736
|
)
|
|
64930
64737
|
);
|
|
@@ -64933,7 +64740,7 @@ var validateLists = ({
|
|
|
64933
64740
|
if (!config.isInternalDirective(node.name.value)) {
|
|
64934
64741
|
if (!config.schema.getDirective(directiveName)) {
|
|
64935
64742
|
ctx.reportError(
|
|
64936
|
-
new
|
|
64743
|
+
new graphql29.GraphQLError(
|
|
64937
64744
|
"Encountered unknown directive: " + directiveName
|
|
64938
64745
|
)
|
|
64939
64746
|
);
|
|
@@ -64942,7 +64749,7 @@ var validateLists = ({
|
|
|
64942
64749
|
}
|
|
64943
64750
|
if (config.isListOperationDirective(directiveName) && !listTypes.includes(config.listNameFromDirective(directiveName))) {
|
|
64944
64751
|
ctx.reportError(
|
|
64945
|
-
new
|
|
64752
|
+
new graphql29.GraphQLError(
|
|
64946
64753
|
"Encountered directive referencing unknown list: " + directiveName
|
|
64947
64754
|
)
|
|
64948
64755
|
);
|
|
@@ -64953,7 +64760,7 @@ var validateLists = ({
|
|
|
64953
64760
|
};
|
|
64954
64761
|
function knownArguments(config) {
|
|
64955
64762
|
return function(ctx) {
|
|
64956
|
-
const nativeValidator =
|
|
64763
|
+
const nativeValidator = graphql29.KnownArgumentNamesRule(ctx);
|
|
64957
64764
|
return {
|
|
64958
64765
|
...nativeValidator,
|
|
64959
64766
|
Directive(directiveNode) {
|
|
@@ -64988,7 +64795,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
64988
64795
|
for (const arg of node.arguments || []) {
|
|
64989
64796
|
if (arg.value.kind !== "ObjectValue") {
|
|
64990
64797
|
ctx.reportError(
|
|
64991
|
-
new
|
|
64798
|
+
new graphql29.GraphQLError("values in @arguments must be an object")
|
|
64992
64799
|
);
|
|
64993
64800
|
return;
|
|
64994
64801
|
}
|
|
@@ -64998,13 +64805,13 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
64998
64805
|
);
|
|
64999
64806
|
if (!typeArg) {
|
|
65000
64807
|
ctx.reportError(
|
|
65001
|
-
new
|
|
64808
|
+
new graphql29.GraphQLError("missing type field for @arguments directive")
|
|
65002
64809
|
);
|
|
65003
64810
|
return;
|
|
65004
64811
|
}
|
|
65005
|
-
if (typeArg.value.kind !==
|
|
64812
|
+
if (typeArg.value.kind !== graphql29.Kind.STRING) {
|
|
65006
64813
|
ctx.reportError(
|
|
65007
|
-
new
|
|
64814
|
+
new graphql29.GraphQLError("type field to @arguments must be a string")
|
|
65008
64815
|
);
|
|
65009
64816
|
return;
|
|
65010
64817
|
}
|
|
@@ -65017,7 +64824,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
65017
64824
|
);
|
|
65018
64825
|
if (typeArg.value.value !== defaultValueType) {
|
|
65019
64826
|
ctx.reportError(
|
|
65020
|
-
new
|
|
64827
|
+
new graphql29.GraphQLError(
|
|
65021
64828
|
`Invalid default value provided for ${arg.name.value}. Expected ${typeArg.value.value}, found ${defaultValueType}`
|
|
65022
64829
|
)
|
|
65023
64830
|
);
|
|
@@ -65035,7 +64842,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
65035
64842
|
try {
|
|
65036
64843
|
args = fragmentArguments(config, filepath, fragments[fragmentName]);
|
|
65037
64844
|
} catch (e) {
|
|
65038
|
-
ctx.reportError(new
|
|
64845
|
+
ctx.reportError(new graphql29.GraphQLError(e.message));
|
|
65039
64846
|
return;
|
|
65040
64847
|
}
|
|
65041
64848
|
fragmentArguments2[fragmentName] = args;
|
|
@@ -65058,7 +64865,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
65058
64865
|
);
|
|
65059
64866
|
if (missing.length > 0) {
|
|
65060
64867
|
ctx.reportError(
|
|
65061
|
-
new
|
|
64868
|
+
new graphql29.GraphQLError(
|
|
65062
64869
|
`The following arguments are missing from the "${fragmentName}" fragment: ` + JSON.stringify(missing)
|
|
65063
64870
|
)
|
|
65064
64871
|
);
|
|
@@ -65069,7 +64876,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
65069
64876
|
);
|
|
65070
64877
|
if (unknown.length > 0) {
|
|
65071
64878
|
ctx.reportError(
|
|
65072
|
-
new
|
|
64879
|
+
new graphql29.GraphQLError(
|
|
65073
64880
|
"Encountered unknown arguments: " + JSON.stringify(unknown)
|
|
65074
64881
|
)
|
|
65075
64882
|
);
|
|
@@ -65081,7 +64888,7 @@ function validateFragmentArguments(config, filepath, fragments) {
|
|
|
65081
64888
|
for (const [applied, target] of zipped) {
|
|
65082
64889
|
if (!valueIsType(config, applied.value, target)) {
|
|
65083
64890
|
ctx.reportError(
|
|
65084
|
-
new
|
|
64891
|
+
new graphql29.GraphQLError(
|
|
65085
64892
|
`Invalid argument type. Expected ${target}, found ${applied.value.kind}`
|
|
65086
64893
|
)
|
|
65087
64894
|
);
|
|
@@ -65123,7 +64930,7 @@ function valueIsType(config, value, targetType) {
|
|
|
65123
64930
|
}
|
|
65124
64931
|
if (value.kind === "EnumValue" && targetType.kind === "NamedType") {
|
|
65125
64932
|
const enumType = config.schema.getType(targetType.name.value);
|
|
65126
|
-
if (!
|
|
64933
|
+
if (!graphql29.isEnumType(enumType)) {
|
|
65127
64934
|
return false;
|
|
65128
64935
|
}
|
|
65129
64936
|
return enumType.getValues().some((enumValue) => enumValue.value === value.value);
|
|
@@ -65143,7 +64950,7 @@ function paginateArgs(config, filepath) {
|
|
|
65143
64950
|
}
|
|
65144
64951
|
if (alreadyPaginated) {
|
|
65145
64952
|
ctx.reportError(
|
|
65146
|
-
new
|
|
64953
|
+
new graphql29.GraphQLError(
|
|
65147
64954
|
`@${config.paginateDirective} can only appear in a document once.`
|
|
65148
64955
|
)
|
|
65149
64956
|
);
|
|
@@ -65175,7 +64982,7 @@ function paginateArgs(config, filepath) {
|
|
|
65175
64982
|
const backwards = appliedArgs.has("last");
|
|
65176
64983
|
if (!forward && !backwards) {
|
|
65177
64984
|
ctx.reportError(
|
|
65178
|
-
new
|
|
64985
|
+
new graphql29.GraphQLError(
|
|
65179
64986
|
"A field with cursor-based pagination must have a first or last argument"
|
|
65180
64987
|
)
|
|
65181
64988
|
);
|
|
@@ -65189,7 +64996,7 @@ function paginateArgs(config, filepath) {
|
|
|
65189
64996
|
}
|
|
65190
64997
|
if (forward && backwards && paginateMode === "Infinite") {
|
|
65191
64998
|
ctx.reportError(
|
|
65192
|
-
new
|
|
64999
|
+
new graphql29.GraphQLError(
|
|
65193
65000
|
`A field with cursor pagination cannot go forwards an backwards simultaneously`
|
|
65194
65001
|
)
|
|
65195
65002
|
);
|
|
@@ -65203,7 +65010,7 @@ function paginateArgs(config, filepath) {
|
|
|
65203
65010
|
);
|
|
65204
65011
|
if (!appliedLimitArg) {
|
|
65205
65012
|
ctx.reportError(
|
|
65206
|
-
new
|
|
65013
|
+
new graphql29.GraphQLError(
|
|
65207
65014
|
"A field with offset-based pagination must have a limit argument"
|
|
65208
65015
|
)
|
|
65209
65016
|
);
|
|
@@ -65219,20 +65026,20 @@ function noUnusedFragmentArguments(config) {
|
|
|
65219
65026
|
const args = /* @__PURE__ */ new Set();
|
|
65220
65027
|
return {
|
|
65221
65028
|
enter(node) {
|
|
65222
|
-
if (node.kind ===
|
|
65029
|
+
if (node.kind === graphql29.Kind.FRAGMENT_DEFINITION) {
|
|
65223
65030
|
const definitionArguments = node.directives?.filter((directive) => directive.name.value === config.argumentsDirective).flatMap((directive) => directive.arguments);
|
|
65224
65031
|
for (const arg of definitionArguments?.map((arg2) => arg2?.name.value) || []) {
|
|
65225
65032
|
args.add(arg);
|
|
65226
65033
|
}
|
|
65227
|
-
} else if (node.kind ===
|
|
65034
|
+
} else if (node.kind === graphql29.Kind.VARIABLE) {
|
|
65228
65035
|
args.delete(node.name.value);
|
|
65229
65036
|
}
|
|
65230
65037
|
},
|
|
65231
65038
|
leave(node) {
|
|
65232
|
-
if (node.kind ===
|
|
65039
|
+
if (node.kind === graphql29.Kind.FRAGMENT_DEFINITION) {
|
|
65233
65040
|
if (args.size > 0) {
|
|
65234
65041
|
ctx.reportError(
|
|
65235
|
-
new
|
|
65042
|
+
new graphql29.GraphQLError(
|
|
65236
65043
|
"Encountered unused fragment arguments: " + [...args].join(",")
|
|
65237
65044
|
)
|
|
65238
65045
|
);
|
|
@@ -65268,7 +65075,7 @@ function nodeDirectives(config, directives) {
|
|
|
65268
65075
|
if (definition.kind === "OperationDefinition") {
|
|
65269
65076
|
if (definition.operation !== "query") {
|
|
65270
65077
|
ctx.reportError(
|
|
65271
|
-
new
|
|
65078
|
+
new graphql29.GraphQLError(
|
|
65272
65079
|
`@${node.name.value} must fall on a fragment or query document`
|
|
65273
65080
|
)
|
|
65274
65081
|
);
|
|
@@ -65280,7 +65087,7 @@ function nodeDirectives(config, directives) {
|
|
|
65280
65087
|
}
|
|
65281
65088
|
if (!possibleNodes.includes(definitionType)) {
|
|
65282
65089
|
ctx.reportError(
|
|
65283
|
-
new
|
|
65090
|
+
new graphql29.GraphQLError(paginateOnNonNodeMessage(node.name.value))
|
|
65284
65091
|
);
|
|
65285
65092
|
}
|
|
65286
65093
|
}
|
|
@@ -65299,7 +65106,7 @@ function checkMutationOperation(config) {
|
|
|
65299
65106
|
);
|
|
65300
65107
|
if (append && prepend) {
|
|
65301
65108
|
ctx.reportError(
|
|
65302
|
-
new
|
|
65109
|
+
new graphql29.GraphQLError(
|
|
65303
65110
|
`You can't apply both @${config.listPrependDirective} and @${config.listAppendDirective} at the same time`
|
|
65304
65111
|
)
|
|
65305
65112
|
);
|
|
@@ -65313,7 +65120,7 @@ function checkMutationOperation(config) {
|
|
|
65313
65120
|
);
|
|
65314
65121
|
if (parentId && allLists) {
|
|
65315
65122
|
ctx.reportError(
|
|
65316
|
-
new
|
|
65123
|
+
new graphql29.GraphQLError(
|
|
65317
65124
|
`You can't apply both @${config.listParentDirective} and @${config.listAllListsDirective} at the same time`
|
|
65318
65125
|
)
|
|
65319
65126
|
);
|
|
@@ -65335,7 +65142,7 @@ function checkMaskDirectives(config) {
|
|
|
65335
65142
|
);
|
|
65336
65143
|
if (maskEnableDirective && maskDisableDirective) {
|
|
65337
65144
|
ctx.reportError(
|
|
65338
|
-
new
|
|
65145
|
+
new graphql29.GraphQLError(
|
|
65339
65146
|
`You can't apply both @${config.maskEnableDirective} and @${config.maskDisableDirective} at the same time`
|
|
65340
65147
|
)
|
|
65341
65148
|
);
|
|
@@ -65377,7 +65184,7 @@ function validateLoadingDirective(config) {
|
|
|
65377
65184
|
);
|
|
65378
65185
|
if (!parentLoading && !global2) {
|
|
65379
65186
|
ctx.reportError(
|
|
65380
|
-
new
|
|
65187
|
+
new graphql29.GraphQLError(
|
|
65381
65188
|
`@${config.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config.loadingDirective}`
|
|
65382
65189
|
)
|
|
65383
65190
|
);
|
|
@@ -65399,7 +65206,7 @@ function validateLoadingDirective(config) {
|
|
|
65399
65206
|
);
|
|
65400
65207
|
if (!parentLoading && !global2) {
|
|
65401
65208
|
ctx.reportError(
|
|
65402
|
-
new
|
|
65209
|
+
new graphql29.GraphQLError(
|
|
65403
65210
|
`@${config.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config.loadingDirective}`
|
|
65404
65211
|
)
|
|
65405
65212
|
);
|
|
@@ -65414,7 +65221,7 @@ function getAndVerifyNodeInterface(config) {
|
|
|
65414
65221
|
if (!nodeInterface) {
|
|
65415
65222
|
return null;
|
|
65416
65223
|
}
|
|
65417
|
-
if (!
|
|
65224
|
+
if (!graphql29.isInterfaceType(nodeInterface)) {
|
|
65418
65225
|
displayInvalidNodeFieldMessage(config);
|
|
65419
65226
|
return null;
|
|
65420
65227
|
}
|
|
@@ -65509,11 +65316,11 @@ async function uniqueDocumentNames(config, docs) {
|
|
|
65509
65316
|
}
|
|
65510
65317
|
|
|
65511
65318
|
// src/codegen/validators/noIDAlias.ts
|
|
65512
|
-
var
|
|
65319
|
+
var graphql30 = __toESM(require("graphql"), 1);
|
|
65513
65320
|
async function noIDAlias(config, docs) {
|
|
65514
65321
|
const errors = [];
|
|
65515
65322
|
for (const { filename, document } of docs) {
|
|
65516
|
-
|
|
65323
|
+
graphql30.visit(document, {
|
|
65517
65324
|
Field(node, _, __, ___, ancestors) {
|
|
65518
65325
|
const fieldType = parentTypeFromAncestors(config.schema, filename, ancestors).name;
|
|
65519
65326
|
if (config.keyFieldsForType(fieldType).includes(node.alias?.value || "")) {
|
|
@@ -65552,11 +65359,11 @@ async function validatePlugins(config, documents) {
|
|
|
65552
65359
|
}
|
|
65553
65360
|
|
|
65554
65361
|
// src/codegen/validators/componentFields.ts
|
|
65555
|
-
var
|
|
65362
|
+
var graphql31 = __toESM(require("graphql"), 1);
|
|
65556
65363
|
async function componentFields2(config, docs) {
|
|
65557
65364
|
const errors = [];
|
|
65558
65365
|
for (const { filename: filepath, document } of docs) {
|
|
65559
|
-
|
|
65366
|
+
graphql31.visit(document, {
|
|
65560
65367
|
FragmentDefinition(node, _, __, ___, ancestors) {
|
|
65561
65368
|
const componentFieldDirective = node.directives?.find(
|
|
65562
65369
|
(dir) => dir.name.value === config.componentFieldDirective
|
|
@@ -65604,7 +65411,7 @@ async function componentFields2(config, docs) {
|
|
|
65604
65411
|
if (existingField && existingField.filepath !== filepath) {
|
|
65605
65412
|
conflict = true;
|
|
65606
65413
|
} else if (parentType && fieldValue) {
|
|
65607
|
-
const fieldDef =
|
|
65414
|
+
const fieldDef = graphql31.isObjectType(parentType) && parentType.getFields()[fieldValue];
|
|
65608
65415
|
if (fieldDef && !fieldDef.astNode?.directives?.find(
|
|
65609
65416
|
(dir) => dir.name.value === config.componentFieldDirective
|
|
65610
65417
|
)) {
|
|
@@ -65617,7 +65424,7 @@ async function componentFields2(config, docs) {
|
|
|
65617
65424
|
filepath
|
|
65618
65425
|
});
|
|
65619
65426
|
}
|
|
65620
|
-
if (parentType &&
|
|
65427
|
+
if (parentType && graphql31.isAbstractType(parentType)) {
|
|
65621
65428
|
errors.push({
|
|
65622
65429
|
message: `Cannot add component field ${parent2}.${fieldValue} because ${parent2} is an abstract type`,
|
|
65623
65430
|
filepath
|
|
@@ -65813,7 +65620,7 @@ function testConfigFile({ plugins, ...config } = {}) {
|
|
|
65813
65620
|
id: ID!
|
|
65814
65621
|
name(arg: Int): String!
|
|
65815
65622
|
birthday: DateTime!
|
|
65816
|
-
firstName: String!
|
|
65623
|
+
firstName: String! @deprecated(reason: "Use name instead")
|
|
65817
65624
|
friends: [User!]!
|
|
65818
65625
|
friendsByCursor(first: Int, after: String, last: Int, before: String, filter: String): UserConnection!
|
|
65819
65626
|
friendsByCursorSnapshot(snapshot: String!, first: Int, after: String, last: Int, before: String): UserConnection!
|
|
@@ -65843,13 +65650,22 @@ function testConfigFile({ plugins, ...config } = {}) {
|
|
|
65843
65650
|
believers(first: Int, after: String): GhostConnection
|
|
65844
65651
|
}
|
|
65845
65652
|
|
|
65653
|
+
"""
|
|
65654
|
+
Cat's documentation
|
|
65655
|
+
"""
|
|
65846
65656
|
type Cat implements Friend & Node {
|
|
65847
65657
|
id: ID!
|
|
65658
|
+
"""
|
|
65659
|
+
The name of the cat
|
|
65660
|
+
"""
|
|
65848
65661
|
name: String!
|
|
65849
65662
|
owner: User!
|
|
65850
65663
|
}
|
|
65851
65664
|
|
|
65852
65665
|
type Query {
|
|
65666
|
+
"""
|
|
65667
|
+
Get a user.
|
|
65668
|
+
"""
|
|
65853
65669
|
user: User!
|
|
65854
65670
|
entity: Entity!
|
|
65855
65671
|
version: Int!
|
|
@@ -66031,11 +65847,19 @@ function testConfigFile({ plugins, ...config } = {}) {
|
|
|
66031
65847
|
id: ID!
|
|
66032
65848
|
}
|
|
66033
65849
|
|
|
65850
|
+
"""
|
|
65851
|
+
Documentation of testenum1
|
|
65852
|
+
"""
|
|
66034
65853
|
enum TestEnum1 {
|
|
65854
|
+
"Documentation of Value1"
|
|
66035
65855
|
Value1
|
|
65856
|
+
"Documentation of Value2"
|
|
66036
65857
|
Value2
|
|
66037
65858
|
}
|
|
66038
65859
|
|
|
65860
|
+
"""
|
|
65861
|
+
Documentation of testenum2
|
|
65862
|
+
"""
|
|
66039
65863
|
enum TestEnum2 {
|
|
66040
65864
|
Value3
|
|
66041
65865
|
Value2
|
|
@@ -66120,7 +65944,7 @@ function pipelineTest(config, documents, shouldPass, testBody) {
|
|
|
66120
65944
|
};
|
|
66121
65945
|
}
|
|
66122
65946
|
function mockCollectedDoc(query2, data) {
|
|
66123
|
-
const parsed =
|
|
65947
|
+
const parsed = graphql33.parse(query2);
|
|
66124
65948
|
const name = parsed.definitions[0].name.value;
|
|
66125
65949
|
const operations = parsed.definitions;
|
|
66126
65950
|
let kind = ArtifactKind.Fragment;
|