Skip to content

Commit

Permalink
Allow custom config overrides only if flag queries is not the default…
Browse files Browse the repository at this point in the history
… value (#511)
  • Loading branch information
Kenneth Luján Rosas authored and shadaj committed Jul 30, 2018
1 parent 8a74bea commit a55312f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/apollo-cli/src/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function loadConfigStep(
};
}

if (flags.queries) {
if (!ctx.config.queries || ctx.config.queries.length == 0 && flags.queries) {
ctx.config.queries = [
{
schema: "default",
Expand All @@ -68,6 +68,13 @@ export function loadConfigStep(
}
];
}
else if (flags.queries && flags.queries != '**/*.graphql') {
ctx.config.queries = ctx.config.queries.map((query: any) => {
return Object.assign({}, query, {
includes: flags.queries.split("\n")
})
})
}

if (flags.key) {
if (Object.keys(ctx.config.schemas).length == 1) {
Expand Down

0 comments on commit a55312f

Please sign in to comment.