Skip to content

Commit fba0a23

Browse files
author
klujanrosas
committed
allow custom config overrides only if flag queries is not the default value
1 parent bcaa949 commit fba0a23

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/apollo-cli/src/load-config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function loadConfigStep(
5959
};
6060
}
6161

62-
if (flags.queries && (!ctx.config.queries || ctx.config.queries.length == 0)) {
62+
if (!ctx.config.queries || ctx.config.queries.length == 0) {
6363
ctx.config.queries = [
6464
{
6565
schema: "default",
@@ -68,6 +68,13 @@ export function loadConfigStep(
6868
}
6969
];
7070
}
71+
else if (flags.queries != '**/*.graphql') {
72+
ctx.config.queries = ctx.config.queries.map((query: any) => {
73+
return Object.assign({}, query, {
74+
includes: flags.queries.split("\n")
75+
})
76+
})
77+
}
7178

7279
if (flags.key) {
7380
if (Object.keys(ctx.config.schemas).length == 1) {

0 commit comments

Comments
 (0)