Skip to content

Commit 5414a01

Browse files
committed
Support the localSchemaFile flag for client:codegen
1 parent c9376b2 commit 5414a01

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

packages/apollo/src/Command.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ export abstract class ProjectCommand extends Command {
6969
endpoint: flags.string({
7070
description: "The url of your service"
7171
}),
72-
localSchemaFile: flags.string({
73-
description: "Path to your local GraphQL schema file"
74-
}),
7572
key: flags.string({
7673
description: "The API key for the Apollo Engine service",
7774
default: () => process.env.ENGINE_API_KEY
@@ -144,6 +141,11 @@ export abstract class ProjectCommand extends Command {
144141

145142
if (flags.localSchemaFile) {
146143
config.setDefaults({
144+
client: {
145+
service: {
146+
localSchemaFile: flags.localSchemaFile
147+
}
148+
},
147149
service: {
148150
localSchemaFile: flags.localSchemaFile
149151
}

packages/apollo/src/commands/client/codegen.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export default class Generate extends ClientCommand {
4444
"Type of code generator to use (swift | typescript | flow | scala), inferred from output",
4545
required: true
4646
}),
47+
localSchemaFile: flags.string({
48+
description: "Path to your local GraphQL schema file"
49+
}),
4750
addTypename: flags.boolean({
4851
description: "Automatically add __typename to your queries",
4952
default: true

packages/apollo/src/commands/service/push.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export default class ServicePush extends ProjectCommand {
1414
char: "t",
1515
description: "The tag to publish this service to",
1616
default: "current"
17+
}),
18+
localSchemaFile: flags.string({
19+
description: "Path to your local GraphQL schema file"
1720
})
1821
};
1922

0 commit comments

Comments
 (0)