nuxt-graphql-middleware 5.0.0-alpha.5 → 5.0.0-alpha.7

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 (44) hide show
  1. package/dist/client/200.html +7 -7
  2. package/dist/client/404.html +7 -7
  3. package/dist/client/_nuxt/{CZ2Qwgdk.js → B4KMzhZo.js} +1 -1
  4. package/dist/client/_nuxt/BawWjxPx.js +25 -0
  5. package/dist/client/_nuxt/BtHrwWER.js +1 -0
  6. package/dist/client/_nuxt/BvMfLM9s.js +1 -0
  7. package/dist/client/_nuxt/{GOrnHr4p.js → DkAo05uu.js} +1 -1
  8. package/dist/client/_nuxt/builds/latest.json +1 -1
  9. package/dist/client/_nuxt/builds/meta/1d4cde1f-51c0-4bab-b233-3b063cc8ad1c.json +1 -0
  10. package/dist/client/index.html +7 -7
  11. package/dist/module.d.mts +192 -162
  12. package/dist/module.d.ts +192 -162
  13. package/dist/module.json +1 -1
  14. package/dist/module.mjs +1027 -620
  15. package/dist/runtime/components/CodeFrame.vue +1 -1
  16. package/dist/runtime/composables/useAsyncGraphqlQuery.d.ts +1 -1
  17. package/dist/runtime/composables/useAsyncGraphqlQuery.js +9 -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/useGraphqlUploadMutation.d.ts +1 -1
  21. package/dist/runtime/helpers/composables.d.ts +1 -1
  22. package/dist/runtime/server/api/mutation.js +28 -0
  23. package/dist/runtime/server/api/query.js +29 -0
  24. package/dist/runtime/server/api/upload.d.ts +2 -0
  25. package/dist/runtime/{serverHandler → server/api}/upload.js +11 -9
  26. package/dist/runtime/{serverHandler → server}/helpers/index.d.ts +8 -10
  27. package/dist/runtime/{serverHandler → server}/helpers/index.js +8 -25
  28. package/dist/runtime/server/utils/doGraphqlRequest.d.ts +18 -0
  29. package/dist/runtime/server/utils/doGraphqlRequest.js +67 -0
  30. package/dist/runtime/server/utils/useGraphqlMutation.d.ts +1 -1
  31. package/dist/runtime/server/utils/useGraphqlQuery.d.ts +1 -1
  32. package/dist/runtime/settings/index.d.ts +0 -39
  33. package/dist/runtime/settings/index.js +0 -13
  34. package/package.json +9 -7
  35. package/dist/client/_nuxt/BS583yk8.js +0 -25
  36. package/dist/client/_nuxt/DpxjPVZy.js +0 -1
  37. package/dist/client/_nuxt/builds/meta/c22c2916-33e9-427d-b6fe-10f11766c207.json +0 -1
  38. package/dist/client/_nuxt/exxdaCPN.js +0 -1
  39. package/dist/runtime/serverHandler/index.js +0 -78
  40. package/dist/runtime/serverHandler/tsconfig.json +0 -3
  41. /package/dist/runtime/{serverHandler → server/api}/debug.d.ts +0 -0
  42. /package/dist/runtime/{serverHandler → server/api}/debug.js +0 -0
  43. /package/dist/runtime/{serverHandler/index.d.ts → server/api/mutation.d.ts} +0 -0
  44. /package/dist/runtime/{serverHandler/upload.d.ts → server/api/query.d.ts} +0 -0
