Skip to content

Commit

Permalink
replace verbose with debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed May 29, 2019
1 parent 7a05ea9 commit fd45b9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/gest.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ try {
const rep = chalk.dim(paths.concat('').join('/')).concat(fileName)
const spinner = ora({ text: rep, color: 'magenta' }).start()
return readFile(v)
.then(gest(schema, Object.assign(options, { verbose: false })))
.then(gest(schema, Object.assign(options, { debug: false })))
.then(value => {
if (value.errors && value.data) spinner.warn()
else if (value.errors) spinner.fail(`${rep}\n - ${value.errors}`)
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const DEFAULT = {
timeout: 10000,
headers: {},
globals: ENV === 'test' && (global.test !== undefined || global.it !== undefined),
verbose: ENV === 'dev' || ENV === 'development'
debug: ENV === 'debug'
}

function Gest(schema, config) {
const { baseURL, headers, timeout, globals, verbose } = Object.assign({}, DEFAULT, config) // default config
const { baseURL, headers, timeout, globals, debug } = Object.assign({}, DEFAULT, config) // default config

const instance = axios.create({
timeout,
Expand All @@ -25,7 +25,7 @@ function Gest(schema, config) {
const gest = query => {
if (baseURL) {
const corrected = correctURL(baseURL)
if (verbose) console.log(`${query} -> ${corrected}`)
if (debug) console.log(`${query} -> ${corrected}`)

return instance
.post(corrected, encode(query))
Expand All @@ -38,7 +38,7 @@ function Gest(schema, config) {
})
}

if (verbose) console.log(query)
if (debug) console.log(query)
return graphql(schema, query, null, { headers })
}

Expand Down

0 comments on commit fd45b9a

Please sign in to comment.