houdini 1.2.0-next.1 → 1.2.0
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 +26 -4
- package/build/cmd-esm/index.js +26 -4
- package/build/codegen-cjs/index.js +24 -2
- package/build/codegen-esm/index.js +24 -2
- package/build/lib-cjs/index.js +1 -1
- package/build/lib-esm/index.js +1 -1
- package/build/test-cjs/index.js +24 -2
- package/build/test-esm/index.js +24 -2
- package/build/vite-cjs/index.js +24 -2
- package/build/vite-esm/index.js +24 -2
- package/package.json +1 -1
package/build/cmd-cjs/index.js
CHANGED
|
@@ -73332,7 +73332,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
73332
73332
|
// src/lib/parse.ts
|
|
73333
73333
|
async function parseJS(str, config2) {
|
|
73334
73334
|
const defaultConfig = {
|
|
73335
|
-
plugins: ["typescript", "importAssertions"],
|
|
73335
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
73336
73336
|
sourceType: "module"
|
|
73337
73337
|
};
|
|
73338
73338
|
return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
|
|
@@ -79149,6 +79149,28 @@ function validateLoadingDirective(config2) {
|
|
|
79149
79149
|
}
|
|
79150
79150
|
}
|
|
79151
79151
|
},
|
|
79152
|
+
FragmentSpread(node, _, __, ___, ancestors) {
|
|
79153
|
+
const loadingDirective = node.directives?.find(
|
|
79154
|
+
(d) => d.name.value === config2.loadingDirective
|
|
79155
|
+
);
|
|
79156
|
+
if (!loadingDirective) {
|
|
79157
|
+
return;
|
|
79158
|
+
}
|
|
79159
|
+
const parent2 = parentField(ancestors);
|
|
79160
|
+
if (!parent2 || ["OperationDefinition", "FragmentDefinition"].includes(parent2.kind)) {
|
|
79161
|
+
return;
|
|
79162
|
+
}
|
|
79163
|
+
const parentLoading = parent2.directives?.find(
|
|
79164
|
+
(d) => d.name.value === config2.loadingDirective
|
|
79165
|
+
);
|
|
79166
|
+
if (!parentLoading && !global2) {
|
|
79167
|
+
ctx.reportError(
|
|
79168
|
+
new graphql25.GraphQLError(
|
|
79169
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
79170
|
+
)
|
|
79171
|
+
);
|
|
79172
|
+
}
|
|
79173
|
+
},
|
|
79152
79174
|
Field(node, _, __, ___, ancestors) {
|
|
79153
79175
|
const loadingDirective = node.directives?.find(
|
|
79154
79176
|
(d) => d.name.value === config2.loadingDirective
|
|
@@ -79166,7 +79188,7 @@ function validateLoadingDirective(config2) {
|
|
|
79166
79188
|
if (!parentLoading && !global2) {
|
|
79167
79189
|
ctx.reportError(
|
|
79168
79190
|
new graphql25.GraphQLError(
|
|
79169
|
-
`@${config2.loadingDirective} can only be applied on a field at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
79191
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
79170
79192
|
)
|
|
79171
79193
|
);
|
|
79172
79194
|
}
|
|
@@ -80017,8 +80039,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
80017
80039
|
}
|
|
80018
80040
|
packageJSON.devDependencies = {
|
|
80019
80041
|
...packageJSON.devDependencies,
|
|
80020
|
-
houdini: "^1.2.0
|
|
80021
|
-
"houdini-svelte": "^1.2.0
|
|
80042
|
+
houdini: "^1.2.0",
|
|
80043
|
+
"houdini-svelte": "^1.2.0"
|
|
80022
80044
|
};
|
|
80023
80045
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
80024
80046
|
}
|
package/build/cmd-esm/index.js
CHANGED
|
@@ -73337,7 +73337,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
73337
73337
|
// src/lib/parse.ts
|
|
73338
73338
|
async function parseJS(str, config2) {
|
|
73339
73339
|
const defaultConfig = {
|
|
73340
|
-
plugins: ["typescript", "importAssertions"],
|
|
73340
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
73341
73341
|
sourceType: "module"
|
|
73342
73342
|
};
|
|
73343
73343
|
return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
|
|
@@ -79154,6 +79154,28 @@ function validateLoadingDirective(config2) {
|
|
|
79154
79154
|
}
|
|
79155
79155
|
}
|
|
79156
79156
|
},
|
|
79157
|
+
FragmentSpread(node, _, __, ___, ancestors) {
|
|
79158
|
+
const loadingDirective = node.directives?.find(
|
|
79159
|
+
(d) => d.name.value === config2.loadingDirective
|
|
79160
|
+
);
|
|
79161
|
+
if (!loadingDirective) {
|
|
79162
|
+
return;
|
|
79163
|
+
}
|
|
79164
|
+
const parent2 = parentField(ancestors);
|
|
79165
|
+
if (!parent2 || ["OperationDefinition", "FragmentDefinition"].includes(parent2.kind)) {
|
|
79166
|
+
return;
|
|
79167
|
+
}
|
|
79168
|
+
const parentLoading = parent2.directives?.find(
|
|
79169
|
+
(d) => d.name.value === config2.loadingDirective
|
|
79170
|
+
);
|
|
79171
|
+
if (!parentLoading && !global2) {
|
|
79172
|
+
ctx.reportError(
|
|
79173
|
+
new graphql25.GraphQLError(
|
|
79174
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
79175
|
+
)
|
|
79176
|
+
);
|
|
79177
|
+
}
|
|
79178
|
+
},
|
|
79157
79179
|
Field(node, _, __, ___, ancestors) {
|
|
79158
79180
|
const loadingDirective = node.directives?.find(
|
|
79159
79181
|
(d) => d.name.value === config2.loadingDirective
|
|
@@ -79171,7 +79193,7 @@ function validateLoadingDirective(config2) {
|
|
|
79171
79193
|
if (!parentLoading && !global2) {
|
|
79172
79194
|
ctx.reportError(
|
|
79173
79195
|
new graphql25.GraphQLError(
|
|
79174
|
-
`@${config2.loadingDirective} can only be applied on a field at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
79196
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
79175
79197
|
)
|
|
79176
79198
|
);
|
|
79177
79199
|
}
|
|
@@ -80022,8 +80044,8 @@ async function updatePackageJSON(targetPath) {
|
|
|
80022
80044
|
}
|
|
80023
80045
|
packageJSON.devDependencies = {
|
|
80024
80046
|
...packageJSON.devDependencies,
|
|
80025
|
-
houdini: "^1.2.0
|
|
80026
|
-
"houdini-svelte": "^1.2.0
|
|
80047
|
+
houdini: "^1.2.0",
|
|
80048
|
+
"houdini-svelte": "^1.2.0"
|
|
80027
80049
|
};
|
|
80028
80050
|
await fs_exports.writeFile(packagePath, JSON.stringify(packageJSON, null, 4));
|
|
80029
80051
|
}
|
|
@@ -57001,7 +57001,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
57001
57001
|
// src/lib/parse.ts
|
|
57002
57002
|
async function parseJS(str, config2) {
|
|
57003
57003
|
const defaultConfig = {
|
|
57004
|
-
plugins: ["typescript", "importAssertions"],
|
|
57004
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
57005
57005
|
sourceType: "module"
|
|
57006
57006
|
};
|
|
57007
57007
|
return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
|
|
@@ -62760,6 +62760,28 @@ function validateLoadingDirective(config2) {
|
|
|
62760
62760
|
}
|
|
62761
62761
|
}
|
|
62762
62762
|
},
|
|
62763
|
+
FragmentSpread(node, _, __, ___, ancestors) {
|
|
62764
|
+
const loadingDirective = node.directives?.find(
|
|
62765
|
+
(d) => d.name.value === config2.loadingDirective
|
|
62766
|
+
);
|
|
62767
|
+
if (!loadingDirective) {
|
|
62768
|
+
return;
|
|
62769
|
+
}
|
|
62770
|
+
const parent2 = parentField(ancestors);
|
|
62771
|
+
if (!parent2 || ["OperationDefinition", "FragmentDefinition"].includes(parent2.kind)) {
|
|
62772
|
+
return;
|
|
62773
|
+
}
|
|
62774
|
+
const parentLoading = parent2.directives?.find(
|
|
62775
|
+
(d) => d.name.value === config2.loadingDirective
|
|
62776
|
+
);
|
|
62777
|
+
if (!parentLoading && !global2) {
|
|
62778
|
+
ctx.reportError(
|
|
62779
|
+
new graphql24.GraphQLError(
|
|
62780
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
62781
|
+
)
|
|
62782
|
+
);
|
|
62783
|
+
}
|
|
62784
|
+
},
|
|
62763
62785
|
Field(node, _, __, ___, ancestors) {
|
|
62764
62786
|
const loadingDirective = node.directives?.find(
|
|
62765
62787
|
(d) => d.name.value === config2.loadingDirective
|
|
@@ -62777,7 +62799,7 @@ function validateLoadingDirective(config2) {
|
|
|
62777
62799
|
if (!parentLoading && !global2) {
|
|
62778
62800
|
ctx.reportError(
|
|
62779
62801
|
new graphql24.GraphQLError(
|
|
62780
|
-
`@${config2.loadingDirective} can only be applied on a field at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
62802
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
62781
62803
|
)
|
|
62782
62804
|
);
|
|
62783
62805
|
}
|
|
@@ -56999,7 +56999,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
56999
56999
|
// src/lib/parse.ts
|
|
57000
57000
|
async function parseJS(str, config2) {
|
|
57001
57001
|
const defaultConfig = {
|
|
57002
|
-
plugins: ["typescript", "importAssertions"],
|
|
57002
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
57003
57003
|
sourceType: "module"
|
|
57004
57004
|
};
|
|
57005
57005
|
return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
|
|
@@ -62758,6 +62758,28 @@ function validateLoadingDirective(config2) {
|
|
|
62758
62758
|
}
|
|
62759
62759
|
}
|
|
62760
62760
|
},
|
|
62761
|
+
FragmentSpread(node, _, __, ___, ancestors) {
|
|
62762
|
+
const loadingDirective = node.directives?.find(
|
|
62763
|
+
(d) => d.name.value === config2.loadingDirective
|
|
62764
|
+
);
|
|
62765
|
+
if (!loadingDirective) {
|
|
62766
|
+
return;
|
|
62767
|
+
}
|
|
62768
|
+
const parent2 = parentField(ancestors);
|
|
62769
|
+
if (!parent2 || ["OperationDefinition", "FragmentDefinition"].includes(parent2.kind)) {
|
|
62770
|
+
return;
|
|
62771
|
+
}
|
|
62772
|
+
const parentLoading = parent2.directives?.find(
|
|
62773
|
+
(d) => d.name.value === config2.loadingDirective
|
|
62774
|
+
);
|
|
62775
|
+
if (!parentLoading && !global2) {
|
|
62776
|
+
ctx.reportError(
|
|
62777
|
+
new graphql24.GraphQLError(
|
|
62778
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
62779
|
+
)
|
|
62780
|
+
);
|
|
62781
|
+
}
|
|
62782
|
+
},
|
|
62761
62783
|
Field(node, _, __, ___, ancestors) {
|
|
62762
62784
|
const loadingDirective = node.directives?.find(
|
|
62763
62785
|
(d) => d.name.value === config2.loadingDirective
|
|
@@ -62775,7 +62797,7 @@ function validateLoadingDirective(config2) {
|
|
|
62775
62797
|
if (!parentLoading && !global2) {
|
|
62776
62798
|
ctx.reportError(
|
|
62777
62799
|
new graphql24.GraphQLError(
|
|
62778
|
-
`@${config2.loadingDirective} can only be applied on a field at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
62800
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
62779
62801
|
)
|
|
62780
62802
|
);
|
|
62781
62803
|
}
|
package/build/lib-cjs/index.js
CHANGED
|
@@ -67483,7 +67483,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
67483
67483
|
// src/lib/parse.ts
|
|
67484
67484
|
async function parseJS(str, config) {
|
|
67485
67485
|
const defaultConfig = {
|
|
67486
|
-
plugins: ["typescript", "importAssertions"],
|
|
67486
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
67487
67487
|
sourceType: "module"
|
|
67488
67488
|
};
|
|
67489
67489
|
return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
|
package/build/lib-esm/index.js
CHANGED
|
@@ -67424,7 +67424,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
67424
67424
|
// src/lib/parse.ts
|
|
67425
67425
|
async function parseJS(str, config) {
|
|
67426
67426
|
const defaultConfig = {
|
|
67427
|
-
plugins: ["typescript", "importAssertions"],
|
|
67427
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
67428
67428
|
sourceType: "module"
|
|
67429
67429
|
};
|
|
67430
67430
|
return (0, import_parser.parse)(str || "", config ? deepMerge2("", defaultConfig, config) : defaultConfig).program;
|
package/build/test-cjs/index.js
CHANGED
|
@@ -57592,7 +57592,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
57592
57592
|
// src/lib/parse.ts
|
|
57593
57593
|
async function parseJS(str, config2) {
|
|
57594
57594
|
const defaultConfig = {
|
|
57595
|
-
plugins: ["typescript", "importAssertions"],
|
|
57595
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
57596
57596
|
sourceType: "module"
|
|
57597
57597
|
};
|
|
57598
57598
|
return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
|
|
@@ -63167,6 +63167,28 @@ function validateLoadingDirective(config2) {
|
|
|
63167
63167
|
}
|
|
63168
63168
|
}
|
|
63169
63169
|
},
|
|
63170
|
+
FragmentSpread(node, _, __, ___, ancestors) {
|
|
63171
|
+
const loadingDirective = node.directives?.find(
|
|
63172
|
+
(d) => d.name.value === config2.loadingDirective
|
|
63173
|
+
);
|
|
63174
|
+
if (!loadingDirective) {
|
|
63175
|
+
return;
|
|
63176
|
+
}
|
|
63177
|
+
const parent2 = parentField(ancestors);
|
|
63178
|
+
if (!parent2 || ["OperationDefinition", "FragmentDefinition"].includes(parent2.kind)) {
|
|
63179
|
+
return;
|
|
63180
|
+
}
|
|
63181
|
+
const parentLoading = parent2.directives?.find(
|
|
63182
|
+
(d) => d.name.value === config2.loadingDirective
|
|
63183
|
+
);
|
|
63184
|
+
if (!parentLoading && !global2) {
|
|
63185
|
+
ctx.reportError(
|
|
63186
|
+
new graphql23.GraphQLError(
|
|
63187
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
63188
|
+
)
|
|
63189
|
+
);
|
|
63190
|
+
}
|
|
63191
|
+
},
|
|
63170
63192
|
Field(node, _, __, ___, ancestors) {
|
|
63171
63193
|
const loadingDirective = node.directives?.find(
|
|
63172
63194
|
(d) => d.name.value === config2.loadingDirective
|
|
@@ -63184,7 +63206,7 @@ function validateLoadingDirective(config2) {
|
|
|
63184
63206
|
if (!parentLoading && !global2) {
|
|
63185
63207
|
ctx.reportError(
|
|
63186
63208
|
new graphql23.GraphQLError(
|
|
63187
|
-
`@${config2.loadingDirective} can only be applied on a field at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
63209
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
63188
63210
|
)
|
|
63189
63211
|
);
|
|
63190
63212
|
}
|
package/build/test-esm/index.js
CHANGED
|
@@ -57587,7 +57587,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
57587
57587
|
// src/lib/parse.ts
|
|
57588
57588
|
async function parseJS(str, config2) {
|
|
57589
57589
|
const defaultConfig = {
|
|
57590
|
-
plugins: ["typescript", "importAssertions"],
|
|
57590
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
57591
57591
|
sourceType: "module"
|
|
57592
57592
|
};
|
|
57593
57593
|
return (0, import_parser.parse)(str || "", config2 ? deepMerge2("", defaultConfig, config2) : defaultConfig).program;
|
|
@@ -63162,6 +63162,28 @@ function validateLoadingDirective(config2) {
|
|
|
63162
63162
|
}
|
|
63163
63163
|
}
|
|
63164
63164
|
},
|
|
63165
|
+
FragmentSpread(node, _, __, ___, ancestors) {
|
|
63166
|
+
const loadingDirective = node.directives?.find(
|
|
63167
|
+
(d) => d.name.value === config2.loadingDirective
|
|
63168
|
+
);
|
|
63169
|
+
if (!loadingDirective) {
|
|
63170
|
+
return;
|
|
63171
|
+
}
|
|
63172
|
+
const parent2 = parentField(ancestors);
|
|
63173
|
+
if (!parent2 || ["OperationDefinition", "FragmentDefinition"].includes(parent2.kind)) {
|
|
63174
|
+
return;
|
|
63175
|
+
}
|
|
63176
|
+
const parentLoading = parent2.directives?.find(
|
|
63177
|
+
(d) => d.name.value === config2.loadingDirective
|
|
63178
|
+
);
|
|
63179
|
+
if (!parentLoading && !global2) {
|
|
63180
|
+
ctx.reportError(
|
|
63181
|
+
new graphql23.GraphQLError(
|
|
63182
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
63183
|
+
)
|
|
63184
|
+
);
|
|
63185
|
+
}
|
|
63186
|
+
},
|
|
63165
63187
|
Field(node, _, __, ___, ancestors) {
|
|
63166
63188
|
const loadingDirective = node.directives?.find(
|
|
63167
63189
|
(d) => d.name.value === config2.loadingDirective
|
|
@@ -63179,7 +63201,7 @@ function validateLoadingDirective(config2) {
|
|
|
63179
63201
|
if (!parentLoading && !global2) {
|
|
63180
63202
|
ctx.reportError(
|
|
63181
63203
|
new graphql23.GraphQLError(
|
|
63182
|
-
`@${config2.loadingDirective} can only be applied on a field at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
63204
|
+
`@${config2.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config2.loadingDirective}`
|
|
63183
63205
|
)
|
|
63184
63206
|
);
|
|
63185
63207
|
}
|
package/build/vite-cjs/index.js
CHANGED
|
@@ -70197,7 +70197,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
70197
70197
|
// src/lib/parse.ts
|
|
70198
70198
|
async function parseJS(str, config4) {
|
|
70199
70199
|
const defaultConfig = {
|
|
70200
|
-
plugins: ["typescript", "importAssertions"],
|
|
70200
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
70201
70201
|
sourceType: "module"
|
|
70202
70202
|
};
|
|
70203
70203
|
return (0, import_parser.parse)(str || "", config4 ? deepMerge2("", defaultConfig, config4) : defaultConfig).program;
|
|
@@ -75962,6 +75962,28 @@ function validateLoadingDirective(config4) {
|
|
|
75962
75962
|
}
|
|
75963
75963
|
}
|
|
75964
75964
|
},
|
|
75965
|
+
FragmentSpread(node, _, __, ___, ancestors) {
|
|
75966
|
+
const loadingDirective = node.directives?.find(
|
|
75967
|
+
(d) => d.name.value === config4.loadingDirective
|
|
75968
|
+
);
|
|
75969
|
+
if (!loadingDirective) {
|
|
75970
|
+
return;
|
|
75971
|
+
}
|
|
75972
|
+
const parent2 = parentField(ancestors);
|
|
75973
|
+
if (!parent2 || ["OperationDefinition", "FragmentDefinition"].includes(parent2.kind)) {
|
|
75974
|
+
return;
|
|
75975
|
+
}
|
|
75976
|
+
const parentLoading = parent2.directives?.find(
|
|
75977
|
+
(d) => d.name.value === config4.loadingDirective
|
|
75978
|
+
);
|
|
75979
|
+
if (!parentLoading && !global2) {
|
|
75980
|
+
ctx.reportError(
|
|
75981
|
+
new graphql25.GraphQLError(
|
|
75982
|
+
`@${config4.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config4.loadingDirective}`
|
|
75983
|
+
)
|
|
75984
|
+
);
|
|
75985
|
+
}
|
|
75986
|
+
},
|
|
75965
75987
|
Field(node, _, __, ___, ancestors) {
|
|
75966
75988
|
const loadingDirective = node.directives?.find(
|
|
75967
75989
|
(d) => d.name.value === config4.loadingDirective
|
|
@@ -75979,7 +76001,7 @@ function validateLoadingDirective(config4) {
|
|
|
75979
76001
|
if (!parentLoading && !global2) {
|
|
75980
76002
|
ctx.reportError(
|
|
75981
76003
|
new graphql25.GraphQLError(
|
|
75982
|
-
`@${config4.loadingDirective} can only be applied on a field at the root of a document or on one whose parent also has @${config4.loadingDirective}`
|
|
76004
|
+
`@${config4.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config4.loadingDirective}`
|
|
75983
76005
|
)
|
|
75984
76006
|
);
|
|
75985
76007
|
}
|
package/build/vite-esm/index.js
CHANGED
|
@@ -70191,7 +70191,7 @@ function deepMerge2(filepath, ...targets) {
|
|
|
70191
70191
|
// src/lib/parse.ts
|
|
70192
70192
|
async function parseJS(str, config4) {
|
|
70193
70193
|
const defaultConfig = {
|
|
70194
|
-
plugins: ["typescript", "importAssertions"],
|
|
70194
|
+
plugins: ["typescript", "importAssertions", "jsx"],
|
|
70195
70195
|
sourceType: "module"
|
|
70196
70196
|
};
|
|
70197
70197
|
return (0, import_parser.parse)(str || "", config4 ? deepMerge2("", defaultConfig, config4) : defaultConfig).program;
|
|
@@ -75956,6 +75956,28 @@ function validateLoadingDirective(config4) {
|
|
|
75956
75956
|
}
|
|
75957
75957
|
}
|
|
75958
75958
|
},
|
|
75959
|
+
FragmentSpread(node, _, __, ___, ancestors) {
|
|
75960
|
+
const loadingDirective = node.directives?.find(
|
|
75961
|
+
(d) => d.name.value === config4.loadingDirective
|
|
75962
|
+
);
|
|
75963
|
+
if (!loadingDirective) {
|
|
75964
|
+
return;
|
|
75965
|
+
}
|
|
75966
|
+
const parent2 = parentField(ancestors);
|
|
75967
|
+
if (!parent2 || ["OperationDefinition", "FragmentDefinition"].includes(parent2.kind)) {
|
|
75968
|
+
return;
|
|
75969
|
+
}
|
|
75970
|
+
const parentLoading = parent2.directives?.find(
|
|
75971
|
+
(d) => d.name.value === config4.loadingDirective
|
|
75972
|
+
);
|
|
75973
|
+
if (!parentLoading && !global2) {
|
|
75974
|
+
ctx.reportError(
|
|
75975
|
+
new graphql25.GraphQLError(
|
|
75976
|
+
`@${config4.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config4.loadingDirective}`
|
|
75977
|
+
)
|
|
75978
|
+
);
|
|
75979
|
+
}
|
|
75980
|
+
},
|
|
75959
75981
|
Field(node, _, __, ___, ancestors) {
|
|
75960
75982
|
const loadingDirective = node.directives?.find(
|
|
75961
75983
|
(d) => d.name.value === config4.loadingDirective
|
|
@@ -75973,7 +75995,7 @@ function validateLoadingDirective(config4) {
|
|
|
75973
75995
|
if (!parentLoading && !global2) {
|
|
75974
75996
|
ctx.reportError(
|
|
75975
75997
|
new graphql25.GraphQLError(
|
|
75976
|
-
`@${config4.loadingDirective} can only be applied on a field at the root of a document or on one whose parent also has @${config4.loadingDirective}`
|
|
75998
|
+
`@${config4.loadingDirective} can only be applied on a field or fragment spread at the root of a document or on one whose parent also has @${config4.loadingDirective}`
|
|
75977
75999
|
)
|
|
75978
76000
|
);
|
|
75979
76001
|
}
|