nuxt-graphql-middleware 3.0.0-beta.0 → 3.0.0-beta.2
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 +3 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +7 -14
- package/package.json +1 -1
package/dist/module.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { NuxtModule } from '@nuxt/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { H3Event } from 'h3';
|
|
3
3
|
import { FetchOptions } from 'ohmyfetch';
|
|
4
4
|
import { TypeScriptDocumentsPluginConfig } from '@graphql-codegen/typescript-operations';
|
|
5
5
|
|
|
6
|
-
declare type GraphqlMiddlewareGraphqlEndpointMethod = (event?:
|
|
7
|
-
declare type GraphqlMiddlewareServerFetchOptionsMethod = (event?:
|
|
6
|
+
declare type GraphqlMiddlewareGraphqlEndpointMethod = (event?: H3Event, operation?: string, operationName?: string) => string;
|
|
7
|
+
declare type GraphqlMiddlewareServerFetchOptionsMethod = (event?: H3Event, operation?: string, operationName?: string) => FetchOptions;
|
|
8
8
|
interface GraphqlMiddlewareConfig {
|
|
9
9
|
/**
|
|
10
10
|
* File glob patterns for the auto import feature.
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { fileURLToPath } from 'url';
|
|
2
2
|
import { promises } from 'fs';
|
|
3
|
-
import { useLogger, defineNuxtModule, createResolver, addTemplate, addPlugin, addServerHandler, resolveFiles, resolveAlias } from '@nuxt/kit';
|
|
3
|
+
import { useLogger, defineNuxtModule, createResolver, addImportsDir, addTemplate, addPlugin, addServerHandler, resolveFiles, resolveAlias } from '@nuxt/kit';
|
|
4
4
|
import { generate as generate$1 } from '@graphql-codegen/cli';
|
|
5
5
|
import * as PluginTypescript from '@graphql-codegen/typescript';
|
|
6
6
|
import * as PluginTypescriptOperations from '@graphql-codegen/typescript-operations';
|
|
@@ -7042,15 +7042,11 @@ const module = defineNuxtModule({
|
|
|
7042
7042
|
const ctx = {
|
|
7043
7043
|
templates: await generate(options, schemaPath, srcResolver)
|
|
7044
7044
|
};
|
|
7045
|
-
nuxt.options.runtimeConfig = {
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
},
|
|
7051
|
-
graphqlMiddleware: {
|
|
7052
|
-
rootDir
|
|
7053
|
-
}
|
|
7045
|
+
nuxt.options.runtimeConfig.public["nuxt-graphql-middleware"] = {
|
|
7046
|
+
serverApiPrefix: options.serverApiPrefix
|
|
7047
|
+
};
|
|
7048
|
+
nuxt.options.runtimeConfig.graphqlMiddleware = {
|
|
7049
|
+
rootDir
|
|
7054
7050
|
};
|
|
7055
7051
|
nuxt.hook("builder:watch", async (_event, path) => {
|
|
7056
7052
|
if (!path.match(/\.(gql|graphql)$/)) {
|
|
@@ -7059,10 +7055,7 @@ const module = defineNuxtModule({
|
|
|
7059
7055
|
ctx.templates = await generate(options, schemaPath, srcResolver);
|
|
7060
7056
|
await nuxt.callHook("builder:generateApp");
|
|
7061
7057
|
});
|
|
7062
|
-
|
|
7063
|
-
const composablesDir = moduleResolver("runtime/composables");
|
|
7064
|
-
dirs.push(composablesDir);
|
|
7065
|
-
});
|
|
7058
|
+
addImportsDir(moduleResolver("runtime/composables"));
|
|
7066
7059
|
Object.values(GraphqlMiddlewareTemplate).forEach((filename) => {
|
|
7067
7060
|
const result = addTemplate({
|
|
7068
7061
|
write: true,
|