nuxt-graphql-middleware 5.3.1 → 5.3.2
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/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/2c5ed43d-9467-443e-93e6-e7235fa0768c.json +1 -0
- package/dist/client/index.html +1 -1
- package/dist/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +14 -5
- package/dist/shared/{nuxt-graphql-middleware.COufMnWs.d.mts → nuxt-graphql-middleware.B34q074V.d.mts} +10 -3
- package/dist/utils.d.mts +1 -1
- package/package.json +1 -1
- package/dist/client/_nuxt/builds/meta/efa6c0a0-833e-4e5a-bc2d-ba9d0d3e4562.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cyocd7ae.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js"><script type="module" src="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cyocd7ae.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js"><script type="module" src="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767614393800,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"2c5ed43d-9467-443e-93e6-e7235fa0768c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cyocd7ae.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js"><script type="module" src="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cyocd7ae.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js"><script type="module" src="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767614393800,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"2c5ed43d-9467-443e-93e6-e7235fa0768c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"2c5ed43d-9467-443e-93e6-e7235fa0768c","timestamp":1767614391495}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"2c5ed43d-9467-443e-93e6-e7235fa0768c","timestamp":1767614391495,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cyocd7ae.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js"><script type="module" src="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cyocd7ae.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js"><script type="module" src="/__nuxt-graphql-middleware/_nuxt/DrXVleME.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1767614393800,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"2c5ed43d-9467-443e-93e6-e7235fa0768c",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import { M as ModuleContext, a as ModuleOptions } from './shared/nuxt-graphql-middleware.
|
|
2
|
+
import { M as ModuleContext, a as ModuleOptions } from './shared/nuxt-graphql-middleware.B34q074V.mjs';
|
|
3
3
|
import { OperationResponseError } from '../dist/runtime/types.js';
|
|
4
4
|
import { HookResult } from 'nuxt/schema';
|
|
5
5
|
import { GeneratorOutput } from 'graphql-typescript-deluxe';
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -21,7 +21,7 @@ import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
|
|
|
21
21
|
import { defineEventHandler, readBody, createError } from 'h3';
|
|
22
22
|
|
|
23
23
|
const name = "nuxt-graphql-middleware";
|
|
24
|
-
const version = "5.3.
|
|
24
|
+
const version = "5.3.2";
|
|
25
25
|
|
|
26
26
|
const logger = useLogger("nuxt-graphql-middleware");
|
|
27
27
|
const defaultOptions = {
|
|
@@ -715,7 +715,7 @@ class SchemaProvider {
|
|
|
715
715
|
}
|
|
716
716
|
async loadFromDiskFallback() {
|
|
717
717
|
const hasSchemaOnDisk = await this.hasSchemaOnDisk();
|
|
718
|
-
if (this.helper.isDev && hasSchemaOnDisk && this.helper.
|
|
718
|
+
if (this.helper.isDev && hasSchemaOnDisk && this.helper.shouldDownloadSchema()) {
|
|
719
719
|
const shouldUseFromDisk = await this.helper.prompt.confirm(
|
|
720
720
|
"Do you want to continue with the previously downloaded schema from disk?"
|
|
721
721
|
);
|
|
@@ -796,9 +796,9 @@ class SchemaProvider {
|
|
|
796
796
|
* @param forceDownload - Forces downloading the schema.
|
|
797
797
|
*/
|
|
798
798
|
async loadSchema(opts) {
|
|
799
|
-
if (opts?.forceDisk
|
|
799
|
+
if (opts?.forceDisk) {
|
|
800
800
|
this.schemaContent = await this.loadSchemaFromDisk();
|
|
801
|
-
} else if (this.helper.
|
|
801
|
+
} else if (this.helper.shouldDownloadSchema() || opts?.forceDownload) {
|
|
802
802
|
this.schemaContent = await this.downloadSchema();
|
|
803
803
|
} else {
|
|
804
804
|
this.schemaContent = await this.loadSchemaFromDisk();
|
|
@@ -959,6 +959,7 @@ class ModuleHelper {
|
|
|
959
959
|
constructor(nuxt, moduleUrl, options) {
|
|
960
960
|
this.nuxt = nuxt;
|
|
961
961
|
this.isPrepare = nuxt.options._prepare;
|
|
962
|
+
this.isDev = nuxt.options.dev;
|
|
962
963
|
const mergedOptions = defu(
|
|
963
964
|
{},
|
|
964
965
|
options,
|
|
@@ -1007,7 +1008,6 @@ class ModuleHelper {
|
|
|
1007
1008
|
if (!nuxt.options._prepare) {
|
|
1008
1009
|
validateOptions(this.options);
|
|
1009
1010
|
}
|
|
1010
|
-
this.isDev = nuxt.options.dev;
|
|
1011
1011
|
this.resolvers = {
|
|
1012
1012
|
module: createResolver(moduleUrl),
|
|
1013
1013
|
server: createResolver(nuxt.options.serverDir),
|
|
@@ -1041,6 +1041,15 @@ class ModuleHelper {
|
|
|
1041
1041
|
prompt = new ConsolePrompt();
|
|
1042
1042
|
nitroExternals = [];
|
|
1043
1043
|
tsPaths = {};
|
|
1044
|
+
/**
|
|
1045
|
+
* Whether the schema should be downloaded.
|
|
1046
|
+
*/
|
|
1047
|
+
shouldDownloadSchema() {
|
|
1048
|
+
if (this.options.downloadSchema === "dev-only") {
|
|
1049
|
+
return this.isDev;
|
|
1050
|
+
}
|
|
1051
|
+
return this.options.downloadSchema;
|
|
1052
|
+
}
|
|
1044
1053
|
/**
|
|
1045
1054
|
* Find the path to the graphqlMiddleware.serverOptions.ts file.
|
|
1046
1055
|
*/
|
|
@@ -104,13 +104,16 @@ interface ModuleOptions {
|
|
|
104
104
|
*/
|
|
105
105
|
graphqlEndpoint?: string;
|
|
106
106
|
/**
|
|
107
|
-
*
|
|
107
|
+
* Whether to download the GraphQL schema and store it on disk.
|
|
108
108
|
*
|
|
109
|
-
*
|
|
109
|
+
* - `false` The GraphQL schema must exist on disk for the module to work.
|
|
110
|
+
* - `true` The GraphQL schema will be downloaded and stored on disk.
|
|
111
|
+
* - `'dev-only'` When running `npm run dev` the schema is downloaded,
|
|
112
|
+
* otherwise it is read from disk.
|
|
110
113
|
*
|
|
111
114
|
* @default true
|
|
112
115
|
*/
|
|
113
|
-
downloadSchema?: boolean;
|
|
116
|
+
downloadSchema?: boolean | 'dev-only';
|
|
114
117
|
/**
|
|
115
118
|
* Path to the GraphQL schema file.
|
|
116
119
|
*
|
|
@@ -349,6 +352,10 @@ declare class ModuleHelper {
|
|
|
349
352
|
private nitroExternals;
|
|
350
353
|
private tsPaths;
|
|
351
354
|
constructor(nuxt: Nuxt, moduleUrl: string, options: ModuleOptions);
|
|
355
|
+
/**
|
|
356
|
+
* Whether the schema should be downloaded.
|
|
357
|
+
*/
|
|
358
|
+
shouldDownloadSchema(): boolean;
|
|
352
359
|
/**
|
|
353
360
|
* Find the path to the graphqlMiddleware.serverOptions.ts file.
|
|
354
361
|
*/
|
package/dist/utils.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"efa6c0a0-833e-4e5a-bc2d-ba9d0d3e4562","timestamp":1766498304481,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|