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
  • Loading branch information
klujanrosas committed Jul 25, 2018
1 parent bcaa949 commit 30a9b8a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/apollo-cli/src/load-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,22 @@ export function loadConfigStep(
};
}

if (flags.queries && (!ctx.config.queries || ctx.config.queries.length == 0)) {
if (!ctx.config.queries || ctx.config.queries.length == 0) {
ctx.config.queries = [
{
schema: "default",
includes: flags.queries.split("\n"),
excludes: []
}
{
schema: "default",
includes: flags.queries.split("\n"),
excludes: []
}
];
}
else if (flags.queries != '**/*.graphql') {
ctx.config.queries = ctx.config.queries.map(query => {
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 30a9b8a

Please sign in to comment.