nuxt-graphql-middleware 3.0.0-beta.3 → 3.0.0-beta.4

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-graphql-middleware",
3
3
  "configKey": "graphqlMiddleware",
4
- "version": "3.0.0-beta.3",
4
+ "version": "3.0.0-beta.4",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.0.0"
7
7
  }
package/dist/module.mjs CHANGED
@@ -16,7 +16,7 @@ import { oldVisit } from '@graphql-codegen/plugin-helpers';
16
16
  import { pascalCase } from 'change-case-all';
17
17
 
18
18
  const name = "nuxt-graphql-middleware";
19
- const version = "3.0.0-beta.3";
19
+ const version = "3.0.0-beta.4";
20
20
 
21
21
  var GraphqlMiddlewareTemplate = /* @__PURE__ */ ((GraphqlMiddlewareTemplate2) => {
22
22
  GraphqlMiddlewareTemplate2["OperationTypes"] = "graphql-operations.d.ts";
@@ -337,7 +337,7 @@ function validateDocuments(schema, documents, srcDir) {
337
337
  }
338
338
  document.isValid = document.errors.length === 0;
339
339
  } catch (e) {
340
- document.errors = e && typeof e === "object" && e !== null ? [e.message] : ["Validation failed"];
340
+ document.errors = [e];
341
341
  document.isValid = false;
342
342
  }
343
343
  }
@@ -2,7 +2,7 @@ import { QueryObject } from 'ufo';
2
2
  import type { H3Event } from 'h3';
3
3
  import type { FetchOptions } from 'ofetch';
4
4
  import type { GraphqlMiddlewareConfig } from './../../../types';
5
- import { GraphqlMiddlewareOperation } from './../../../types';
5
+ import { GraphqlMiddlewareOperation } from './../../settings';
6
6
  export declare function queryParamToVariables(query: QueryObject): any;
7
7
  /**
8
8
  * Get the URL of the GraphQL endpoint.
@@ -1,5 +1,5 @@
1
1
  import { createError } from "h3";
2
- import { GraphqlMiddlewareOperation } from "./../../../types";
2
+ import { GraphqlMiddlewareOperation } from "./../../settings/index.mjs";
3
3
  export function queryParamToVariables(query) {
4
4
  try {
5
5
  if (query.__variables && typeof query.__variables === "string") {
@@ -12,7 +12,7 @@ import {
12
12
  validateRequest
13
13
  } from "./helpers";
14
14
  import { getModuleConfig } from "./helpers/getModuleConfig.mjs";
15
- import { GraphqlMiddlewareOperation } from "./../../types";
15
+ import { GraphqlMiddlewareOperation } from "./../settings/index.mjs";
16
16
  import { documents } from "#graphql-documents";
17
17
  export default defineEventHandler(async (event) => {
18
18
  const method = getMethod(event);
@@ -0,0 +1,18 @@
1
+ export declare enum GraphqlMiddlewareTemplate {
2
+ /**
3
+ * Contains the TS definitions for all GraphQL queries, mutations and fragments.
4
+ */
5
+ OperationTypes = "graphql-operations.d.ts",
6
+ /**
7
+ * Signature for the GraphQL composable arguments and return types.
8
+ */
9
+ ComposableContext = "nuxt-graphql-middleware.d.ts",
10
+ /**
11
+ * Exports a single opject containing the compiled queries and mutations.
12
+ */
13
+ Documents = "graphql-documents.mjs"
14
+ }
15
+ export declare enum GraphqlMiddlewareOperation {
16
+ Query = "query",
17
+ Mutation = "mutation"
18
+ }
@@ -0,0 +1,11 @@
1
+ export var GraphqlMiddlewareTemplate = /* @__PURE__ */ ((GraphqlMiddlewareTemplate2) => {
2
+ GraphqlMiddlewareTemplate2["OperationTypes"] = "graphql-operations.d.ts";
3
+ GraphqlMiddlewareTemplate2["ComposableContext"] = "nuxt-graphql-middleware.d.ts";
4
+ GraphqlMiddlewareTemplate2["Documents"] = "graphql-documents.mjs";
5
+ return GraphqlMiddlewareTemplate2;
6
+ })(GraphqlMiddlewareTemplate || {});
7
+ export var GraphqlMiddlewareOperation = /* @__PURE__ */ ((GraphqlMiddlewareOperation2) => {
8
+ GraphqlMiddlewareOperation2["Query"] = "query";
9
+ GraphqlMiddlewareOperation2["Mutation"] = "mutation";
10
+ return GraphqlMiddlewareOperation2;
11
+ })(GraphqlMiddlewareOperation || {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-graphql-middleware",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {