From 1730794ca3c6aa1a112d6eca42475022adbef30b Mon Sep 17 00:00:00 2001 From: Nabarun Date: Fri, 17 May 2024 16:52:16 +0530 Subject: [PATCH] Move private method in util graph database --- packages/util/src/graph/database.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/util/src/graph/database.ts b/packages/util/src/graph/database.ts index b7b336f6..94645d52 100644 --- a/packages/util/src/graph/database.ts +++ b/packages/util/src/graph/database.ts @@ -347,18 +347,6 @@ export class GraphDatabase { return entityData; } - _defragmentGQLQuerySelections (selections: ReadonlyArray, queryInfo: GraphQLResolveInfo): SelectionNode[] { - return selections.reduce((acc: SelectionNode[], selection) => { - if (selection.kind === 'FragmentSpread') { - const fragmentSelections = queryInfo.fragments[selection.name.value].selectionSet.selections; - - return [...acc, ...fragmentSelections]; - } - - return [...acc, selection]; - }, []); - } - async getEntities ( queryRunner: QueryRunner, entityType: new () => Entity, @@ -1346,4 +1334,16 @@ export class GraphDatabase { log(`Total entities in cachedEntities.latestPrunedEntities map: ${totalEntities}`); cachePrunedEntitiesCount.set(totalEntities); } + + _defragmentGQLQuerySelections (selections: ReadonlyArray, queryInfo: GraphQLResolveInfo): SelectionNode[] { + return selections.reduce((acc: SelectionNode[], selection) => { + if (selection.kind === 'FragmentSpread') { + const fragmentSelections = queryInfo.fragments[selection.name.value].selectionSet.selections; + + return [...acc, ...fragmentSelections]; + } + + return [...acc, selection]; + }, []); + } }