@@ -44,7 +44,7 @@ const lines = computed(() => {
44
44
  const sliced = fullLines.slice(indexStart, indexEnd)
45
45
 
46
46
  // Remove trailing empty lines
47
- while (sliced.length && !sliced[sliced.length - 1].trim()) {
47
+ while (sliced.length && !sliced[sliced.length - 1]?.trim()) {
48
48
  sliced.pop()
49
49
  }
50
50
 
@@ -6,7 +6,7 @@ import type { GraphqlResponse } from '#nuxt-graphql-middleware/response';
6
6
  import type { RequestCacheOptions } from './../types.js';
7
7
  import type { AsyncData, AsyncDataOptions, NuxtError } from '#app';
8
8
  import type { DefaultAsyncDataValue } from 'nuxt/app/defaults';
9
- import type { Query } from '#nuxt-graphql-middleware/operations';
9
+ import type { Query } from '#nuxt-graphql-middleware/operation-types';
10
10
  type AsyncGraphqlQueryOptions<FetchOptions, ResT, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = DefaultAsyncDataValue> = AsyncDataOptions<ResT, DataT, PickKeys, DefaultT> & {
11
11
  /**
12
12
  * Control how the GraphQL response can be cached.
@@ -32,7 +32,7 @@ export function useAsyncGraphqlQuery(name, ...args) {
32
32
  };
33
33
  }
34
34
  }
35
- return useAsyncData(
35
+ const result = useAsyncData(
36
36
  key,
37
37
  () => {
38
38
  const globalClientContext = clientOptions.buildClientContext ? clientOptions.buildClientContext() : {};
@@ -56,4 +56,12 @@ export function useAsyncGraphqlQuery(name, ...args) {
56
56
  },
57
57
  asyncDataOptions
58
58
  );
59
+ if (import.meta.hot) {
60
+ import.meta.hot.on("nuxt-graphql-middleware:reload", (data) => {
61
+ if (data.operations.includes(name)) {
62
+ result.refresh();
63
+ }
64
+ });
65
+ }
66
+ return result;
59
67
  }
@@ -1,6 +1,6 @@
1
1
  import { type GetMutationArgs, type MutationObjectArgs, type GetMutationResult } from './../helpers/composables.js';
2
2
  import type { GraphqlResponse } from '#nuxt-graphql-middleware/response';
3
- import type { Mutation } from '#nuxt-graphql-middleware/operations';
3
+ import type { Mutation } from '#nuxt-graphql-middleware/operation-types';
4
4
  /**
5
5
  * Performs a GraphQL mutation.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { type GetQueryArgs, type QueryObjectArgs, type GetQueryResult } from './../helpers/composables.js';
2
2
  import type { GraphqlResponse } from '#nuxt-graphql-middleware/response';
3
- import type { Query } from '#nuxt-graphql-middleware/operations';
3
+ import type { Query } from '#nuxt-graphql-middleware/operation-types';
4
4
  /**
5
5
  * Performs a GraphQL query.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import { type GetMutationArgs, type MutationObjectArgs, type GetMutationResult } from './../helpers/composables.js';
2
2
  import type { GraphqlResponse } from '#nuxt-graphql-middleware/response';
3
- import type { Mutation } from '#nuxt-graphql-middleware/operations';
3
+ import type { Mutation } from '#nuxt-graphql-middleware/operation-types';
4
4
  /**
5
5
  * Performs a GraphQL upload mutation.
6
6
  */
@@ -1,7 +1,7 @@
1
1
  import type { FetchOptions } from 'ofetch';
2
2
  import type { RequestCacheOptions } from './../types.js';
3
3
  import type { GraphqlClientContext } from '#nuxt-graphql-middleware/client-options';
4
- import type { Query, Mutation } from '#nuxt-graphql-middleware/operations';
4
+ import type { Query, Mutation } from '#nuxt-graphql-middleware/operation-types';
5
5
  export type GraphqlComposableOptions = {
6
6
  fetchOptions?: FetchOptions;
7
7
  graphqlCaching?: RequestCacheOptions;
@@ -0,0 +1,28 @@
1
+ import { defineEventHandler, getQuery, getRouterParam, readBody } from "h3";
2
+ import {
3
+ extractRequestContext,
4
+ isValidMutation,
5
+ throwError
6
+ } from "./../helpers/index.js";
7
+ import { GraphqlMiddlewareOperation } from "./../../settings/index.js";
8
+ import { documents } from "#nuxt-graphql-middleware/documents";
9
+ import { doGraphqlRequest } from "../utils/doGraphqlRequest.js";
10
+ export default defineEventHandler(async (event) => {
11
+ const operationName = getRouterParam(event, "name");
12
+ if (!isValidMutation(operationName)) {
13
+ return throwError("Invalid mutation name.");
14
+ }
15
+ const operationDocument = documents.mutation[operationName];
16
+ const queryParams = getQuery(event);
17
+ const context = extractRequestContext(queryParams);
18
+ const variables = await readBody(event);
19
+ return doGraphqlRequest(
20
+ {
21
+ query: operationDocument,
22
+ variables,
23
+ operation: GraphqlMiddlewareOperation.Mutation
24
+ },
25
+ context,
26
+ event
27
+ );
28
+ });
@@ -0,0 +1,29 @@
1
+ import { defineEventHandler, getQuery, getRouterParam } from "h3";
2
+ import {
3
+ queryParamToVariables,
4
+ extractRequestContext,
5
+ isValidQuery,
6
+ throwError
7
+ } from "./../helpers/index.js";
8
+ import { GraphqlMiddlewareOperation } from "./../../settings/index.js";
9
+ import { documents } from "#nuxt-graphql-middleware/documents";
10
+ import { doGraphqlRequest } from "../utils/doGraphqlRequest.js";
11
+ export default defineEventHandler(async (event) => {
12
+ const operationName = getRouterParam(event, "name");
13
+ if (!isValidQuery(operationName)) {
14
+ return throwError("Invalid query name.");
15
+ }
16
+ const operationDocument = documents.query[operationName];
17
+ const queryParams = getQuery(event);
18
+ const context = extractRequestContext(queryParams);
19
+ const variables = queryParamToVariables(queryParams);
20
+ return doGraphqlRequest(
21
+ {
22
+ query: operationDocument,
23
+ variables,
24
+ operation: GraphqlMiddlewareOperation.Query
25
+ },
26
+ context,
27
+ event
28
+ );
29
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
+ export default _default;
@@ -1,21 +1,22 @@
1
1
  import {
2
2
  defineEventHandler,
3
3
  readMultipartFormData,
4
- getQuery
4
+ getQuery,
5
+ getRouterParam
5
6
  } from "h3";
6
7
  import {
7
8
  getEndpoint,
8
9
  getFetchOptions,
9
- validateRequest,
10
10
  onServerResponse,
11
11
  onServerError,
12
12
  throwError,
13
- extractRequestContext
14
- } from "./helpers/index.js";
15
- import { GraphqlMiddlewareOperation } from "./../settings/index.js";
13
+ extractRequestContext,
14
+ isValidMutation
15
+ } from "./../helpers/index.js";
16
16
  import { documents } from "#nuxt-graphql-middleware/documents";
17
17
  import { serverOptions } from "#nuxt-graphql-middleware/server-options";
18
18
  import { useRuntimeConfig } from "#imports";
19
+ import { GraphqlMiddlewareOperation } from "../../settings/index.js";
19
20
  function parseMultipart(data) {
20
21
  const files = data.filter((v) => !!v.filename);
21
22
  const variablesData = data.find((v) => v.name === "variables")?.data?.toString();
@@ -27,11 +28,12 @@ function parseMultipart(data) {
27
28
  return { files, map, variables };
28
29
  }
29
30
  export default defineEventHandler(async (event) => {
30
- const method = event.method;
31
31
  const operation = GraphqlMiddlewareOperation.Mutation;
32
- const operationName = event.context?.params?.name;
33
- validateRequest(method, operation, operationName, documents);
34
- const operationDocument = documents[operation][operationName];
32
+ const operationName = getRouterParam(event, "name");
33
+ if (!isValidMutation(operationName)) {
34
+ return throwError("Invalid mutation name.");
35
+ }
36
+ const operationDocument = documents.mutation[operationName];
35
37
  const multiPartData = await readMultipartFormData(event);
36
38
  if (!multiPartData) {
37
39
  return throwError("Failed to read multi part data.");
@@ -2,8 +2,10 @@ import { type QueryObject } from 'ufo';
2
2
  import type { H3Event } from 'h3';
3
3
  import type { FetchOptions, FetchResponse, FetchError } from 'ofetch';
4
4
  import type { GraphqlMiddlewareRequestContext, GraphqlMiddlewareRuntimeConfig, GraphqlMiddlewareServerOptions } from './../../../types.js';
5
- import { GraphqlMiddlewareOperation } from './../../settings/index.js';
6
- import type { Documents } from '#nuxt-graphql-middleware/documents';
5
+ import { type GraphqlMiddlewareOperation } from './../../settings/index.js';
6
+ import type { Mutation, Query } from '#nuxt-graphql-middleware/operation-types';
7
+ export declare function isValidMutation(v?: string): v is keyof Mutation;
8
+ export declare function isValidQuery(v?: string): v is keyof Query;
7
9
  export declare function queryParamToVariables(query: QueryObject): any;
8
10
  /**
9
11
  * Extract the client context from the query params.
@@ -12,21 +14,17 @@ export declare function extractRequestContext(query: QueryObject): GraphqlMiddle
12
14
  /**
13
15
  * Get the URL of the GraphQL endpoint.
14
16
  */
15
- export declare function getEndpoint(config: GraphqlMiddlewareRuntimeConfig, serverOptions: GraphqlMiddlewareServerOptions<any, any>, event: H3Event, operation: GraphqlMiddlewareOperation, operationName: string, context: GraphqlMiddlewareRequestContext<any>): string | Promise<string>;
17
+ export declare function getEndpoint(config: GraphqlMiddlewareRuntimeConfig, serverOptions: GraphqlMiddlewareServerOptions<any, any>, event: H3Event, operation: GraphqlMiddlewareOperation | null, operationName: string | null, context: GraphqlMiddlewareRequestContext<any> | null): string | Promise<string>;
16
18
  /**
17
19
  * Get the options for the $fetch request to the GraphQL server.
18
20
  */
19
- export declare function getFetchOptions(serverOptions: GraphqlMiddlewareServerOptions<any, any>, event: H3Event, operation: GraphqlMiddlewareOperation, operationName: string, context: GraphqlMiddlewareRequestContext<any>): FetchOptions | Promise<FetchOptions>;
21
+ export declare function getFetchOptions(serverOptions: GraphqlMiddlewareServerOptions<any, any>, event: H3Event, operation: GraphqlMiddlewareOperation | null, operationName: string | null, context: GraphqlMiddlewareRequestContext<any> | null): FetchOptions | Promise<FetchOptions>;
20
22
  export declare function throwError(statusMessage: string, statusCode?: number): never;
21
- /**
22
- * Assure that the request is valid.
23
- */
24
- export declare function validateRequest(method?: string, operation?: GraphqlMiddlewareOperation | string, name?: string, documents?: Documents): void;
25
23
  /**
26
24
  * Handle GraphQL server response.
27
25
  */
28
- export declare function onServerResponse(serverOptions: GraphqlMiddlewareServerOptions<any, any>, event: H3Event, response: FetchResponse<any>, operation: string, operationName: string, context: GraphqlMiddlewareRequestContext<any>): any;
26
+ export declare function onServerResponse(serverOptions: GraphqlMiddlewareServerOptions<any, any>, event: H3Event, response: FetchResponse<any>, operation: string | null, operationName: string | null, context: GraphqlMiddlewareRequestContext<any> | null): any;
29
27
  /**
30
28
  * Handle GraphQL server errors.
31
29
  */
32
- export declare function onServerError(serverOptions: GraphqlMiddlewareServerOptions<any, any>, event: H3Event, error: FetchError, operation: string, operationName: string, context: GraphqlMiddlewareRequestContext<any>): any;
30
+ export declare function onServerError(serverOptions: GraphqlMiddlewareServerOptions<any, any>, event: H3Event, error: FetchError, operation: string | null, operationName: string | null, context: GraphqlMiddlewareRequestContext<any> | null): any;
@@ -1,8 +1,14 @@
1
1
  import { createError } from "h3";
2
2
  import {
3
- CLIENT_CONTEXT_PREFIX,
4
- GraphqlMiddlewareOperation
3
+ CLIENT_CONTEXT_PREFIX
5
4
  } from "./../../settings/index.js";
5
+ import { documents } from "#nuxt-graphql-middleware/documents";
6
+ export function isValidMutation(v) {
7
+ return !!v && Object.hasOwn(documents.mutation, v);
8
+ }
9
+ export function isValidQuery(v) {
10
+ return !!v && Object.hasOwn(documents.query, v);
11
+ }
6
12
  export function queryParamToVariables(query) {
7
13
  try {
8
14
  if (query.__variables && typeof query.__variables === "string") {
@@ -61,29 +67,6 @@ export function throwError(statusMessage, statusCode = 400) {
61
67
  statusMessage
62
68
  });
63
69
  }
64
- export function validateRequest(method, operation, name, documents) {
65
- if (method !== "POST" && method !== "GET") {
66
- throwError("Method not allowed.", 405);
67
- }
68
- if (operation !== GraphqlMiddlewareOperation.Query && operation !== GraphqlMiddlewareOperation.Mutation) {
69
- throwError("Unknown operation.");
70
- }
71
- if (method === "POST" && operation !== GraphqlMiddlewareOperation.Mutation) {
72
- throwError("Queries must be a GET request.");
73
- }
74
- if (method === "GET" && operation !== GraphqlMiddlewareOperation.Query) {
75
- throwError("Mutations must be a POST request.");
76
- }
77
- if (!name) {
78
- throwError("Missing name for operation.");
79
- }
80
- if (!documents) {
81
- throwError("Failed to load GraphQL documents", 500);
82
- }
83
- if (!documents[operation][name]) {
84
- throwError(`Operation "${operation}" with name "${name}" not found.`);
85
- }
86
- }
87
70
  export function onServerResponse(serverOptions, event, response, operation, operationName, context) {
88
71
  if (serverOptions.onServerResponse) {
89
72
  return serverOptions.onServerResponse(
@@ -0,0 +1,18 @@
1
+ import type { H3Event } from 'h3';
2
+ import type { GraphqlMiddlewareRequestContext } from '../../../types.js';
3
+ import type { GraphqlMiddlewareOperation } from '../../settings/index.js';
4
+ type RequestBody = {
5
+ query: string;
6
+ variables?: Record<string, any>;
7
+ operation?: GraphqlMiddlewareOperation;
8
+ operationName?: string;
9
+ };
10
+ /**
11
+ * Perform a raw GraphQL request.
12
+ *
13
+ * @param body - The request.
14
+ * @param context - The client context.
15
+ * @param event - The H3 event. If not provided, the util will try to get the event using useEvent().
16
+ */
17
+ export declare function doGraphqlRequest(body: RequestBody, context?: GraphqlMiddlewareRequestContext | null | undefined, providedEvent?: H3Event | null | undefined): Promise<any>;
18
+ export {};
@@ -0,0 +1,67 @@
1
+ import { serverOptions } from "#nuxt-graphql-middleware/server-options";
2
+ import { useRuntimeConfig } from "#imports";
3
+ import { useEvent } from "nitropack/runtime";
4
+ import {
5
+ getEndpoint,
6
+ getFetchOptions,
7
+ onServerError,
8
+ onServerResponse
9
+ } from "../helpers/index.js";
10
+ export async function doGraphqlRequest(body, context = null, providedEvent = null) {
11
+ const operationName = body.operationName || null;
12
+ const event = providedEvent ?? useEvent();
13
+ const runtimeConfig = useRuntimeConfig().graphqlMiddleware;
14
+ if (serverOptions.doGraphqlRequest) {
15
+ return serverOptions.doGraphqlRequest({
16
+ event,
17
+ operation: body.operation,
18
+ operationName: body.operationName,
19
+ operationDocument: body.query,
20
+ variables: body.variables || {},
21
+ context: context || {}
22
+ });
23
+ }
24
+ const endpoint = await getEndpoint(
25
+ runtimeConfig,
26
+ serverOptions,
27
+ event,
28
+ null,
29
+ operationName,
30
+ context || null
31
+ );
32
+ const fetchOptions = await getFetchOptions(
33
+ serverOptions,
34
+ event,
35
+ null,
36
+ body.operationName || null,
37
+ context
38
+ );
39
+ return $fetch.raw(endpoint, {
40
+ // @ts-expect-error Not yet been fixed in nitro.
41
+ method: "POST",
42
+ body: {
43
+ query: body.query,
44
+ variables: body.variables,
45
+ operationName: body.operationName
46
+ },
47
+ ...fetchOptions
48
+ }).then((response) => {
49
+ return onServerResponse(
50
+ serverOptions,
51
+ event,
52
+ response,
53
+ null,
54
+ operationName,
55
+ context
56
+ );
57
+ }).catch((error) => {
58
+ return onServerError(
59
+ serverOptions,
60
+ event,
61
+ error,
62
+ null,
63
+ operationName,
64
+ context
65
+ );
66
+ });
67
+ }
@@ -1,6 +1,6 @@
1
1
  import type { GraphqlResponse } from '#nuxt-graphql-middleware/response';
2
2
  import { type GetMutationArgs, type MutationObjectArgs, type GetMutationResult } from './../../helpers/composables.js';
3
- import type { Mutation } from '#nuxt-graphql-middleware/operations';
3
+ import type { Mutation } from '#nuxt-graphql-middleware/operation-types';
4
4
  /**
5
5
  * Performs a GraphQL mutation.
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type { GraphqlResponse } from '#nuxt-graphql-middleware/response';
2
2
  import { type GetQueryArgs, type QueryObjectArgs, type GetQueryResult } from './../../helpers/composables.js';
3
- import type { Query } from '#nuxt-graphql-middleware/operations';
3
+ import type { Query } from '#nuxt-graphql-middleware/operation-types';
4
4
  /**
5
5
  * Performs a GraphQL query.
6
6
  */
@@ -1,42 +1,3 @@
1
- export declare enum GraphqlMiddlewareTemplate {
2
- /**
3
- * Contains the TS definitions for all GraphQL queries, mutations and fragments.
4
- */
5
- OperationTypes = "graphql-operations/index.d.ts",
6
- /**
7
- * Contains the TS definitions for all GraphQL queries, mutations and fragments.
8
- */
9
- OperationTypesAll = "nuxt-graphql-middleware/operations.d.ts",
10
- /**
11
- * Contains the TS definitions for all GraphQL queries, mutations and fragments.
12
- */
13
- Enums = "graphql-operations/enums.ts",
14
- /**
15
- * Template for the middleware response types.
16
- */
17
- ResponseTypes = "nuxt-graphql-middleware/response.d.ts",
18
- /**
19
- * Types for the generated endpoints.
20
- */
21
- NitroTypes = "nuxt-graphql-middleware/nitro.d.ts",
22
- /**
23
- * Configuration template.
24
- */
25
- Helpers = "nuxt-graphql-middleware/helpers.mjs",
26
- /**
27
- * Configuration template types.
28
- */
29
- HelpersTypes = "nuxt-graphql-middleware/helpers.d.ts",
30
- /**
31
- * Exports a single opject containing the compiled queries and mutations.
32
- */
33
- Documents = "nuxt-graphql-middleware/documents.mjs",
34
- /**
35
- * Contains the source file paths for every operation.
36
- */
37
- OperationSources = "nuxt-graphql-middleware/sources.mjs",
38
- Types = "nuxt-graphql-middleware/types.d.ts"
39
- }
40
1
  export declare enum GraphqlMiddlewareOperation {
41
2
  Query = "query",
42
3
  Mutation = "mutation"
@@ -1,16 +1,3 @@
1
- export var GraphqlMiddlewareTemplate = /* @__PURE__ */ ((GraphqlMiddlewareTemplate2) => {
2
- GraphqlMiddlewareTemplate2["OperationTypes"] = "graphql-operations/index.d.ts";
3
- GraphqlMiddlewareTemplate2["OperationTypesAll"] = "nuxt-graphql-middleware/operations.d.ts";
4
- GraphqlMiddlewareTemplate2["Enums"] = "graphql-operations/enums.ts";
5
- GraphqlMiddlewareTemplate2["ResponseTypes"] = "nuxt-graphql-middleware/response.d.ts";
6
- GraphqlMiddlewareTemplate2["NitroTypes"] = "nuxt-graphql-middleware/nitro.d.ts";
7
- GraphqlMiddlewareTemplate2["Helpers"] = "nuxt-graphql-middleware/helpers.mjs";
8
- GraphqlMiddlewareTemplate2["HelpersTypes"] = "nuxt-graphql-middleware/helpers.d.ts";
9
- GraphqlMiddlewareTemplate2["Documents"] = "nuxt-graphql-middleware/documents.mjs";
10
- GraphqlMiddlewareTemplate2["OperationSources"] = "nuxt-graphql-middleware/sources.mjs";
11
- GraphqlMiddlewareTemplate2["Types"] = "nuxt-graphql-middleware/types.d.ts";
12
- return GraphqlMiddlewareTemplate2;
13
- })(GraphqlMiddlewareTemplate || {});
14
1
  export var GraphqlMiddlewareOperation = /* @__PURE__ */ ((GraphqlMiddlewareOperation2) => {
15
2
  GraphqlMiddlewareOperation2["Query"] = "query";
16
3
  GraphqlMiddlewareOperation2["Mutation"] = "mutation";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-graphql-middleware",
3
- "version": "5.0.0-alpha.5",
3
+ "version": "5.0.0-alpha.7",
4
4
  "description": "Module to perform GraphQL requests as a server middleware.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,12 +41,12 @@
41
41
  "debug": "nuxi dev playground --inspect",
42
42
  "dev:build": "nuxi build playground",
43
43
  "dev:layers:build": "nuxi build playground-layers",
44
- "dev:prepare": "MODULE_BUILD=true nuxt-module-build build --stub && MODULE_BUILD=true nuxt-module-build prepare && nuxi prepare playground && nuxi prepare playground-layers",
44
+ "dev:prepare": "MODULE_BUILD=true nuxt-module-build build --stub && MODULE_BUILD=true nuxt-module-build prepare && nuxi prepare playground-layers && nuxi prepare playground",
45
45
  "dev:start": "node ./playground/.output/server/index.mjs",
46
46
  "client:build": "nuxi generate client",
47
47
  "client:dev": "nuxi dev client --port 3300",
48
48
  "typedoc": "typedoc --plugin typedoc-plugin-markdown --out foobar",
49
- "typecheck": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
49
+ "typecheck": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit && cd ../playground-layers && vue-tsc --noEmit",
50
50
  "docs:dev": "vitepress dev docs --port 5000",
51
51
  "docs:build": "vitepress build docs",
52
52
  "docs:serve": "vitepress serve docs --port 5000",
@@ -64,11 +64,12 @@
64
64
  "styles:watch": "postcss ./css/index.css -o ./src/runtime/css/output.css --watch"
65
65
  },
66
66
  "dependencies": {
67
+ "@clack/prompts": "^0.10.0",
67
68
  "@graphql-codegen/cli": "^5.0.5",
68
69
  "@graphql-codegen/schema-ast": "^4.1.0",
69
70
  "@graphql-tools/utils": "^10.2.2",
70
71
  "@nuxt/devtools-kit": "1.3.7",
71
- "graphql-typescript-deluxe": "^0.0.6",
72
+ "graphql-typescript-deluxe": "^0.0.7",
72
73
  "inquirer": "^9.3.2",
73
74
  "minisearch": "^6.3.0",
74
75
  "picocolors": "^1.0.1"
@@ -78,18 +79,19 @@
78
79
  "@nuxt/devtools": "^1.3.7",
79
80
  "@nuxt/devtools-ui-kit": "1.3.7",
80
81
  "@nuxt/eslint": "^0.3.13",
81
- "@nuxt/kit": "^3.15.4",
82
+ "@nuxt/kit": "^3.16.0",
82
83
  "@nuxt/module-builder": "^0.8.4",
83
- "@nuxt/schema": "^3.15.4",
84
+ "@nuxt/schema": "^3.16.0",
84
85
  "@types/capture-console": "^1.0.5",
85
86
  "@types/cli-table": "^0.3.4",
86
87
  "@types/inquirer": "^9.0.7",
88
+ "@types/micromatch": "^4.0.9",
87
89
  "cypress": "^13.12.0",
88
90
  "eslint": "^8.57.0",
89
91
  "eslint-config-prettier": "^9.1.0",
90
92
  "eslint-plugin-prettier": "^5.1.3",
91
93
  "jsdoc-to-markdown": "^8.0.1",
92
- "nuxt": "^3.15.4",
94
+ "nuxt": "^3.16.0",
93
95
  "postcss": "^8.5.3",
94
96
  "postcss-cli": "^11.0.0",
95
97
  "postcss-import": "^16.1.0",