From f19a9474ed264e11876c27dd3dfa22bab36652ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jerry=20J=C3=A4ppinen?= Date: Sat, 25 Nov 2017 00:09:29 +0100 Subject: [PATCH 1/3] Allowing null values --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index ea4854b..7ad48c4 100644 --- a/src/index.js +++ b/src/index.js @@ -226,7 +226,7 @@ function encodeParamsMap(params) { const val = params[key]; return params.hasOwnProperty(key) && val !== undefined && - val !== null && + // val !== null && !Number.isNaN(val); }); @@ -247,6 +247,9 @@ function encodeParam(key, val) { // Enum('a') => 'a' // function encodeParamValue(value) { + if (value === null) { + return null; + } if (Array.isArray(value)) { return encodeParamsArray(value); } From 115a7e7ccf3c6167f86b5c24eb4ae9a993dc6ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jerry=20J=C3=A4ppinen?= Date: Tue, 19 Dec 2017 22:15:27 +0100 Subject: [PATCH 2/3] Package details --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0f6d049..48864f4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "graphqlify", + "name": "graphqlify-null", "version": "1.1.0", - "description": "Build GraphQL queries with JavaScript", + "description": "Build GraphQL queries with JavaScript (fork of graphqlify)", "main": "lib/index.js", "scripts": { "prepublish": "nofat make", @@ -9,17 +9,17 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/kadirahq/graphqlify.git" + "url": "git+https://github.com/Eiskis/graphqlify.git" }, "keywords": [ "graphql" ], - "author": "Kadira Inc.", + "author": "Eiskis", "license": "MIT", "bugs": { - "url": "https://github.com/kadirahq/graphqlify/issues" + "url": "https://github.com/Eiskis/graphqlify/issues" }, - "homepage": "https://github.com/kadirahq/graphqlify#readme", + "homepage": "https://github.com/Eiskis/graphqlify#readme", "devDependencies": { "nofat": "^2.0.0" } From 4a966881d6701f7d4f17a6c78dda1458f09e7d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jerry=20J=C3=A4ppinen?= Date: Tue, 19 Dec 2017 22:30:33 +0100 Subject: [PATCH 3/3] Readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e969fa2..57aaf57 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# graphqlify-null + +Fork of `graphqlify` that allows sending null values. Because who knows if [#8](https://github.com/kadirahq/graphqlify/pull/8) will ever be merged. + # graphqlify This module helps you build GraphQL queries using plain JavaScript objects. This can be useful when you need to programmatically build GraphQL queries. Install the module from npm to get started.