@graphql-mesh/transport-grpc 0.2.9 → 0.2.10
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/cjs/index.js +2 -1
- package/esm/index.js +3 -2
- package/package.json +4 -3
- package/typings/index.d.cts +1 -1
- package/typings/index.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -15,6 +15,7 @@ const disposablestack_1 = require("@whatwg-node/disposablestack");
|
|
|
15
15
|
const utils_js_1 = require("./utils.js");
|
|
16
16
|
require("./patchLongJs.js");
|
|
17
17
|
const utils_2 = require("@graphql-mesh/utils");
|
|
18
|
+
const promise_helpers_1 = require("@whatwg-node/promise-helpers");
|
|
18
19
|
class GrpcTransportHelper extends disposablestack_1.DisposableStack {
|
|
19
20
|
constructor(subgraphName, baseDir, logger, endpoint, config) {
|
|
20
21
|
super();
|
|
@@ -221,7 +222,7 @@ exports.GrpcTransportHelper = GrpcTransportHelper;
|
|
|
221
222
|
exports.default = {
|
|
222
223
|
getSubgraphExecutor({ transportEntry, subgraph, cwd, logger }) {
|
|
223
224
|
const transport = new GrpcTransportHelper(transportEntry.subgraph, cwd, logger, transportEntry.location, transportEntry.options);
|
|
224
|
-
return (0,
|
|
225
|
+
return (0, promise_helpers_1.handleMaybePromise)(() => transport.getCredentials(), creds => {
|
|
225
226
|
transport.processDirectives({ schema: subgraph, creds });
|
|
226
227
|
return (0, utils_2.makeDisposable)((0, transport_common_1.createDefaultExecutor)(subgraph), () => transport.dispose());
|
|
227
228
|
});
|
package/esm/index.js
CHANGED
|
@@ -4,13 +4,14 @@ import lodashGet from 'lodash.get';
|
|
|
4
4
|
import { fs, path, process } from '@graphql-mesh/cross-helpers';
|
|
5
5
|
import { stringInterpolator } from '@graphql-mesh/string-interpolation';
|
|
6
6
|
import { createDefaultExecutor, ObjMapScalar, } from '@graphql-mesh/transport-common';
|
|
7
|
-
import { getDirective, getDirectives, getRootTypes,
|
|
7
|
+
import { getDirective, getDirectives, getRootTypes, } from '@graphql-tools/utils';
|
|
8
8
|
import { credentials, loadPackageDefinition } from '@grpc/grpc-js';
|
|
9
9
|
import { fromJSON } from '@grpc/proto-loader';
|
|
10
10
|
import { DisposableStack } from '@whatwg-node/disposablestack';
|
|
11
11
|
import { addExecutionLogicToScalar, addMetaDataToCall } from './utils.js';
|
|
12
12
|
import './patchLongJs.js';
|
|
13
13
|
import { makeDisposable } from '@graphql-mesh/utils';
|
|
14
|
+
import { handleMaybePromise } from '@whatwg-node/promise-helpers';
|
|
14
15
|
export class GrpcTransportHelper extends DisposableStack {
|
|
15
16
|
constructor(subgraphName, baseDir, logger, endpoint, config) {
|
|
16
17
|
super();
|
|
@@ -216,7 +217,7 @@ export class GrpcTransportHelper extends DisposableStack {
|
|
|
216
217
|
export default {
|
|
217
218
|
getSubgraphExecutor({ transportEntry, subgraph, cwd, logger }) {
|
|
218
219
|
const transport = new GrpcTransportHelper(transportEntry.subgraph, cwd, logger, transportEntry.location, transportEntry.options);
|
|
219
|
-
return
|
|
220
|
+
return handleMaybePromise(() => transport.getCredentials(), creds => {
|
|
220
221
|
transport.processDirectives({ schema: subgraph, creds });
|
|
221
222
|
return makeDisposable(createDefaultExecutor(subgraph), () => transport.dispose());
|
|
222
223
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/transport-grpc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "*"
|
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
"@graphql-mesh/cross-helpers": "^0.4.10",
|
|
10
10
|
"@graphql-mesh/string-interpolation": "^0.5.8",
|
|
11
11
|
"@graphql-mesh/transport-common": "^0.7.13",
|
|
12
|
-
"@graphql-mesh/types": "^0.103.
|
|
13
|
-
"@graphql-mesh/utils": "^0.103.
|
|
12
|
+
"@graphql-mesh/types": "^0.103.20",
|
|
13
|
+
"@graphql-mesh/utils": "^0.103.20",
|
|
14
14
|
"@graphql-tools/utils": "^10.8.0",
|
|
15
15
|
"@grpc/grpc-js": "^1.1.7",
|
|
16
16
|
"@grpc/proto-loader": "^0.7.8",
|
|
17
17
|
"@whatwg-node/disposablestack": "^0.0.5",
|
|
18
|
+
"@whatwg-node/promise-helpers": "^1.0.0",
|
|
18
19
|
"graphql-scalars": "^1.22.4",
|
|
19
20
|
"lodash.get": "^4.4.2",
|
|
20
21
|
"long": "4.0.0",
|
package/typings/index.d.cts
CHANGED
|
@@ -69,6 +69,6 @@ export declare class GrpcTransportHelper extends DisposableStack {
|
|
|
69
69
|
}): void;
|
|
70
70
|
}
|
|
71
71
|
declare const _default: {
|
|
72
|
-
getSubgraphExecutor({ transportEntry, subgraph, cwd, logger }: import("@graphql-mesh/transport-common").TransportGetSubgraphExecutorOptions<gRPCTransportOptions>):
|
|
72
|
+
getSubgraphExecutor({ transportEntry, subgraph, cwd, logger }: import("@graphql-mesh/transport-common").TransportGetSubgraphExecutorOptions<gRPCTransportOptions>): import("@whatwg-node/promise-helpers").MaybePromiseLike<import("@graphql-mesh/transport-common").Executor & Disposable>;
|
|
73
73
|
};
|
|
74
74
|
export default _default;
|
package/typings/index.d.ts
CHANGED
|
@@ -69,6 +69,6 @@ export declare class GrpcTransportHelper extends DisposableStack {
|
|
|
69
69
|
}): void;
|
|
70
70
|
}
|
|
71
71
|
declare const _default: {
|
|
72
|
-
getSubgraphExecutor({ transportEntry, subgraph, cwd, logger }: import("@graphql-mesh/transport-common").TransportGetSubgraphExecutorOptions<gRPCTransportOptions>):
|
|
72
|
+
getSubgraphExecutor({ transportEntry, subgraph, cwd, logger }: import("@graphql-mesh/transport-common").TransportGetSubgraphExecutorOptions<gRPCTransportOptions>): import("@whatwg-node/promise-helpers").MaybePromiseLike<import("@graphql-mesh/transport-common").Executor & Disposable>;
|
|
73
73
|
};
|
|
74
74
|
export default _default;
|