@graphql-mesh/http 0.1.12 → 0.1.13
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/index.d.ts +8 -2
- package/index.js +3 -1
- package/index.mjs +4 -2
- package/package.json +2 -1
package/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MeshInstance } from '@graphql-mesh/runtime';
|
|
2
|
+
import { YamlConfig } from '@graphql-mesh/types';
|
|
2
3
|
import { ServerAdapter } from '@whatwg-node/server';
|
|
3
4
|
import { Router } from 'itty-router';
|
|
4
|
-
export declare function createMeshHTTPHandler<TServerContext>({ baseDir, getBuiltMesh,
|
|
5
|
+
export declare function createMeshHTTPHandler<TServerContext>({ baseDir, getBuiltMesh, rawServeConfig, playgroundTitle, }: {
|
|
6
|
+
baseDir: string;
|
|
7
|
+
getBuiltMesh: () => Promise<MeshInstance>;
|
|
8
|
+
rawServeConfig?: YamlConfig.Config['serve'];
|
|
9
|
+
playgroundTitle?: string;
|
|
10
|
+
}): ServerAdapter<TServerContext, Router<Request>>;
|
package/index.js
CHANGED
|
@@ -39,10 +39,12 @@ const graphqlHandler = (mesh$, playgroundTitle, playgroundEnabled, graphqlEndpoi
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
function createMeshHTTPHandler({ baseDir, getBuiltMesh,
|
|
42
|
+
function createMeshHTTPHandler({ baseDir, getBuiltMesh, rawServeConfig = {}, playgroundTitle, }) {
|
|
43
43
|
let readyFlag = false;
|
|
44
|
+
let logger = new utils.DefaultLogger('Mesh HTTP');
|
|
44
45
|
const mesh$ = getBuiltMesh().then(mesh => {
|
|
45
46
|
readyFlag = true;
|
|
47
|
+
logger = mesh.logger.child('HTTP');
|
|
46
48
|
return mesh;
|
|
47
49
|
});
|
|
48
50
|
const { cors: corsConfig, staticFiles, playground: playgroundEnabled = crossHelpers.process.env.NODE_ENV !== 'production', endpoint: graphqlPath = '/graphql',
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { process, path, fs } from '@graphql-mesh/cross-helpers';
|
|
2
|
-
import { pathExists } from '@graphql-mesh/utils';
|
|
2
|
+
import { DefaultLogger, pathExists } from '@graphql-mesh/utils';
|
|
3
3
|
import { createServerAdapter } from '@whatwg-node/server';
|
|
4
4
|
import { Router } from 'itty-router';
|
|
5
5
|
import { withCookies } from 'itty-router-extras';
|
|
@@ -35,10 +35,12 @@ const graphqlHandler = (mesh$, playgroundTitle, playgroundEnabled, graphqlEndpoi
|
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
function createMeshHTTPHandler({ baseDir, getBuiltMesh,
|
|
38
|
+
function createMeshHTTPHandler({ baseDir, getBuiltMesh, rawServeConfig = {}, playgroundTitle, }) {
|
|
39
39
|
let readyFlag = false;
|
|
40
|
+
let logger = new DefaultLogger('Mesh HTTP');
|
|
40
41
|
const mesh$ = getBuiltMesh().then(mesh => {
|
|
41
42
|
readyFlag = true;
|
|
43
|
+
logger = mesh.logger.child('HTTP');
|
|
42
44
|
return mesh;
|
|
43
45
|
});
|
|
44
46
|
const { cors: corsConfig, staticFiles, playground: playgroundEnabled = process.env.NODE_ENV !== 'production', endpoint: graphqlPath = '/graphql',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/http",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "*"
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@graphql-mesh/cross-helpers": "0.2.6",
|
|
10
10
|
"@graphql-mesh/runtime": "0.44.9",
|
|
11
|
+
"@graphql-mesh/types": "0.84.0",
|
|
11
12
|
"@graphql-mesh/utils": "0.41.11",
|
|
12
13
|
"@whatwg-node/fetch": "^0.4.3",
|
|
13
14
|
"@whatwg-node/server": "0.3.0",
|