nuxt-graphql-middleware 5.0.0-alpha.4 → 5.0.0-alpha.5
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 +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c22c2916-33e9-427d-b6fe-10f11766c207.json +1 -0
- package/dist/client/index.html +2 -2
- package/dist/module.d.mts +15 -5
- package/dist/module.d.ts +15 -5
- package/dist/module.json +2 -2
- package/dist/module.mjs +228 -207
- package/dist/runtime/components/CodeFrame.vue +61 -0
- package/dist/runtime/components/DevModeOverlay.vue +60 -0
- package/dist/runtime/components/ErrorExtensions.vue +23 -0
- package/dist/runtime/components/ErrorGroup.vue +89 -0
- package/dist/runtime/composables/nuxtApp.d.ts +2 -2
- package/dist/runtime/composables/nuxtApp.js +19 -18
- package/dist/runtime/composables/useAsyncGraphqlQuery.d.ts +7 -7
- package/dist/runtime/composables/useAsyncGraphqlQuery.js +1 -1
- package/dist/runtime/composables/useGraphqlMutation.d.ts +4 -4
- package/dist/runtime/composables/useGraphqlMutation.js +1 -1
- package/dist/runtime/composables/useGraphqlQuery.d.ts +4 -4
- package/dist/runtime/composables/useGraphqlQuery.js +1 -1
- package/dist/runtime/composables/useGraphqlState.d.ts +1 -1
- package/dist/runtime/composables/useGraphqlUploadMutation.d.ts +4 -4
- package/dist/runtime/composables/useGraphqlUploadMutation.js +2 -2
- package/dist/runtime/css/output.css +1 -0
- package/dist/runtime/helpers/composables.d.ts +17 -20
- package/dist/runtime/helpers/composables.js +0 -5
- package/dist/runtime/plugins/devMode.d.ts +2 -0
- package/dist/runtime/plugins/devMode.js +23 -0
- package/dist/runtime/plugins/provideState.d.ts +1 -1
- package/dist/runtime/server/utils/index.d.ts +1 -1
- package/dist/runtime/server/utils/index.js +1 -1
- package/dist/runtime/server/utils/useGraphqlMutation.d.ts +4 -4
- package/dist/runtime/server/utils/useGraphqlQuery.d.ts +4 -4
- package/dist/runtime/serverHandler/debug.js +3 -7
- package/dist/runtime/serverHandler/helpers/index.d.ts +2 -2
- package/dist/runtime/serverHandler/index.js +4 -4
- package/dist/runtime/serverHandler/upload.js +4 -4
- package/dist/runtime/serverOptions/defineGraphqlServerOptions.d.ts +3 -2
- package/dist/runtime/settings/index.d.ts +24 -3
- package/dist/runtime/settings/index.js +8 -2
- package/dist/runtime/types.d.ts +8 -2
- package/package.json +14 -4
- package/dist/client/_nuxt/builds/meta/106a09af-649a-473b-b0c7-0e4ce5709429.json +0 -1
package/dist/client/200.html
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/exxdaCPN.js">
|
|
8
8
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500.TOCKLquH.css">
|
|
9
9
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/GOrnHr4p.js">
|
|
10
|
-
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/BS583yk8.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},
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"
|
|
10
|
+
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/BS583yk8.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},1741528547125,false]</script>
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"c22c2916-33e9-427d-b6fe-10f11766c207",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/exxdaCPN.js">
|
|
8
8
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500.TOCKLquH.css">
|
|
9
9
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/GOrnHr4p.js">
|
|
10
|
-
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/BS583yk8.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},
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"
|
|
10
|
+
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/BS583yk8.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},1741528547125,false]</script>
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"c22c2916-33e9-427d-b6fe-10f11766c207",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"c22c2916-33e9-427d-b6fe-10f11766c207","timestamp":1741528537815}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"c22c2916-33e9-427d-b6fe-10f11766c207","timestamp":1741528537815,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
package/dist/client/index.html
CHANGED
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/exxdaCPN.js">
|
|
8
8
|
<link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500.TOCKLquH.css">
|
|
9
9
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/GOrnHr4p.js">
|
|
10
|
-
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/BS583yk8.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},
|
|
11
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"
|
|
10
|
+
<script type="module" src="/__nuxt-graphql-middleware/_nuxt/BS583yk8.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},1741528547125,false]</script>
|
|
11
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"c22c2916-33e9-427d-b6fe-10f11766c207",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.d.mts
CHANGED
|
@@ -2,10 +2,10 @@ import * as _nuxt_schema from '@nuxt/schema';
|
|
|
2
2
|
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
3
3
|
import { SchemaASTConfig } from '@graphql-codegen/schema-ast';
|
|
4
4
|
import { GeneratorOptions } from 'graphql-typescript-deluxe';
|
|
5
|
+
import { HookResult } from 'nuxt/schema';
|
|
6
|
+
import { ContextType, GraphqlServerResponse, OperationResponseError } from '../dist/runtime/types.js';
|
|
5
7
|
import { H3Event } from 'h3';
|
|
6
8
|
import { FetchOptions, FetchResponse, FetchError } from 'ofetch';
|
|
7
|
-
import { ContextType, GraphqlServerResponse } from '#graphql-middleware/types';
|
|
8
|
-
import { GraphqlMiddlewareResponseUnion } from '#nuxt-graphql-middleware/generated-types';
|
|
9
9
|
|
|
10
10
|
type GraphqlMiddlewareRequestContext<C extends ContextType = ContextType> = {
|
|
11
11
|
client?: Partial<C>;
|
|
@@ -59,7 +59,7 @@ type GraphqlMiddlewareDoRequestMethod<T, C extends ContextType> = (context: Grap
|
|
|
59
59
|
/**
|
|
60
60
|
* Configuration options during runtime.
|
|
61
61
|
*/
|
|
62
|
-
type GraphqlMiddlewareServerOptions<Additions extends object = object, C extends ContextType = ContextType, CustomResponse = GraphqlServerResponse<
|
|
62
|
+
type GraphqlMiddlewareServerOptions<Additions extends object = object, ResponseUnion extends object = object, C extends ContextType = ContextType, CustomResponse = GraphqlServerResponse<ResponseUnion> & Additions> = {
|
|
63
63
|
/**
|
|
64
64
|
* Custom callback to return the GraphQL endpoint per request.
|
|
65
65
|
*
|
|
@@ -128,7 +128,7 @@ type GraphqlMiddlewareServerOptions<Additions extends object = object, C extends
|
|
|
128
128
|
* }
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
|
-
onServerResponse?: GraphqlMiddlewareOnServerResponseMethod<GraphqlServerResponse<
|
|
131
|
+
onServerResponse?: GraphqlMiddlewareOnServerResponseMethod<GraphqlServerResponse<ResponseUnion>, CustomResponse, C>;
|
|
132
132
|
/**
|
|
133
133
|
* Handle a fetch error from the GraphQL request.
|
|
134
134
|
*
|
|
@@ -264,6 +264,10 @@ interface ModuleOptions {
|
|
|
264
264
|
* @default false
|
|
265
265
|
*/
|
|
266
266
|
debug?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Displays GraphQL response errors in an overlay in dev mode.
|
|
269
|
+
*/
|
|
270
|
+
errorOverlay?: boolean;
|
|
267
271
|
/**
|
|
268
272
|
* The URL of the GraphQL server.
|
|
269
273
|
*
|
|
@@ -298,7 +302,8 @@ interface ModuleOptions {
|
|
|
298
302
|
/**
|
|
299
303
|
* Logs only errors.
|
|
300
304
|
*
|
|
301
|
-
* When enabled only errors are logged to the console.
|
|
305
|
+
* When enabled only errors are logged to the console when generating the GraphQL operations.
|
|
306
|
+
* If false, all operations are logged, including valid ones.
|
|
302
307
|
*/
|
|
303
308
|
logOnlyErrors?: boolean;
|
|
304
309
|
/**
|
|
@@ -360,5 +365,10 @@ declare module '@nuxt/schema' {
|
|
|
360
365
|
};
|
|
361
366
|
}
|
|
362
367
|
}
|
|
368
|
+
declare module '#app' {
|
|
369
|
+
interface RuntimeNuxtHooks {
|
|
370
|
+
'nuxt-graphql-middleware:errors': (errors: OperationResponseError) => HookResult;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
363
373
|
|
|
364
374
|
export { type GraphqlMiddlewareServerOptions, type ModuleHooks, type ModuleOptions, _default as default };
|
package/dist/module.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as _nuxt_schema from '@nuxt/schema';
|
|
|
2
2
|
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
3
3
|
import { SchemaASTConfig } from '@graphql-codegen/schema-ast';
|
|
4
4
|
import { GeneratorOptions } from 'graphql-typescript-deluxe';
|
|
5
|
+
import { HookResult } from 'nuxt/schema';
|
|
6
|
+
import { ContextType, GraphqlServerResponse, OperationResponseError } from '../dist/runtime/types.js';
|
|
5
7
|
import { H3Event } from 'h3';
|
|
6
8
|
import { FetchOptions, FetchResponse, FetchError } from 'ofetch';
|
|
7
|
-
import { ContextType, GraphqlServerResponse } from '#graphql-middleware/types';
|
|
8
|
-
import { GraphqlMiddlewareResponseUnion } from '#nuxt-graphql-middleware/generated-types';
|
|
9
9
|
|
|
10
10
|
type GraphqlMiddlewareRequestContext<C extends ContextType = ContextType> = {
|
|
11
11
|
client?: Partial<C>;
|
|
@@ -59,7 +59,7 @@ type GraphqlMiddlewareDoRequestMethod<T, C extends ContextType> = (context: Grap
|
|
|
59
59
|
/**
|
|
60
60
|
* Configuration options during runtime.
|
|
61
61
|
*/
|
|
62
|
-
type GraphqlMiddlewareServerOptions<Additions extends object = object, C extends ContextType = ContextType, CustomResponse = GraphqlServerResponse<
|
|
62
|
+
type GraphqlMiddlewareServerOptions<Additions extends object = object, ResponseUnion extends object = object, C extends ContextType = ContextType, CustomResponse = GraphqlServerResponse<ResponseUnion> & Additions> = {
|
|
63
63
|
/**
|
|
64
64
|
* Custom callback to return the GraphQL endpoint per request.
|
|
65
65
|
*
|
|
@@ -128,7 +128,7 @@ type GraphqlMiddlewareServerOptions<Additions extends object = object, C extends
|
|
|
128
128
|
* }
|
|
129
129
|
* ```
|
|
130
130
|
*/
|
|
131
|
-
onServerResponse?: GraphqlMiddlewareOnServerResponseMethod<GraphqlServerResponse<
|
|
131
|
+
onServerResponse?: GraphqlMiddlewareOnServerResponseMethod<GraphqlServerResponse<ResponseUnion>, CustomResponse, C>;
|
|
132
132
|
/**
|
|
133
133
|
* Handle a fetch error from the GraphQL request.
|
|
134
134
|
*
|
|
@@ -264,6 +264,10 @@ interface ModuleOptions {
|
|
|
264
264
|
* @default false
|
|
265
265
|
*/
|
|
266
266
|
debug?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Displays GraphQL response errors in an overlay in dev mode.
|
|
269
|
+
*/
|
|
270
|
+
errorOverlay?: boolean;
|
|
267
271
|
/**
|
|
268
272
|
* The URL of the GraphQL server.
|
|
269
273
|
*
|
|
@@ -298,7 +302,8 @@ interface ModuleOptions {
|
|
|
298
302
|
/**
|
|
299
303
|
* Logs only errors.
|
|
300
304
|
*
|
|
301
|
-
* When enabled only errors are logged to the console.
|
|
305
|
+
* When enabled only errors are logged to the console when generating the GraphQL operations.
|
|
306
|
+
* If false, all operations are logged, including valid ones.
|
|
302
307
|
*/
|
|
303
308
|
logOnlyErrors?: boolean;
|
|
304
309
|
/**
|
|
@@ -360,5 +365,10 @@ declare module '@nuxt/schema' {
|
|
|
360
365
|
};
|
|
361
366
|
}
|
|
362
367
|
}
|
|
368
|
+
declare module '#app' {
|
|
369
|
+
interface RuntimeNuxtHooks {
|
|
370
|
+
'nuxt-graphql-middleware:errors': (errors: OperationResponseError) => HookResult;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
363
373
|
|
|
364
374
|
export { type GraphqlMiddlewareServerOptions, type ModuleHooks, type ModuleOptions, _default as default };
|
package/dist/module.json
CHANGED