@coderich/graphql-shape
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"author": "coderich", | ||
@@ -12,0 +12,0 @@ "main": "src/GraphQLShape.js", |
@@ -21,3 +21,5 @@ const Util = require('@coderich/util'); | ||
const deleteNodes = new WeakMap(); | ||
let target = transforms, isFragment = false, counter = 0, field; | ||
let target = transforms, isFragment = false, field; | ||
transforms.$counter = 0; | ||
fragments.$counter = 0; | ||
@@ -37,4 +39,5 @@ // Parse out directives while building transforms | ||
case Kind.FRAGMENT_SPREAD: { | ||
const $paths = [...paths]; | ||
const start = transforms.length; | ||
const $paths = [...isFragment ? fpaths : paths]; | ||
const start = target.length; | ||
const $target = target; | ||
@@ -47,4 +50,4 @@ thunks.push(() => { | ||
}); | ||
transforms.splice(start + counter, 0, ...additions); | ||
counter += additions.length; | ||
$target.splice(start + $target.$counter, 0, ...additions); | ||
$target.$counter += additions.length; | ||
}); | ||
@@ -110,2 +113,6 @@ break; | ||
// Cleanup | ||
delete transforms.$counter; | ||
delete fragments.$counter; | ||
return { | ||
@@ -112,0 +119,0 @@ query, |
16182
282