nuxt-graphql-middleware 2.0.3 → 2.0.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/types/codegen.d.ts +13 -0
- package/dist/types/codegen.d.ts.map +1 -0
- package/dist/types/graphqlImport.d.ts +2 -0
- package/dist/types/graphqlImport.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/module.d.ts +18 -0
- package/dist/types/module.d.ts.map +1 -0
- package/dist/types/serverMiddleware.d.ts +13 -0
- package/dist/types/serverMiddleware.d.ts.map +1 -0
- package/dist/types/templates/plugin.d.ts +24 -0
- package/dist/types/templates/plugin.d.ts.map +1 -0
- package/package.json +3 -2
- package/types/index.d.ts +6 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface GraphqlMiddlewareCodegenConfig {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
skipSchemaDownload?: boolean;
|
|
4
|
+
resolvedQueriesPath: string;
|
|
5
|
+
schemaOutputPath: string;
|
|
6
|
+
typesOutputPath: string;
|
|
7
|
+
schemaOptions: any;
|
|
8
|
+
}
|
|
9
|
+
export default function (graphqlServer: string, options: GraphqlMiddlewareCodegenConfig): {
|
|
10
|
+
generateSchema: () => Promise<any>;
|
|
11
|
+
generateTypes: () => Promise<any>;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/codegen.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,GAAG,CAAA;CACnB;AAED,MAAM,CAAC,OAAO,WACZ,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,8BAA8B;;;EAmDxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphqlImport.d.ts","sourceRoot":"","sources":["../../src/graphqlImport.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,WAAW,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OASnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Module } from '@nuxt/types';
|
|
2
|
+
import { GraphqlMiddlewarePluginConfig } from './templates/plugin';
|
|
3
|
+
import { GraphqlServerMiddlewareConfig } from './serverMiddleware';
|
|
4
|
+
import { GraphqlMiddlewareCodegenConfig } from './codegen';
|
|
5
|
+
export interface GraphqlMiddlewareConfig {
|
|
6
|
+
graphqlServer: string;
|
|
7
|
+
typescript?: GraphqlMiddlewareCodegenConfig;
|
|
8
|
+
endpointNamespace?: string;
|
|
9
|
+
debug: boolean;
|
|
10
|
+
queries: Record<string, string>;
|
|
11
|
+
mutations: Record<string, string>;
|
|
12
|
+
outputPath: string;
|
|
13
|
+
plugin?: GraphqlMiddlewarePluginConfig;
|
|
14
|
+
server?: GraphqlServerMiddlewareConfig;
|
|
15
|
+
}
|
|
16
|
+
declare const graphqlMiddleware: Module;
|
|
17
|
+
export default graphqlMiddleware;
|
|
18
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAyB,EACvB,6BAA6B,EAC9B,MAAM,oBAAoB,CAAA;AAE3B,OAAgB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAA;AAMnE,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,8BAA8B,CAAA;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,6BAA6B,CAAA;IACtC,MAAM,CAAC,EAAE,6BAA6B,CAAA;CACvC;AAiED,QAAA,MAAM,iBAAiB,EAAE,MAgKxB,CAAA;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Request, RequestHandler } from 'express';
|
|
2
|
+
export interface GraphqlServerMiddlewareConfig {
|
|
3
|
+
middleware?: RequestHandler;
|
|
4
|
+
fetchOptions?: any;
|
|
5
|
+
buildHeaders?: (req: Request, name: string, type: string) => any;
|
|
6
|
+
buildEndpoint?: (req: Request) => string;
|
|
7
|
+
onQueryResponse?: any;
|
|
8
|
+
onQueryError?: any;
|
|
9
|
+
onMutationResponse?: any;
|
|
10
|
+
onMutationError?: any;
|
|
11
|
+
}
|
|
12
|
+
export default function createServerMiddleware(graphqlServer: string, queries: Map<string, any>, mutations: Map<string, any>, config?: GraphqlServerMiddlewareConfig): import("express-serve-static-core").Express;
|
|
13
|
+
//# sourceMappingURL=serverMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serverMiddleware.d.ts","sourceRoot":"","sources":["../../src/serverMiddleware.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,cAAc,EAAY,MAAM,SAAS,CAAA;AAcpE,MAAM,WAAW,6BAA6B;IAC5C,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,YAAY,CAAC,EAAE,GAAG,CAAA;IAClB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,GAAG,CAAA;IAChE,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,CAAA;IACxC,eAAe,CAAC,EAAE,GAAG,CAAA;IACrB,YAAY,CAAC,EAAE,GAAG,CAAA;IAClB,kBAAkB,CAAC,EAAE,GAAG,CAAA;IACxB,eAAe,CAAC,EAAE,GAAG,CAAA;CACtB;AAkBD,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAC5C,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,MAAM,CAAC,EAAE,6BAA6B,+CA0FvC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Context, Plugin } from '@nuxt/types';
|
|
2
|
+
export interface GraphqlMiddlewarePluginConfig {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
port?: number;
|
|
5
|
+
cacheInBrowser?: boolean;
|
|
6
|
+
cacheInServer?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class GraphqlMiddlewarePlugin {
|
|
9
|
+
baseURL: string;
|
|
10
|
+
headers: any;
|
|
11
|
+
beforeRequestFn: Function | undefined;
|
|
12
|
+
cache?: Map<string, any>;
|
|
13
|
+
context: any;
|
|
14
|
+
constructor(baseURL: string, headers: any, useCache: boolean, context: Context);
|
|
15
|
+
getPluginHeaderValue(): {
|
|
16
|
+
'Nuxt-Graphql-Middleware-Route': any;
|
|
17
|
+
};
|
|
18
|
+
beforeRequest(fn: Function): void;
|
|
19
|
+
query(name: string, variables?: any, headers?: any): Promise<any>;
|
|
20
|
+
mutate(name: string, variables?: any, headers?: any): Promise<any>;
|
|
21
|
+
}
|
|
22
|
+
declare const graphqlMiddlewarePlugin: Plugin;
|
|
23
|
+
export default graphqlMiddlewarePlugin;
|
|
24
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/templates/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAW7C,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,qBAAa,uBAAuB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,GAAG,CAAA;IACZ,eAAe,EAAE,QAAQ,GAAG,SAAS,CAAA;IACrC,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,OAAO,EAAE,GAAG,CAAA;gBAGV,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,OAAO;IAUlB,oBAAoB;;;IAMpB,aAAa,CAAC,EAAE,EAAE,QAAQ;IAO1B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,GAAE,GAAQ;IAgDtD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,OAAO,GAAE,GAAQ;CAuBxD;AAED,QAAA,MAAM,uBAAuB,EAAE,MAyB9B,CAAA;AAED,eAAe,uBAAuB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-graphql-middleware",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Module to perform GraphQL requests as a server middleware.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"module.cjs",
|
|
27
27
|
"dist/*.js",
|
|
28
28
|
"dist/*.mjs",
|
|
29
|
-
"dist/*.d.ts"
|
|
29
|
+
"dist/*.d.ts",
|
|
30
|
+
"dist/types/*"
|
|
30
31
|
],
|
|
31
32
|
"scripts": {
|
|
32
33
|
"build": "unbuild && npm run generate-types",
|