nuxt-graphql-middleware 5.0.0-alpha.9 → 5.0.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.
Files changed (51) hide show
  1. package/README.md +101 -19
  2. package/dist/client/200.html +8 -8
  3. package/dist/client/404.html +8 -8
  4. package/dist/client/_nuxt/{CPyoLiCY.js → BM34SYth.js} +1 -1
  5. package/dist/client/_nuxt/CROlboVl.js +1 -0
  6. package/dist/client/_nuxt/D5hBL5aZ.js +25 -0
  7. package/dist/client/_nuxt/{BLvMh1Ga.js → FTbv7CO6.js} +1 -1
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/83f9fcd5-bd28-4608-b499-05e08fe0f7d0.json +1 -0
  10. package/dist/client/_nuxt/error-404.ehK72JOs.css +1 -0
  11. package/dist/client/_nuxt/error-500._g0akJim.css +1 -0
  12. package/dist/client/_nuxt/{C9pb_2rp.js → lIgCBhS_.js} +2 -2
  13. package/dist/client/index.html +8 -8
  14. package/dist/client-options.d.mts +6 -0
  15. package/dist/client-options.mjs +5 -0
  16. package/dist/module.d.mts +63 -181
  17. package/dist/module.json +3 -3
  18. package/dist/module.mjs +338 -90
  19. package/dist/runtime/components/CodeFrame.vue +19 -28
  20. package/dist/runtime/components/CodeFrame.vue.d.ts +7 -0
  21. package/dist/runtime/components/DevModeOverlay.vue +25 -33
  22. package/dist/runtime/components/DevModeOverlay.vue.d.ts +3 -0
  23. package/dist/runtime/components/ErrorExtensions.vue +9 -11
  24. package/dist/runtime/components/ErrorExtensions.vue.d.ts +5 -0
  25. package/dist/runtime/components/ErrorGroup.vue +28 -39
  26. package/dist/runtime/components/ErrorGroup.vue.d.ts +9 -0
  27. package/dist/runtime/server/api/mutation.js +2 -1
  28. package/dist/runtime/server/api/query.js +2 -1
  29. package/dist/runtime/server/utils/doGraphqlRequest.js +5 -4
  30. package/dist/runtime/types.d.ts +2 -2
  31. package/dist/server-options.d.mts +8 -0
  32. package/dist/server-options.mjs +5 -0
  33. package/dist/shared/nuxt-graphql-middleware.cXfDI4U3.d.mts +517 -0
  34. package/dist/types.d.mts +1 -7
  35. package/dist/utils.d.mts +15 -0
  36. package/dist/utils.mjs +18 -0
  37. package/package.json +34 -30
  38. package/dist/client/_nuxt/CBwfSTyQ.js +0 -1
  39. package/dist/client/_nuxt/VpkRx2_e.js +0 -25
  40. package/dist/client/_nuxt/builds/meta/826a43da-d42c-4fbf-8dfd-2572141eaf8f.json +0 -1
  41. package/dist/client/_nuxt/error-404.BJkSn6RI.css +0 -1
  42. package/dist/client/_nuxt/error-500.TOCKLquH.css +0 -1
  43. package/dist/module.cjs +0 -5
  44. package/dist/module.d.ts +0 -210
  45. package/dist/runtime/clientOptions/index.d.ts +0 -2
  46. package/dist/runtime/clientOptions/index.js +0 -3
  47. package/dist/runtime/serverOptions/defineGraphqlServerOptions.d.ts +0 -4
  48. package/dist/runtime/serverOptions/defineGraphqlServerOptions.js +0 -3
  49. package/dist/runtime/serverOptions/index.d.ts +0 -2
  50. package/dist/runtime/serverOptions/index.js +0 -2
  51. package/dist/types.d.ts +0 -7
