diff --git a/.gitignore b/.gitignore index 2ff1e06..e9d88de 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist/ npm-debug.log* .DS_Store .nyc_output +package-lock.json diff --git a/index.js b/index.js index df2afef..d03fd36 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ function nanographql (str) { var name = getOpname.exec(str) return function (variables) { var data = { query: str } - if (variables) data.variables = JSON.stringify(variables) + if (variables) data.variables = variables if (name && name.length) { var operationName = name[2] if (operationName) data.operationName = name[2] diff --git a/test.js b/test.js index 4117c19..b34fb34 100644 --- a/test.js +++ b/test.js @@ -20,7 +20,7 @@ tape('should create a query', function (assert) { var data = query(variables) spok(assert, JSON.parse(data), { query: spok.string, - variables: JSON.stringify(variables) + variables }) assert.end() }) @@ -44,7 +44,7 @@ tape('should have a name', function (assert) { spok(assert, JSON.parse(data), { query: spok.string, operationName: 'foo', - variables: JSON.stringify(variables) + variables }) assert.end() })