nitro-graphql 2.0.0-beta.13 → 2.0.0-beta.15
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.
|
@@ -78,7 +78,7 @@ function shouldGenerateClientUtils(nitro) {
|
|
|
78
78
|
const clientUtilsConfig = nitro.options.graphql?.clientUtils;
|
|
79
79
|
if (clientUtilsConfig === false) return false;
|
|
80
80
|
if (clientUtilsConfig && clientUtilsConfig.enabled === false) return false;
|
|
81
|
-
return
|
|
81
|
+
return true;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Get client utilities configuration (handles false case)
|
|
@@ -298,11 +298,9 @@ async function generateMainClientTypes(nitro) {
|
|
|
298
298
|
writeFileSync(sdkPath, types.sdk, "utf-8");
|
|
299
299
|
consola.success(`[nitro-graphql] Generated SDK at: ${sdkPath}`);
|
|
300
300
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
generateGraphQLIndexFile(nitro, nitro.graphql.clientDir, externalServices);
|
|
305
|
-
}
|
|
301
|
+
generateNuxtOfetchClient(nitro, nitro.graphql.clientDir, "default");
|
|
302
|
+
const externalServices = nitro.options.graphql?.externalServices || [];
|
|
303
|
+
if (externalServices.length > 0) generateGraphQLIndexFile(nitro, nitro.graphql.clientDir, externalServices);
|
|
306
304
|
}
|
|
307
305
|
async function generateExternalServicesTypes(nitro) {
|
|
308
306
|
const externalServices = nitro.options.graphql?.externalServices || [];
|
|
@@ -349,7 +347,7 @@ async function generateExternalServicesTypes(nitro) {
|
|
|
349
347
|
writeFileSync(serviceSdkPath, types.sdk, "utf-8");
|
|
350
348
|
consola.success(`[graphql:${service.name}] Generated SDK at: ${serviceSdkPath}`);
|
|
351
349
|
}
|
|
352
|
-
|
|
350
|
+
generateExternalOfetchClient(nitro, service, service.endpoint);
|
|
353
351
|
consola.success(`[graphql:${service.name}] External service types generated successfully`);
|
|
354
352
|
} catch (error) {
|
|
355
353
|
consola.error(`[graphql:${service.name}] External service generation failed:`, error);
|