File tree Expand file tree Collapse file tree 3 files changed +13
-15
lines changed
packages/gateway/src/commands Expand file tree Collapse file tree 3 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ export const addCommand: AddCommand = (ctx, cli) =>
44
44
hivePersistedDocumentsToken,
45
45
...opts
46
46
} = this . optsWithGlobals ( ) ;
47
+
48
+ ctx . log . info ( `Starting ${ ctx . productName } ${ ctx . version } in proxy mode` ) ;
49
+
47
50
const loadedConfig = await loadConfig ( {
48
51
log : ctx . log ,
49
52
configPath : opts . configPath ,
@@ -198,16 +201,11 @@ export const addCommand: AddCommand = (ctx, cli) =>
198
201
199
202
export type ProxyConfig = GatewayConfigProxy & GatewayCLIConfig ;
200
203
201
- export async function runProxy (
202
- { log, productName, version } : CLIContext ,
203
- config : ProxyConfig ,
204
- ) {
204
+ export async function runProxy ( { log } : CLIContext , config : ProxyConfig ) {
205
205
if ( handleFork ( log , config ) ) {
206
206
return ;
207
207
}
208
208
209
- log . info ( `Starting ${ productName } ${ version } in proxy mode` ) ;
210
-
211
209
log . info ( `Proxying requests to ${ config . proxy . endpoint } ` ) ;
212
210
213
211
const runtime = createGatewayRuntime ( config ) ;
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ export const addCommand: AddCommand = (ctx, cli) =>
45
45
hivePersistedDocumentsToken,
46
46
...opts
47
47
} = this . optsWithGlobals ( ) ;
48
+
49
+ ctx . log . info ( `Starting ${ ctx . productName } ${ ctx . version } as subgraph` ) ;
50
+
48
51
const loadedConfig = await loadConfig ( {
49
52
log : ctx . log ,
50
53
configPath : opts . configPath ,
@@ -158,10 +161,7 @@ export const addCommand: AddCommand = (ctx, cli) =>
158
161
159
162
export type SubgraphConfig = GatewayConfigSubgraph & GatewayCLIConfig ;
160
163
161
- export async function runSubgraph (
162
- { log, productName, version } : CLIContext ,
163
- config : SubgraphConfig ,
164
- ) {
164
+ export async function runSubgraph ( { log } : CLIContext , config : SubgraphConfig ) {
165
165
let absSchemaPath : string | null = null ;
166
166
if (
167
167
typeof config . subgraph === 'string' &&
@@ -183,8 +183,6 @@ export async function runSubgraph(
183
183
return ;
184
184
}
185
185
186
- log . info ( `Starting ${ productName } ${ version } as subgraph` ) ;
187
-
188
186
const runtime = createGatewayRuntime ( config ) ;
189
187
190
188
if ( absSchemaPath ) {
Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ export const addCommand: AddCommand = (ctx, cli) =>
65
65
// TODO: move to optsWithGlobals once https://github.com/commander-js/extra-typings/pull/76 is merged
66
66
const { apolloUplink } = this . opts ( ) ;
67
67
68
+ ctx . log . info (
69
+ `Starting ${ ctx . productName } ${ ctx . version } with supergraph` ,
70
+ ) ;
71
+
68
72
const loadedConfig = await loadConfig ( {
69
73
log : ctx . log ,
70
74
configPath : opts . configPath ,
@@ -259,7 +263,7 @@ export const addCommand: AddCommand = (ctx, cli) =>
259
263
export type SupergraphConfig = GatewayConfigSupergraph & GatewayCLIConfig ;
260
264
261
265
export async function runSupergraph (
262
- { productName , version , log } : CLIContext ,
266
+ { log } : CLIContext ,
263
267
config : SupergraphConfig ,
264
268
) {
265
269
let absSchemaPath : string | null = null ;
@@ -329,8 +333,6 @@ export async function runSupergraph(
329
333
return ;
330
334
}
331
335
332
- log . info ( `Starting ${ productName } ${ version } with supergraph` ) ;
333
-
334
336
if ( config . additionalTypeDefs ) {
335
337
const loaders = [ new GraphQLFileLoader ( ) , new CodeFileLoader ( ) ] ;
336
338
const additionalTypeDefsArr = asArray ( config . additionalTypeDefs ) ;
You can’t perform that action at this time.
0 commit comments