package/dist/module.d.ts DELETED
@@ -1,210 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
- import { HookResult } from 'nuxt/schema';
3
- import { OperationResponseError } from '../dist/runtime/types.js';
4
- export { GraphqlMiddlewareServerOptions } from '../dist/runtime/types.js';
5
- import { Types } from '@graphql-codegen/plugin-helpers';
6
- import { SchemaASTConfig } from '@graphql-codegen/schema-ast';
7
- import { GeneratorOptions } from 'graphql-typescript-deluxe';
8
-
9
- interface ModuleOptions {
10
- /**
11
- * File glob patterns for the auto import feature.
12
- *
13
- * If left empty, no documents are auto imported.
14
- *
15
- * @default
16
- * ```json
17
- * ["**\/.{gql,graphql}", "!node_modules"]
18
- * ```
19
- *
20
- * @example
21
- * ```ts
22
- * // Load .graphql files from pages folder and from a node_modules dependency.
23
- * const autoImportPatterns = [
24
- * './pages/**\/*.graphql',
25
- * 'node_modules/my_library/dist/**\/*.graphql'
26
- * ]
27
- * ```
28
- */
29
- autoImportPatterns?: string[];
30
- /**
31
- * The path where your graphql.config.ts is, relative to the location of nuxt.config.ts.
32
- *
33
- * Used to generate the correct paths in the graphql.config.ts file generated by the module.
34
- *
35
- * @default "./graphql.config.ts"
36
- */
37
- graphqlConfigFilePath?: string;
38
- /**
39
- * Additional raw documents to include.
40
- *
41
- * Useful if for example you need to generate queries during build time.
42
- *
43
- * @default []
44
- *
45
- * @example
46
- * ```ts
47
- * const documents = [`
48
- * query myQuery {
49
- * articles {
50
- * title
51
- * id
52
- * }
53
- * }`,
54
- * ...getGeneratedDocuments()
55
- * ]
56
- * ```
57
- */
58
- documents?: string[];
59
- /**
60
- * Wether the useGraphqlQuery, useGraphqlMutation and useGraphqlState
61
- * composables should be included.
62
- *
63
- * @default ```ts
64
- * true
65
- * ```
66
- */
67
- includeComposables?: boolean;
68
- /**
69
- * Enable support for uploading files via GraphQL.
70
- *
71
- * When enabled, an additional `useGraphqlUploadMutation` composable is
72
- * included, in addition to a new server endpoint that handles multi part
73
- * file uploads for GraphQL mutations.
74
- */
75
- enableFileUploads?: boolean;
76
- /**
77
- * Enable detailled debugging messages.
78
- *
79
- * @default false
80
- */
81
- debug?: boolean;
82
- /**
83
- * Displays GraphQL response errors in an overlay in dev mode.
84
- */
85
- errorOverlay?: boolean;
86
- /**
87
- * The URL of the GraphQL server.
88
- *
89
- * For the runtime execution you can provide a method that determines the endpoint
90
- * during runtime. See the server/graphqlMiddleware.serverOptions.ts documentation
91
- * for more information.
92
- */
93
- graphqlEndpoint: string;
94
- /**
95
- * Download the GraphQL schema and store it on disk.
96
- *
97
- * Usually you'll want to only enable this during dev mode.
98
- *
99
- * @default true
100
- */
101
- downloadSchema?: boolean;
102
- /**
103
- * Path to the GraphQL schema file.
104
- *
105
- * If `downloadSchema` is `true`, the downloaded schema is written to this specified path.
106
- * If `downloadSchema` is `false`, this file must be present in order to generate types.
107
- *
108
- * @default './schema.graphql'
109
- */
110
- schemaPath?: string;
111
- /**
112
- * The prefix for the server route.
113
- *
114
- * @default ```ts
115
- * "/api/graphql_middleware"
116
- * ```
117
- */
118
- serverApiPrefix?: string;
119
- /**
120
- * Logs only errors.
121
- *
122
- * When enabled only errors are logged to the console when generating the GraphQL operations.
123
- * If false, all operations are logged, including valid ones.
124
- */
125
- logOnlyErrors?: boolean;
126
- /**
127
- * Options for graphql-typescript-deluxe code generator.
128
- */
129
- codegenConfig?: GeneratorOptions;
130
- /**
131
- * Configuration for graphql-codegen when downloading the schema.
132
- */
133
- codegenSchemaConfig?: {
134
- /**
135
- * Configure how the schema.graphql file should be generated.
136
- */
137
- schemaAstConfig?: SchemaASTConfig;
138
- /**
139
- * Configure how the schema-ast introspection request should be made.
140
- *
141
- * Usually this is where you can provide a custom authentication header:
142
- *
143
- * ```typescript
144
- * const codegenSchemaConfig = {
145
- * urlSchemaOptions: {
146
- * headers: {
147
- * authentication: 'foobar',
148
- * }
149
- * }
150
- * }
151
- * ```
152
- */
153
- urlSchemaOptions?: Types.UrlSchemaOptions;
154
- };
155
- /**
156
- * Set to true if you want to output each compiled query and mutation in the
157
- * .nuxt folder.
158
- * Set to a path to output to a custom path.
159
- */
160
- outputDocuments?: boolean | string;
161
- /**
162
- * Enable Nuxt DevTools integration.
163
- */
164
- devtools?: boolean;
165
- /**
166
- * Client caching configuration.
167
- */
168
- clientCache?: {
169
- enabled?: boolean;
170
- maxSize?: number;
171
- };
172
- }
173
-
174
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
175
-
176
- declare module '@nuxt/schema' {
177
- interface AppConfig {
178
- graphqlMiddleware: {
179
- /**
180
- * Whether the client cache is enabled.
181
- */
182
- clientCacheEnabled: boolean;
183
- /**
184
- * The max number of items in the cache.
185
- */
186
- clientCacheMaxSize: number;
187
- };
188
- }
189
- }
190
- declare module '#app' {
191
- interface RuntimeNuxtHooks {
192
- /**
193
- * Emitted when any GraphQL response contains errors.
194
- */
195
- 'nuxt-graphql-middleware:errors': (errors: OperationResponseError) => HookResult;
196
- }
197
- }
198
- declare module 'vite/types/customEvent.d.ts' {
199
- interface CustomEventMap {
200
- /**
201
- * Emitted when GraphQL operations have been updated.
202
- */
203
- 'nuxt-graphql-middleware:reload': {
204
- operations: string[];
205
- };
206
- }
207
- }
208
-
209
- export { _default as default };
210
- export type { ModuleOptions };
@@ -1,2 +0,0 @@
1
- import type { GraphqlClientOptions, ContextType } from './../types.js';
2
- export declare function defineGraphqlClientOptions<T extends ContextType>(options: GraphqlClientOptions<T>): GraphqlClientOptions<T>;
@@ -1,3 +0,0 @@
1
- export function defineGraphqlClientOptions(options) {
2
- return options;
3
- }
@@ -1,4 +0,0 @@
1
- import type { GraphqlClientContext } from '#nuxt-graphql-middleware/client-options';
2
- import type { GraphqlMiddlewareResponseUnion } from '#nuxt-graphql-middleware/response';
3
- import type { GraphqlMiddlewareServerOptions } from './../types.js';
4
- export declare function defineGraphqlServerOptions<T extends object>(options: GraphqlMiddlewareServerOptions<T, GraphqlMiddlewareResponseUnion, GraphqlClientContext>): GraphqlMiddlewareServerOptions<T, GraphqlMiddlewareResponseUnion, GraphqlClientContext>;
@@ -1,3 +0,0 @@
1
- export function defineGraphqlServerOptions(options) {
2
- return options;
3
- }
@@ -1,2 +0,0 @@
1
- import { defineGraphqlServerOptions } from './defineGraphqlServerOptions.js';
2
- export { defineGraphqlServerOptions };
@@ -1,2 +0,0 @@
1
- import { defineGraphqlServerOptions } from "./defineGraphqlServerOptions.js";
2
- export { defineGraphqlServerOptions };
package/dist/types.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { NuxtModule } from '@nuxt/schema'
2
-
3
- import type { default as Module } from './module'
4
-
5
- export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
6
-
7
- export { type GraphqlMiddlewareServerOptions } from './module'