We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54aaca4 commit 757c81dCopy full SHA for 757c81d
packages/gatsby-source-drupal/src/gatsby-node.js
@@ -249,7 +249,17 @@ exports.sourceNodes = async (
249
// See https://www.drupal.org/docs/8/modules/jsonapi/filtering
250
if (typeof filters === `object`) {
251
if (filters.hasOwnProperty(type)) {
252
- url = url + `?${filters[type]}`
+ url = new URL(url)
253
+ const filterParams = new URLSearchParams(filters[type])
254
+ const filterKeys = Array.from(filterParams.keys())
255
+ filterKeys.forEach(filterKey => {
256
+ // Only add filter params to url if it has not already been
257
+ // added.
258
+ if (!url.searchParams.has(filterKey)) {
259
+ url.searchParams.set(filterKey, filterParams.get(filterKey))
260
+ }
261
+ })
262
+ url = url.toString()
263
}
264
265
0 commit comments