From 786d89c48e7ca2b6c57b413cd39a2b107662905b Mon Sep 17 00:00:00 2001 From: Adel Date: Sat, 23 May 2020 00:50:30 +0300 Subject: [PATCH] Fix array spread order dependence bug Fix array spread order dependence bug in TS based queries --- packages/query/src/preprocessor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/query/src/preprocessor.ts b/packages/query/src/preprocessor.ts index 62ab38e61..be00294e3 100644 --- a/packages/query/src/preprocessor.ts +++ b/packages/query/src/preprocessor.ts @@ -313,8 +313,9 @@ export const processQueryString = ( if (assertDictArray(dictArray)) { replacement = dictArray .map((d) => { - const tupleStr = Object.values(d) - .map((value) => { + const tupleStr = keys + .map((key) => { + const value = d[key]; bindings.push(value); return `$${++index}`; }) @@ -348,7 +349,6 @@ export const processQueryString = ( if (assertScalarArray(scalars)) { replacement = scalars .map((value) => { - // TODO: bindings push bindings.push(value); return `$${++index}`; })