Skip to content

Commit ed3af14

Browse files
author
Bryan Cross
committed
Removing unnecessary process.argv call
1 parent 305e49a commit ed3af14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphql/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ if (!process.argv.slice(2).length)
2727
function runQuery(file, token) {
2828

2929
try {
30-
var queryText = fs.readFileSync(process.argv[2], "utf8");
30+
var queryText = fs.readFileSync(file, "utf8");
3131
}
3232
catch (e) {
3333
console.log("Problem opening query file: " + e.message);
3434
process.exit(1);
3535
}
3636

37-
//If there is a variables section, extract the values and add them to the query JSON object.
37+
//If there is a variables section, extract the values and add them to the query JSON object.
3838
queryObj.variables = variablesRegex.test(queryText) ? JSON.parse(queryText.match(variablesRegex)[0].split("variables ")[1]) : {}
3939
//Remove the variables section from the query text, whether it exists or not
4040
queryObj.query = queryText.replace(variablesRegex, '');

0 commit comments

Comments
 (0)