nuxt-graphql-middleware 3.0.0-beta.4 → 3.0.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/README.md +5 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +17 -2
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -58,3 +58,8 @@ console.log(data.allFilms.films)
|
|
|
58
58
|
Alternatively you can also call
|
|
59
59
|
`http://localhost:3000/api/graphql_middleware/query/films` to get the same
|
|
60
60
|
result.
|
|
61
|
+
|
|
62
|
+
## Nuxt 2
|
|
63
|
+
|
|
64
|
+
The 3.x releases are only compatible with Nuxt 3. The [2.x branch](https://github.com/dulnan/nuxt-graphql-middleware/tree/2.x) and releases
|
|
65
|
+
on npm are compatible with Nuxt 2.
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fileURLToPath } from 'url';
|
|
1
2
|
import { defu } from 'defu';
|
|
2
3
|
import { useLogger, resolveAlias, resolveFiles, defineNuxtModule, createResolver, addImportsDir, addTemplate, addServerHandler, updateTemplates } from '@nuxt/kit';
|
|
3
4
|
import inquirer from 'inquirer';
|
|
@@ -16,7 +17,7 @@ import { oldVisit } from '@graphql-codegen/plugin-helpers';
|
|
|
16
17
|
import { pascalCase } from 'change-case-all';
|
|
17
18
|
|
|
18
19
|
const name = "nuxt-graphql-middleware";
|
|
19
|
-
const version = "3.0.
|
|
20
|
+
const version = "3.0.1";
|
|
20
21
|
|
|
21
22
|
var GraphqlMiddlewareTemplate = /* @__PURE__ */ ((GraphqlMiddlewareTemplate2) => {
|
|
22
23
|
GraphqlMiddlewareTemplate2["OperationTypes"] = "graphql-operations.d.ts";
|
|
@@ -402,7 +403,13 @@ const module = defineNuxtModule({
|
|
|
402
403
|
const moduleResolver = createResolver(import.meta.url).resolve;
|
|
403
404
|
const srcDir = nuxt.options.srcDir;
|
|
404
405
|
const srcResolver = createResolver(srcDir).resolve;
|
|
405
|
-
const schemaPath = await getSchemaPath(
|
|
406
|
+
const schemaPath = await getSchemaPath(
|
|
407
|
+
options,
|
|
408
|
+
srcResolver,
|
|
409
|
+
options.downloadSchema
|
|
410
|
+
);
|
|
411
|
+
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
412
|
+
nuxt.options.build.transpile.push(runtimeDir);
|
|
406
413
|
const ctx = {
|
|
407
414
|
templates: []
|
|
408
415
|
};
|
|
@@ -505,6 +512,14 @@ declare module '#graphql-documents' {
|
|
|
505
512
|
handler: moduleResolver("./runtime/serverHandler/index"),
|
|
506
513
|
route: options.serverApiPrefix + "/:operation/:name"
|
|
507
514
|
});
|
|
515
|
+
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
516
|
+
nitroConfig.externals = defu(
|
|
517
|
+
typeof nitroConfig.externals === "object" ? nitroConfig.externals : {},
|
|
518
|
+
{
|
|
519
|
+
inline: [moduleResolver("./runtime")]
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
});
|
|
508
523
|
if (nuxt.options.dev) {
|
|
509
524
|
nuxt.hook("nitro:build:before", (nitro) => {
|
|
510
525
|
nuxt.hook("builder:watch", async (event, path) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-graphql-middleware",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
|
+
"description": "Module to perform GraphQL requests as a server middleware.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/dulnan/nuxt-graphql-middleware.git"
|
|
8
|
+
},
|
|
4
9
|
"license": "MIT",
|
|
5
10
|
"type": "module",
|
|
6
11
|
"exports": {
|
|
@@ -60,7 +65,7 @@
|
|
|
60
65
|
"strip-ansi": "^7.0.1",
|
|
61
66
|
"typedoc": "^0.23.21",
|
|
62
67
|
"typedoc-plugin-markdown": "^3.14.0",
|
|
63
|
-
"vitepress": "^1.0.0-alpha.
|
|
68
|
+
"vitepress": "^1.0.0-alpha.30",
|
|
64
69
|
"vitest": "^0.25.3"
|
|
65
70
|
}
|
|
66
71
|
}
|