Skip to content

Commit 03cb021

Browse files
author
Gerald Baulig
committed
fix(facade): export namespace and serviceKey overrides to service config
1 parent 7d3eaac commit 03cb021

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/facade/src/gql/protos/resolvers.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,10 @@ export const getGQLResolverFunctions =
121121
}
122122

123123
(obj as any)[methodName] = async (args: any, context: ServiceClient<CTX, keyof CTX, T>) => {
124-
let client;
125-
// rename master_data and ostorage name space to actual service names in proto files
126-
if (key == 'master_data') {
127-
key = 'resource' as NS;
128-
} else if (key == 'ostorage') {
129-
serviceKey = 'ostorage' as B;
130-
}
131-
client = context[key].client;
124+
// remap namespace and serviceKey if given
125+
key = cfg.get(key)?.namespace ?? key;
126+
serviceKey = cfg.get(key)?.serviceKey ?? serviceKey;
127+
const client = context[key].client;
132128
const service = client[serviceKey];
133129
try {
134130
const converted = await preprocessGQLInput(args.input, typing.input);

0 commit comments

Comments
 (0)