@wpnuxt/core 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import ts from 'typescript';
|
|
|
9
9
|
import { execSync } from 'node:child_process';
|
|
10
10
|
import { consola } from 'consola';
|
|
11
11
|
|
|
12
|
-
const version = "2.3.
|
|
12
|
+
const version = "2.3.1";
|
|
13
13
|
|
|
14
14
|
const DEFAULT_CPT_EXCLUSIONS = [
|
|
15
15
|
"Post",
|
|
@@ -826,7 +826,25 @@ async function checkWPGraphQLVersion(fullUrl, headers) {
|
|
|
826
826
|
clearTimeout(timeout);
|
|
827
827
|
if (!response.ok) return;
|
|
828
828
|
const data = await response.json();
|
|
829
|
-
const
|
|
829
|
+
const errorMessage = data?.errors?.[0]?.message || "";
|
|
830
|
+
if (/introspection/i.test(errorMessage)) {
|
|
831
|
+
throw new Error(
|
|
832
|
+
`[wpnuxt:core] WPGraphQL Public Introspection is disabled on this endpoint.
|
|
833
|
+
|
|
834
|
+
URL: ${fullUrl}
|
|
835
|
+
|
|
836
|
+
WPNuxt needs introspection to validate the schema and generate types.
|
|
837
|
+
|
|
838
|
+
To fix:
|
|
839
|
+
- Enable "Enable Public Introspection" under WPGraphQL \u2192 Settings in the WordPress admin.
|
|
840
|
+
- Or provide authenticated credentials that are permitted to introspect the schema.
|
|
841
|
+
|
|
842
|
+
WPGraphQL error: ${errorMessage}`
|
|
843
|
+
);
|
|
844
|
+
}
|
|
845
|
+
const type = data?.data?.__type;
|
|
846
|
+
if (!type) return;
|
|
847
|
+
const fields = type.fields || [];
|
|
830
848
|
const hasFilePath = fields.some((f) => f.name === "filePath");
|
|
831
849
|
if (!hasFilePath) {
|
|
832
850
|
throw new Error(
|