From a36fef809e6f86e9027edc83863f4f24a39e7931 Mon Sep 17 00:00:00 2001 From: gaberudy Date: Fri, 8 Feb 2019 20:46:39 -0700 Subject: [PATCH] Fix broken codegen with fields with same type Pop the crossReferenceKeyList after recursing down so that codegen succeeds when two siblings have the same complex type. --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index adfe293..f5c6ca1 100644 --- a/index.js +++ b/index.js @@ -60,6 +60,8 @@ const generateQuery = ( ).queryStr) .filter(cur => cur) .join('\n'); + // Allow the same references in siblings + crossReferenceKeyList.pop(); } if (!(curType.getFields && !childQuery)) {