nuxt-graphql-middleware 5.0.0-alpha.6 → 5.0.0-alpha.8

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 (38) hide show
  1. package/dist/client/200.html +7 -7
  2. package/dist/client/404.html +7 -7
  3. package/dist/client/_nuxt/{BvMfLM9s.js → BLvMh1Ga.js} +1 -1
  4. package/dist/client/_nuxt/C9pb_2rp.js +2 -0
  5. package/dist/client/_nuxt/{DkAo05uu.js → CBwfSTyQ.js} +1 -1
  6. package/dist/client/_nuxt/{BtHrwWER.js → CPyoLiCY.js} +1 -1
  7. package/dist/client/_nuxt/{BawWjxPx.js → VpkRx2_e.js} +4 -4
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/c16b1fe3-c3fb-4c15-952d-ba148d4025cb.json +1 -0
  10. package/dist/client/_nuxt/entry.Cn9qfNGa.css +1 -0
  11. package/dist/client/_nuxt/index.DGEN-H8t.css +1 -0
  12. package/dist/client/index.html +7 -7
  13. package/dist/module.d.mts +4 -198
  14. package/dist/module.d.ts +4 -198
  15. package/dist/module.json +2 -2
  16. package/dist/module.mjs +333 -246
  17. package/dist/runtime/composables/useAsyncGraphqlQuery.d.ts +1 -1
  18. package/dist/runtime/composables/useGraphqlMutation.d.ts +1 -1
  19. package/dist/runtime/composables/useGraphqlQuery.d.ts +1 -1
  20. package/dist/runtime/composables/useGraphqlState.js +1 -1
  21. package/dist/runtime/composables/useGraphqlUploadMutation.d.ts +1 -1
  22. package/dist/runtime/helpers/composables.d.ts +1 -1
  23. package/dist/runtime/server/helpers/index.d.ts +3 -3
  24. package/dist/runtime/server/helpers/index.js +1 -1
  25. package/dist/runtime/server/utils/doGraphqlRequest.d.ts +1 -1
  26. package/dist/runtime/server/utils/useGraphqlMutation.d.ts +1 -1
  27. package/dist/runtime/server/utils/useGraphqlQuery.d.ts +1 -1
  28. package/dist/runtime/serverOptions/defineGraphqlServerOptions.d.ts +1 -1
  29. package/dist/runtime/settings/index.d.ts +0 -63
  30. package/dist/runtime/settings/index.js +0 -19
  31. package/dist/runtime/types.d.ts +196 -1
  32. package/dist/types.d.mts +5 -5
  33. package/dist/types.d.ts +5 -5
  34. package/package.json +24 -28
  35. package/dist/client/_nuxt/B4KMzhZo.js +0 -2
  36. package/dist/client/_nuxt/builds/meta/9b9c571e-ce30-465b-8174-06afbdca446b.json +0 -1
  37. package/dist/client/_nuxt/entry.AjgXSF89.css +0 -1
  38. package/dist/client/_nuxt/index.D19Q16VT.css +0 -1
