nuxt-graphql-middleware 3.0.0-beta.4 → 3.0.0
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 +12 -1
- 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.0
|
|
20
|
+
const version = "3.0.0";
|
|
20
21
|
|
|
21
22
|
var GraphqlMiddlewareTemplate = /* @__PURE__ */ ((GraphqlMiddlewareTemplate2) => {
|
|
22
23
|
GraphqlMiddlewareTemplate2["OperationTypes"] = "graphql-operations.d.ts";
|
|
@@ -403,6 +404,8 @@ const module = defineNuxtModule({
|
|
|
403
404
|
const srcDir = nuxt.options.srcDir;
|
|
404
405
|
const srcResolver = createResolver(srcDir).resolve;
|
|
405
406
|
const schemaPath = await getSchemaPath(options, srcResolver);
|
|
407
|
+
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
408
|
+
nuxt.options.build.transpile.push(runtimeDir);
|
|
406
409
|
const ctx = {
|
|
407
410
|
templates: []
|
|
408
411
|
};
|
|
@@ -505,6 +508,14 @@ declare module '#graphql-documents' {
|
|
|
505
508
|
handler: moduleResolver("./runtime/serverHandler/index"),
|
|
506
509
|
route: options.serverApiPrefix + "/:operation/:name"
|
|
507
510
|
});
|
|
511
|
+
nuxt.hook("nitro:config", (nitroConfig) => {
|
|
512
|
+
nitroConfig.externals = defu(
|
|
513
|
+
typeof nitroConfig.externals === "object" ? nitroConfig.externals : {},
|
|
514
|
+
{
|
|
515
|
+
inline: [moduleResolver("./runtime")]
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
});
|
|
508
519
|
if (nuxt.options.dev) {
|
|
509
520
|
nuxt.hook("nitro:build:before", (nitro) => {
|
|
510
521
|
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.0
|
|
3
|
+
"version": "3.0.0",
|
|
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
|
}
|