Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit a87ceda

Browse files
authored
fix url update function to ignore null/undefined values (#340)
1 parent 051ecc4 commit a87ceda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/renderGraphiQL.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ add "&raw" to the end of the URL within a browser.
8383
8484
// Produce a Location query string from a parameter object.
8585
function locationQuery(params) {
86-
return '?' + Object.keys(params).map(function (key) {
86+
return '?' + Object.keys(params).filter(function (key) {
87+
return Boolean(params[key]);
88+
}).map(function (key) {
8789
return encodeURIComponent(key) + '=' +
8890
encodeURIComponent(params[key]);
8991
}).join('&');

0 commit comments

Comments
 (0)