Skip to content

Commit

Permalink
Move private method in util graph database
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed May 17, 2024
1 parent 3a79590 commit 1730794
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/util/src/graph/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,18 +347,6 @@ export class GraphDatabase {
return entityData;
}

_defragmentGQLQuerySelections (selections: ReadonlyArray<SelectionNode>, 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<Entity extends ObjectLiteral> (
queryRunner: QueryRunner,
entityType: new () => Entity,
Expand Down Expand Up @@ -1346,4 +1334,16 @@ export class GraphDatabase {
log(`Total entities in cachedEntities.latestPrunedEntities map: ${totalEntities}`);
cachePrunedEntitiesCount.set(totalEntities);
}

_defragmentGQLQuerySelections (selections: ReadonlyArray<SelectionNode>, 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];
}, []);
}
}

0 comments on commit 1730794

Please sign in to comment.