@@ -0,0 +1 @@
1
+ .n-code-block-lines code{counter-increment:step calc(var(--start, 1) - 1);counter-reset:step}.n-code-block-lines code .line:before{content:counter(step);counter-increment:step;display:inline-block;margin-right:.5rem;padding-right:.5rem;text-align:right;width:2.5rem;color:#a3a3a380}details[data-v-f3591bcd],summary[data-v-f3591bcd]{border-style:none}summary[data-v-f3591bcd]{list-style:none}details[open] summary[data-v-f3591bcd]{border-style:none}details summary[data-v-f3591bcd]::-webkit-details-marker{display:none}details[open] .chevron[data-v-f3591bcd]{opacity:.75;transform:rotate(180deg)}
@@ -1,11 +1,11 @@
1
1
  <!DOCTYPE html><html><head><meta charset="utf-8">
2
2
  <meta name="viewport" content="width=device-width, initial-scale=1">
3
- <link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.AjgXSF89.css" crossorigin>
4
- <link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/BawWjxPx.js">
3
+ <link rel="stylesheet" href="/__nuxt-graphql-middleware/_nuxt/entry.Cn9qfNGa.css" crossorigin>
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/VpkRx2_e.js">
5
5
  <link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-404.BJkSn6RI.css">
6
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/BtHrwWER.js">
7
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/BvMfLM9s.js">
6
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/CPyoLiCY.js">
7
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/BLvMh1Ga.js">
8
8
  <link rel="prefetch" as="style" crossorigin href="/__nuxt-graphql-middleware/_nuxt/error-500.TOCKLquH.css">
9
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/DkAo05uu.js">
10
- <script type="module" src="/__nuxt-graphql-middleware/_nuxt/BawWjxPx.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},1742140131009,false]</script>
11
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"9b9c571e-ce30-465b-8174-06afbdca446b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
9
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-graphql-middleware/_nuxt/CBwfSTyQ.js">
10
+ <script type="module" src="/__nuxt-graphql-middleware/_nuxt/VpkRx2_e.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},1743158983534,false]</script>
11
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-graphql-middleware",buildId:"c16b1fe3-c3fb-4c15-952d-ba148d4025cb",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.d.mts CHANGED
@@ -1,11 +1,10 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { HookResult } from 'nuxt/schema';
3
- import { ContextType, GraphqlServerResponse, OperationResponseError } from '../dist/runtime/types.js';
3
+ import { OperationResponseError } from '../dist/runtime/types.js';
4
+ export { GraphqlMiddlewareServerOptions } from '../dist/runtime/types.js';
4
5
  import { Types } from '@graphql-codegen/plugin-helpers';
5
6
  import { SchemaASTConfig } from '@graphql-codegen/schema-ast';
6
7
  import { GeneratorOptions } from 'graphql-typescript-deluxe';
7
- import { H3Event } from 'h3';
8
- import { FetchOptions, FetchResponse, FetchError } from 'ofetch';
9
8
 
10
9
  interface ModuleOptions {
11
10
  /**
@@ -172,200 +171,6 @@ interface ModuleOptions {
172
171
  };
173
172
  }
174
173
 
175
- type GraphqlMiddlewareRequestContext<C extends ContextType = ContextType> = {
176
- client?: Partial<C>;
177
- };
178
- type GraphqlMiddlewareGraphqlEndpointMethod<C extends ContextType> = (event?: H3Event, operation?: string | null, operationName?: string | null, context?: GraphqlMiddlewareRequestContext<C> | null) => string | Promise<string> | undefined;
179
- type GraphqlMiddlewareServerFetchOptionsMethod<C extends ContextType> = (event?: H3Event, operation?: string | null, operationName?: string | null, context?: GraphqlMiddlewareRequestContext<C> | null) => FetchOptions | Promise<FetchOptions>;
180
- type GraphqlMiddlewareOnServerResponseMethod<ServerReponse, T, C extends ContextType> = (event: H3Event, response: FetchResponse<ServerReponse>, operation?: string | null, operationName?: string | null, context?: GraphqlMiddlewareRequestContext<C> | null) => T | Promise<T>;
181
- type GraphqlMiddlewareOnServerErrorMethod<C extends ContextType> = (event: H3Event, error: FetchError, operation?: string | null, operationName?: string | null, context?: GraphqlMiddlewareRequestContext<C> | null) => any | Promise<any>;
182
- type GraphqlMiddlewareDoRequestMethodContext<C extends ContextType> = {
183
- /**
184
- * The incoming request event from H3.
185
- */
186
- event: H3Event;
187
- /**
188
- * The type of operation.
189
- */
190
- operation?: 'query' | 'mutation';
191
- /**
192
- * The name of the operation.
193
- */
194
- operationName?: string;
195
- /**
196
- * The operation document (the raw GraphQL query/mutation as a string).
197
- */
198
- operationDocument: string;
199
- /**
200
- * Variables for the operation.
201
- */
202
- variables: Record<string, any>;
203
- /**
204
- * For file uploads (which are done using FormData), this contains the full
205
- * form data with these keys:
206
- *
207
- * - operations: string
208
- * A JSON string of an object with "query", "variables" and "operationName" properties.
209
- * Example:
210
- * operations='{ "query": "mutation ($id: String!, $file: Upload!) { uploadFile(id: $id, file: $file) { id filename } }", "variables": { "file": null, "id": "1" } }'
211
- * - map: string
212
- * A JSON string of an object whose keys are strings starting at '0' and the values being an array with a single string:
213
- * Example:
214
- * map='{ "0": ["variables.file"] }'
215
- * - [number]
216
- * For every file there is a FormData entry with a name that matches the key in `map`.
217
- * Example:
218
- * 0=[Binary File]
219
- */
220
- formData?: FormData;
221
- context: GraphqlMiddlewareRequestContext<C>;
222
- };
223
- type GraphqlMiddlewareDoRequestMethod<T, C extends ContextType> = (context: GraphqlMiddlewareDoRequestMethodContext<C>) => Promise<T>;
224
- /**
225
- * Configuration options during runtime.
226
- */
227
- type GraphqlMiddlewareServerOptions<Additions extends object = object, ResponseUnion extends object = object, C extends ContextType = ContextType, CustomResponse = GraphqlServerResponse<ResponseUnion> & Additions> = {
228
- /**
229
- * Custom callback to return the GraphQL endpoint per request.
230
- *
231
- * The method is only called if no `doGraphqlRequest` method is implemented.
232
- *
233
- * @default undefined
234
- *
235
- * @example
236
- * ```ts
237
- * function graphqlEndpoint(event, operation, operationName) {
238
- * const language = getLanguageFromRequest(event)
239
- * return `https://api.example.com/${language}/graphql`
240
- * }
241
- * ```
242
- */
243
- graphqlEndpoint?: GraphqlMiddlewareGraphqlEndpointMethod<C>;
244
- /**
245
- * Provide the options for the ofetch request to the GraphQL server.
246
- *
247
- * The method is only called if no `doGraphqlRequest` method is implemented.
248
- *
249
- * @default undefined
250
- *
251
- * @example
252
- * ```ts
253
- * import { getHeader } from 'h3'
254
- *
255
- * // Pass the cookie from the client request to the GraphQL request.
256
- * function serverFetchOptions(event, operation, operationName) {
257
- * return {
258
- * headers: {
259
- * Cookie: getHeader(event, 'cookie')
260
- * }
261
- * }
262
- * }
263
- * ```
264
- */
265
- serverFetchOptions?: GraphqlMiddlewareServerFetchOptionsMethod<C>;
266
- /**
267
- * Handle the response from the GraphQL server.
268
- *
269
- * The method is only called if no `doGraphqlRequest` method is implemented.
270
- *
271
- * You can alter the response, add additional properties to the data, get
272
- * and set headers, etc.
273
- *
274
- * ```ts
275
- * import type { H3Event } from 'h3'
276
- * import type { FetchResponse } from 'ofetch'
277
- *
278
- * function onServerResponse(event: H3Event, graphqlResponse: FetchResponse) {
279
- * // Set a static header.
280
- * event.node.res.setHeader('x-nuxt-custom-header', 'A custom header value')
281
- *
282
- * // Pass the set-cookie header from the GraphQL response to the client.
283
- * const setCookie = graphqlResponse.headers.get('set-cookie')
284
- * if (setCookie) {
285
- * event.node.res.setHeader('set-cookie', setCookie)
286
- * }
287
- *
288
- * // Add additional properties to the response.
289
- * graphqlResponse._data.__customProperty = ['My', 'values']
290
- *
291
- * // Return the GraphQL response.
292
- * return graphqlResponse._data
293
- * }
294
- * ```
295
- */
296
- onServerResponse?: GraphqlMiddlewareOnServerResponseMethod<GraphqlServerResponse<ResponseUnion>, CustomResponse, C>;
297
- /**
298
- * Handle a fetch error from the GraphQL request.
299
- *
300
- * The method is only called if no `doGraphqlRequest` method is implemented.
301
- *
302
- * Note that errors are only thrown for responses that are not status
303
- * 200-299. See https://github.com/unjs/ofetch#%EF%B8%8F-handling-errors for
304
- * more information.
305
- *
306
- * ```ts
307
- * import { createError } from 'h3'
308
- * import type { H3Event } from 'h3'
309
- * import type { FetchError } from 'ofetch'
310
- *
311
- * function onServerError(
312
- * event: H3Event,
313
- * error: FetchError,
314
- * operation: string,
315
- * operationName: string,
316
- * ) {
317
- * // Throw a h3 error.
318
- * throw createError({
319
- * statusCode: 500,
320
- * statusMessage: `Couldn't execute GraphQL ${operation} "${operationName}".`,
321
- * data: error.message
322
- * })
323
- * }
324
- * ```
325
- */
326
- onServerError?: GraphqlMiddlewareOnServerErrorMethod<C>;
327
- /**
328
- * Provide a custom fetch method for requests to the GraphQL server.
329
- *
330
- * This can be used if onServerError, onServerResponse, serverFetchOptions
331
- * and graphqlEndpoint are not enough to meet your requirements.
332
- *
333
- * When this method is implemented, all other methods are not called.
334
- *
335
- * The method will be called in the /api/graphql server route and should
336
- * perform the GraphQL request and return the response.
337
- *
338
- * An example use case might be to handle expired tokens.
339
- *
340
- * * ```ts
341
- * async function doGraphqlRequest({
342
- * event,
343
- * operation,
344
- * operationName,
345
- * operationDocument,
346
- * variables,
347
- * }) {
348
- * const result = await $fetch.raw('https://example.com/graphql', {
349
- * method: 'POST'
350
- * body: {
351
- * query: operationDocument,
352
- * variables,
353
- * operationName
354
- * },
355
- * headers: {
356
- * 'custom-header': 'foobar'
357
- * }
358
- * })
359
- *
360
- * return result._data
361
- * }
362
- * ```
363
- */
364
- doGraphqlRequest?: GraphqlMiddlewareDoRequestMethod<CustomResponse, C>;
365
- };
366
-
367
- interface ModuleHooks {
368
- }
369
174
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
370
175
 
371
176
  declare module '@nuxt/schema' {
@@ -401,4 +206,5 @@ declare module 'vite/types/customEvent.d.ts' {
401
206
  }
402
207
  }
403
208
 
404
- export { type GraphqlMiddlewareServerOptions, type ModuleHooks, type ModuleOptions, _default as default };
209
+ export { _default as default };
210
+ export type { ModuleOptions };
package/dist/module.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  import { HookResult } from 'nuxt/schema';
3
- import { ContextType, GraphqlServerResponse, OperationResponseError } from '../dist/runtime/types.js';
3
+ import { OperationResponseError } from '../dist/runtime/types.js';
4
+ export { GraphqlMiddlewareServerOptions } from '../dist/runtime/types.js';
4
5
  import { Types } from '@graphql-codegen/plugin-helpers';
5
6
  import { SchemaASTConfig } from '@graphql-codegen/schema-ast';
6
7
  import { GeneratorOptions } from 'graphql-typescript-deluxe';
7
- import { H3Event } from 'h3';
8
- import { FetchOptions, FetchResponse, FetchError } from 'ofetch';
9
8
 
10
9
  interface ModuleOptions {
11
10
  /**
@@ -172,200 +171,6 @@ interface ModuleOptions {
172
171
  };
173
172
  }
174
173
 
175
- type GraphqlMiddlewareRequestContext<C extends ContextType = ContextType> = {
176
- client?: Partial<C>;
177
- };
178
- type GraphqlMiddlewareGraphqlEndpointMethod<C extends ContextType> = (event?: H3Event, operation?: string | null, operationName?: string | null, context?: GraphqlMiddlewareRequestContext<C> | null) => string | Promise<string> | undefined;
179
- type GraphqlMiddlewareServerFetchOptionsMethod<C extends ContextType> = (event?: H3Event, operation?: string | null, operationName?: string | null, context?: GraphqlMiddlewareRequestContext<C> | null) => FetchOptions | Promise<FetchOptions>;
180
- type GraphqlMiddlewareOnServerResponseMethod<ServerReponse, T, C extends ContextType> = (event: H3Event, response: FetchResponse<ServerReponse>, operation?: string | null, operationName?: string | null, context?: GraphqlMiddlewareRequestContext<C> | null) => T | Promise<T>;
181
- type GraphqlMiddlewareOnServerErrorMethod<C extends ContextType> = (event: H3Event, error: FetchError, operation?: string | null, operationName?: string | null, context?: GraphqlMiddlewareRequestContext<C> | null) => any | Promise<any>;
182
- type GraphqlMiddlewareDoRequestMethodContext<C extends ContextType> = {
183
- /**
184
- * The incoming request event from H3.
185
- */
186
- event: H3Event;
187
- /**
188
- * The type of operation.
189
- */
190
- operation?: 'query' | 'mutation';
191
- /**
192
- * The name of the operation.
193
- */
194
- operationName?: string;
195
- /**
196
- * The operation document (the raw GraphQL query/mutation as a string).
197
- */
198
- operationDocument: string;
199
- /**
200
- * Variables for the operation.
201
- */
202
- variables: Record<string, any>;
203
- /**
204
- * For file uploads (which are done using FormData), this contains the full
205
- * form data with these keys:
206
- *
207
- * - operations: string
208
- * A JSON string of an object with "query", "variables" and "operationName" properties.
209
- * Example:
210
- * operations='{ "query": "mutation ($id: String!, $file: Upload!) { uploadFile(id: $id, file: $file) { id filename } }", "variables": { "file": null, "id": "1" } }'
211
- * - map: string
212
- * A JSON string of an object whose keys are strings starting at '0' and the values being an array with a single string:
213
- * Example:
214
- * map='{ "0": ["variables.file"] }'
215
- * - [number]
216
- * For every file there is a FormData entry with a name that matches the key in `map`.
217
- * Example:
218
- * 0=[Binary File]
219
- */
220
- formData?: FormData;
221
- context: GraphqlMiddlewareRequestContext<C>;
222
- };
223
- type GraphqlMiddlewareDoRequestMethod<T, C extends ContextType> = (context: GraphqlMiddlewareDoRequestMethodContext<C>) => Promise<T>;
224
- /**
225
- * Configuration options during runtime.
226
- */
227
- type GraphqlMiddlewareServerOptions<Additions extends object = object, ResponseUnion extends object = object, C extends ContextType = ContextType, CustomResponse = GraphqlServerResponse<ResponseUnion> & Additions> = {
228
- /**
229
- * Custom callback to return the GraphQL endpoint per request.
230
- *
231
- * The method is only called if no `doGraphqlRequest` method is implemented.
232
- *
233
- * @default undefined
234
- *
235
- * @example
236
- * ```ts
237
- * function graphqlEndpoint(event, operation, operationName) {
238
- * const language = getLanguageFromRequest(event)
239
- * return `https://api.example.com/${language}/graphql`
240
- * }
241
- * ```
242
- */
243
- graphqlEndpoint?: GraphqlMiddlewareGraphqlEndpointMethod<C>;
244
- /**
245
- * Provide the options for the ofetch request to the GraphQL server.
246
- *
247
- * The method is only called if no `doGraphqlRequest` method is implemented.
248
- *
249
- * @default undefined
250
- *
251
- * @example
252
- * ```ts
253
- * import { getHeader } from 'h3'
254
- *
255
- * // Pass the cookie from the client request to the GraphQL request.
256
- * function serverFetchOptions(event, operation, operationName) {
257
- * return {
258
- * headers: {
259
- * Cookie: getHeader(event, 'cookie')
260
- * }
261
- * }
262
- * }
263
- * ```
264
- */
265
- serverFetchOptions?: GraphqlMiddlewareServerFetchOptionsMethod<C>;
266
- /**
267
- * Handle the response from the GraphQL server.
268
- *
269
- * The method is only called if no `doGraphqlRequest` method is implemented.
270
- *
271
- * You can alter the response, add additional properties to the data, get
272
- * and set headers, etc.
273
- *
274
- * ```ts
275
- * import type { H3Event } from 'h3'
276
- * import type { FetchResponse } from 'ofetch'
277
- *
278
- * function onServerResponse(event: H3Event, graphqlResponse: FetchResponse) {
279
- * // Set a static header.
280
- * event.node.res.setHeader('x-nuxt-custom-header', 'A custom header value')
281
- *
282
- * // Pass the set-cookie header from the GraphQL response to the client.
283
- * const setCookie = graphqlResponse.headers.get('set-cookie')
284
- * if (setCookie) {
285
- * event.node.res.setHeader('set-cookie', setCookie)
286
- * }
287
- *
288
- * // Add additional properties to the response.
289
- * graphqlResponse._data.__customProperty = ['My', 'values']
290
- *
291
- * // Return the GraphQL response.
292
- * return graphqlResponse._data
293
- * }
294
- * ```
295
- */
296
- onServerResponse?: GraphqlMiddlewareOnServerResponseMethod<GraphqlServerResponse<ResponseUnion>, CustomResponse, C>;
297
- /**
298
- * Handle a fetch error from the GraphQL request.
299
- *
300
- * The method is only called if no `doGraphqlRequest` method is implemented.
301
- *
302
- * Note that errors are only thrown for responses that are not status
303
- * 200-299. See https://github.com/unjs/ofetch#%EF%B8%8F-handling-errors for
304
- * more information.
305
- *
306
- * ```ts
307
- * import { createError } from 'h3'
308
- * import type { H3Event } from 'h3'
309
- * import type { FetchError } from 'ofetch'
310
- *
311
- * function onServerError(
312
- * event: H3Event,
313
- * error: FetchError,
314
- * operation: string,
315
- * operationName: string,
316
- * ) {
317
- * // Throw a h3 error.
318
- * throw createError({
319
- * statusCode: 500,
320
- * statusMessage: `Couldn't execute GraphQL ${operation} "${operationName}".`,
321
- * data: error.message
322
- * })
323
- * }
324
- * ```
325
- */
326
- onServerError?: GraphqlMiddlewareOnServerErrorMethod<C>;
327
- /**
328
- * Provide a custom fetch method for requests to the GraphQL server.
329
- *
330
- * This can be used if onServerError, onServerResponse, serverFetchOptions
331
- * and graphqlEndpoint are not enough to meet your requirements.
332
- *
333
- * When this method is implemented, all other methods are not called.
334
- *
335
- * The method will be called in the /api/graphql server route and should
336
- * perform the GraphQL request and return the response.
337
- *
338
- * An example use case might be to handle expired tokens.
339
- *
340
- * * ```ts
341
- * async function doGraphqlRequest({
342
- * event,
343
- * operation,
344
- * operationName,
345
- * operationDocument,
346
- * variables,
347
- * }) {
348
- * const result = await $fetch.raw('https://example.com/graphql', {
349
- * method: 'POST'
350
- * body: {
351
- * query: operationDocument,
352
- * variables,
353
- * operationName
354
- * },
355
- * headers: {
356
- * 'custom-header': 'foobar'
357
- * }
358
- * })
359
- *
360
- * return result._data
361
- * }
362
- * ```
363
- */
364
- doGraphqlRequest?: GraphqlMiddlewareDoRequestMethod<CustomResponse, C>;
365
- };
366
-
367
- interface ModuleHooks {
368
- }
369
174
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
370
175
 
371
176
  declare module '@nuxt/schema' {
@@ -401,4 +206,5 @@ declare module 'vite/types/customEvent.d.ts' {
401
206
  }
402
207
  }
403
208
 
404
- export { type GraphqlMiddlewareServerOptions, type ModuleHooks, type ModuleOptions, _default as default };
209
+ export { _default as default };
210
+ export type { ModuleOptions };
package/dist/module.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "nuxt-graphql-middleware",
3
3
  "configKey": "graphqlMiddleware",
4
- "version": "5.0.0-alpha.6",
4
+ "version": "5.0.0-alpha.8",
5
5
  "compatibility": {
6
- "nuxt": ">=3.16.0"
6
+ "nuxt": ">=3.15.0"
7
7
  },
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",