Skip to content

Commit 7f3503c

Browse files
committed
earlier version and mode log
1 parent b6e8463 commit 7f3503c

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

packages/gateway/src/commands/proxy.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export const addCommand: AddCommand = (ctx, cli) =>
4444
hivePersistedDocumentsToken,
4545
...opts
4646
} = this.optsWithGlobals();
47+
48+
ctx.log.info(`Starting ${ctx.productName} ${ctx.version} in proxy mode`);
49+
4750
const loadedConfig = await loadConfig({
4851
log: ctx.log,
4952
configPath: opts.configPath,
@@ -198,16 +201,11 @@ export const addCommand: AddCommand = (ctx, cli) =>
198201

199202
export type ProxyConfig = GatewayConfigProxy & GatewayCLIConfig;
200203

201-
export async function runProxy(
202-
{ log, productName, version }: CLIContext,
203-
config: ProxyConfig,
204-
) {
204+
export async function runProxy({ log }: CLIContext, config: ProxyConfig) {
205205
if (handleFork(log, config)) {
206206
return;
207207
}
208208

209-
log.info(`Starting ${productName} ${version} in proxy mode`);
210-
211209
log.info(`Proxying requests to ${config.proxy.endpoint}`);
212210

213211
const runtime = createGatewayRuntime(config);

packages/gateway/src/commands/subgraph.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export const addCommand: AddCommand = (ctx, cli) =>
4545
hivePersistedDocumentsToken,
4646
...opts
4747
} = this.optsWithGlobals();
48+
49+
ctx.log.info(`Starting ${ctx.productName} ${ctx.version} as subgraph`);
50+
4851
const loadedConfig = await loadConfig({
4952
log: ctx.log,
5053
configPath: opts.configPath,
@@ -158,10 +161,7 @@ export const addCommand: AddCommand = (ctx, cli) =>
158161

159162
export type SubgraphConfig = GatewayConfigSubgraph & GatewayCLIConfig;
160163

161-
export async function runSubgraph(
162-
{ log, productName, version }: CLIContext,
163-
config: SubgraphConfig,
164-
) {
164+
export async function runSubgraph({ log }: CLIContext, config: SubgraphConfig) {
165165
let absSchemaPath: string | null = null;
166166
if (
167167
typeof config.subgraph === 'string' &&
@@ -183,8 +183,6 @@ export async function runSubgraph(
183183
return;
184184
}
185185

186-
log.info(`Starting ${productName} ${version} as subgraph`);
187-
188186
const runtime = createGatewayRuntime(config);
189187

190188
if (absSchemaPath) {

packages/gateway/src/commands/supergraph.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ export const addCommand: AddCommand = (ctx, cli) =>
6565
// TODO: move to optsWithGlobals once https://github.com/commander-js/extra-typings/pull/76 is merged
6666
const { apolloUplink } = this.opts();
6767

68+
ctx.log.info(
69+
`Starting ${ctx.productName} ${ctx.version} with supergraph`,
70+
);
71+
6872
const loadedConfig = await loadConfig({
6973
log: ctx.log,
7074
configPath: opts.configPath,
@@ -259,7 +263,7 @@ export const addCommand: AddCommand = (ctx, cli) =>
259263
export type SupergraphConfig = GatewayConfigSupergraph & GatewayCLIConfig;
260264

261265
export async function runSupergraph(
262-
{ productName, version, log }: CLIContext,
266+
{ log }: CLIContext,
263267
config: SupergraphConfig,
264268
) {
265269
let absSchemaPath: string | null = null;
@@ -329,8 +333,6 @@ export async function runSupergraph(
329333
return;
330334
}
331335

332-
log.info(`Starting ${productName} ${version} with supergraph`);
333-
334336
if (config.additionalTypeDefs) {
335337
const loaders = [new GraphQLFileLoader(), new CodeFileLoader()];
336338
const additionalTypeDefsArr = asArray(config.additionalTypeDefs);

0 commit comments

Comments
 (0)