nuxt-graphql-middleware 2.1.3 → 2.2.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/dist/module.mjs
CHANGED
|
@@ -41,7 +41,7 @@ function createServerMiddleware(graphqlServer, queries, mutations, config) {
|
|
|
41
41
|
const clients = new Map();
|
|
42
42
|
function getClient(endpoint) {
|
|
43
43
|
if (!clients.has(endpoint)) {
|
|
44
|
-
const client = new GraphQLClient(endpoint);
|
|
44
|
+
const client = new GraphQLClient(endpoint, config?.graphqlClientOptions);
|
|
45
45
|
clients.set(endpoint, client);
|
|
46
46
|
}
|
|
47
47
|
return clients.get(endpoint);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Request, RequestHandler } from 'express';
|
|
2
|
+
import * as Dom from 'graphql-request/dist/types.dom';
|
|
2
3
|
export interface GraphqlServerMiddlewareConfig {
|
|
3
4
|
middleware?: RequestHandler;
|
|
4
5
|
fetchOptions?: any;
|
|
@@ -8,6 +9,7 @@ export interface GraphqlServerMiddlewareConfig {
|
|
|
8
9
|
onQueryError?: any;
|
|
9
10
|
onMutationResponse?: any;
|
|
10
11
|
onMutationError?: any;
|
|
12
|
+
graphqlClientOptions?: Dom.RequestInit;
|
|
11
13
|
}
|
|
12
14
|
export default function createServerMiddleware(graphqlServer: string, queries: Map<string, any>, mutations: Map<string, any>, config?: GraphqlServerMiddlewareConfig): import("express-serve-static-core").Express;
|
|
13
15
|
//# sourceMappingURL=serverMiddleware.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"serverMiddleware.d.ts","sourceRoot":"","sources":["../../src/serverMiddleware.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,cAAc,EAAY,MAAM,SAAS,CAAA;AAEpE,OAAO,KAAK,GAAG,MAAM,gCAAgC,CAAA;AAarD,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;IAIrB,oBAAoB,CAAC,EAAE,GAAG,CAAC,WAAW,CAAA;CACvC;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"}
|