Skip to content

Commit

Permalink
Merge pull request #11 from taion/update
Browse files Browse the repository at this point in the history
Update dependencies and test null literals
  • Loading branch information
taion authored Nov 12, 2016
2 parents 449e2b7 + 38f7235 commit e73a98a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@
},
"homepage": "https://github.com/taion/graphql-type-json#readme",
"peerDependencies": {
"graphql": "^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0"
"graphql": ">=0.4.0"
},
"devDependencies": {
"babel-cli": "^6.14.0",
"babel-cli": "^6.18.0",
"babel-eslint": "^7.1.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-es2015": "^6.14.0",
"babel-register": "^6.14.0",
"babel-preset-es2015": "^6.18.0",
"babel-register": "^6.18.0",
"chai": "^3.5.0",
"eslint": "^3.4.0",
"eslint-config-airbnb-base": "^5.0.3",
"eslint-plugin-import": "^1.14.0",
"graphql": "^0.8.0",
"mocha": "^3.0.2",
"eslint": "^3.10.0",
"eslint-config-4catalyzer": "^0.1.3",
"eslint-plugin-import": "^1.16.0",
"graphql": "^0.8.1",
"mocha": "^3.1.2",
"rimraf": "^2.5.4"
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function parseLiteral(ast) {
return parseFloat(ast.value);
case Kind.OBJECT: {
const value = Object.create(null);
ast.fields.forEach(field => {
ast.fields.forEach((field) => {
value[field.name.value] = parseLiteral(field.value);
});

Expand Down
11 changes: 8 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('GraphQLJSON', () => {
});

describe('parseValue', () => {
it('should support parsing values', done => {
it('should support parsing values', (done) => {
graphql(
schema,
'query ($arg: JSON) { value(arg: $arg) }',
Expand All @@ -72,8 +72,7 @@ describe('GraphQLJSON', () => {
});

describe('parseLiteral', () => {
it('should support parsing literals', done => {
// Null values are not supported in GraphQL literals.
it('should support parsing literals', (done) => {
graphql(schema, `
{
value(arg: {
Expand All @@ -82,19 +81,22 @@ describe('GraphQLJSON', () => {
float: 3.14,
true: true,
false: false,
null: null,
object: {
string: "string",
int: 3,
float: 3.14,
true: true,
false: false,
null: null,
},
array: [
"string",
3,
3.14,
true,
false,
null,
],
}),
}
Expand All @@ -105,19 +107,22 @@ describe('GraphQLJSON', () => {
float: 3.14,
true: true,
false: false,
null: null,
object: {
string: 'string',
int: 3,
float: 3.14,
true: true,
false: false,
null: null,
},
array: [
'string',
3,
3.14,
true,
false,
null,
],
});
done();
Expand Down

0 comments on commit e73a98a

Please sign in to comment.