nuxt-graphql-middleware 3.1.0-beta.0 → 3.1.0-beta.1
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.d.ts
CHANGED
|
@@ -217,6 +217,4 @@ type ModuleOptions = GraphqlMiddlewareConfig;
|
|
|
217
217
|
type ModuleHooks = {};
|
|
218
218
|
declare const _default: NuxtModule<GraphqlMiddlewareConfig>;
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
export { GraphqlMiddlewareServerOptions, ModuleHooks, ModuleOptions, _default as default, defineGraphqlServerOptions };
|
|
220
|
+
export { GraphqlMiddlewareServerOptions, ModuleHooks, ModuleOptions, _default as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import { oldVisit } from '@graphql-codegen/plugin-helpers';
|
|
|
17
17
|
import { pascalCase } from 'change-case-all';
|
|
18
18
|
|
|
19
19
|
const name = "nuxt-graphql-middleware";
|
|
20
|
-
const version = "3.1.0-beta.
|
|
20
|
+
const version = "3.1.0-beta.1";
|
|
21
21
|
|
|
22
22
|
var GraphqlMiddlewareTemplate = /* @__PURE__ */ ((GraphqlMiddlewareTemplate2) => {
|
|
23
23
|
GraphqlMiddlewareTemplate2["OperationTypes"] = "graphql-operations.d.ts";
|
|
@@ -255,7 +255,7 @@ function validateDeprecated(options) {
|
|
|
255
255
|
);
|
|
256
256
|
if (key === "graphqlEndpoint") {
|
|
257
257
|
logger.info(`
|
|
258
|
-
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware'
|
|
258
|
+
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/server'
|
|
259
259
|
import { getHeader } from 'h3'
|
|
260
260
|
import acceptLanguageParser from 'accept-language-parser';
|
|
261
261
|
|
|
@@ -269,11 +269,11 @@ export default defineGraphqlServerOptions({
|
|
|
269
269
|
const language = languages[0]?.code || 'en'
|
|
270
270
|
return \`https://api.example.com/\${language}/graphql\`
|
|
271
271
|
}
|
|
272
|
-
}`);
|
|
272
|
+
})`);
|
|
273
273
|
}
|
|
274
274
|
if (key === "serverFetchOptions") {
|
|
275
275
|
logger.info(`
|
|
276
|
-
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware'
|
|
276
|
+
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/server'
|
|
277
277
|
import { getHeader } from 'h3'
|
|
278
278
|
|
|
279
279
|
// Pass the cookie from the client request to the GraphQL request.
|
|
@@ -285,11 +285,11 @@ export default defineGraphqlServerOptions({
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
-
}`);
|
|
288
|
+
})`);
|
|
289
289
|
}
|
|
290
290
|
if (key === "onServerResponse") {
|
|
291
291
|
logger.info(`
|
|
292
|
-
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware'
|
|
292
|
+
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/server'
|
|
293
293
|
import type { H3Event } from 'h3'
|
|
294
294
|
import type { FetchResponse } from 'ofetch'
|
|
295
295
|
|
|
@@ -310,11 +310,11 @@ export default defineGraphqlServerOptions({
|
|
|
310
310
|
// Return the GraphQL response.
|
|
311
311
|
return graphqlResponse._data
|
|
312
312
|
}
|
|
313
|
-
}`);
|
|
313
|
+
})`);
|
|
314
314
|
}
|
|
315
315
|
if (key === "onServerError") {
|
|
316
316
|
logger.info(`
|
|
317
|
-
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware'
|
|
317
|
+
import { defineGraphqlServerOptions } from 'nuxt-graphql-middleware/server'
|
|
318
318
|
import type { H3Event } from 'h3'
|
|
319
319
|
import type { FetchError } from 'ofetch'
|
|
320
320
|
|
|
@@ -326,8 +326,7 @@ export default defineGraphqlServerOptions({
|
|
|
326
326
|
errors: [error.message]
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
})
|
|
330
|
-
`);
|
|
329
|
+
})`);
|
|
331
330
|
}
|
|
332
331
|
throw new TypeError("Invalid configuration for graphqlMiddleware." + key);
|
|
333
332
|
}
|
|
@@ -665,8 +664,5 @@ declare module '#graphql-documents' {
|
|
|
665
664
|
}
|
|
666
665
|
}
|
|
667
666
|
});
|
|
668
|
-
function defineGraphqlServerOptions(options) {
|
|
669
|
-
return options;
|
|
670
|
-
}
|
|
671
667
|
|
|
672
|
-
export { module as default
|
|
668
|
+
export { module as default };
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-graphql-middleware",
|
|
3
|
-
"version": "3.1.0-beta.
|
|
3
|
+
"version": "3.1.0-beta.1",
|
|
4
4
|
"description": "Module to perform GraphQL requests as a server middleware.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
".": {
|
|
13
13
|
"import": "./dist/module.mjs",
|
|
14
14
|
"require": "./dist/module.cjs"
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
|
+
"./server": "./dist/runtime/serverOptions/index.mjs",
|
|
17
|
+
"./server/*": "./dist/runtime/serverOptions/*.mjs"
|
|
16
18
|
},
|
|
17
19
|
"main": "./dist/module.cjs",
|
|
18
20
|
"types": "./dist/types.d.ts",
|