Skip to content

Commit 15d1d97

Browse files
committed
Fix tests using loadConfigStep to parse flags
loadConfigStep pulls the queries value from the flags passed to the command, so there is no need to use a custom parsing function. Though the name of the function requires an in-depth look at the implementation.
1 parent 5bff6e8 commit 15d1d97

2 files changed

Lines changed: 2 additions & 24 deletions

File tree

packages/apollo/src/commands/queries/check.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import { table, styledJSON } from "heroku-cli-util";
44
import * as Listr from "listr";
55
import { toPromise, execute } from "apollo-link";
66
import { print, GraphQLError, DocumentNode } from "graphql";
7-
import * as fg from "glob";
87

98
import {
109
loadQueryDocuments,
1110
extractOperationsAndFragments,
1211
combineOperationsAndFragments
1312
} from "apollo-codegen-core/lib/loading";
14-
import { withGlobalFS } from "apollo-codegen-core/lib/localfs";
1513

1614
import { engineFlags } from "../../engine-cli";
1715
import { engineLink, getIdFromKey } from "../../engine";
@@ -65,16 +63,7 @@ export default class CheckQueries extends Command {
6563
title: "Scanning for GraphQL queries",
6664
task: async (ctx, task) => {
6765
ctx.queryDocuments = loadQueryDocuments(
68-
typeof flags.queries === "string"
69-
? [
70-
withGlobalFS(() =>
71-
fg.sync(flags.queries!, {
72-
cwd: ctx.config.projectFolder,
73-
absolute: true
74-
})
75-
)
76-
]
77-
: ctx.documentSets[0].documentPaths,
66+
ctx.documentSets[0].documentPaths,
7867
flags.tagName
7968
);
8069
task.title = `Scanning for GraphQL queries (${

packages/apollo/src/commands/queries/extract.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ import {
1111
printWithReducedWhitespace,
1212
sortAST
1313
} from "apollo-engine-reporting";
14-
import * as fg from "glob";
1514

16-
import { withGlobalFS } from "apollo-codegen-core/lib/localfs";
1715
import {
1816
loadQueryDocuments,
1917
extractOperationsAndFragments,
@@ -72,16 +70,7 @@ export default class ExtractQueries extends Command {
7270
title: "Scanning for GraphQL queries",
7371
task: async (ctx, task) => {
7472
ctx.queryDocuments = loadQueryDocuments(
75-
typeof flags.queries === "string"
76-
? [
77-
withGlobalFS(() =>
78-
fg.sync(flags.queries!, {
79-
cwd: ctx.config.projectFolder,
80-
absolute: true
81-
})
82-
)
83-
]
84-
: ctx.documentSets[0].documentPaths,
73+
ctx.documentSets[0].documentPaths,
8574
flags.tagName
8675
);
8776
task.title = `Scanning for GraphQL queries (${

0 commit comments

Comments
 (0)