Skip to content

Commit 4945265

Browse files
Merge branch 'jakubnavratil-feature/recursive-include2'
2 parents 6488c32 + 0965c58 commit 4945265

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

packages/graphql/lib/services/base-explorer.service.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,21 @@ export class BaseExplorerService {
1111
if (!include || isEmpty(include)) {
1212
return [...modulesContainer.values()];
1313
}
14-
const whitelisted = this.includeWhitelisted(modulesContainer, include);
15-
return whitelisted;
14+
const explicitlyWhitelisted = this.includeWhitelisted(
15+
modulesContainer,
16+
include,
17+
);
18+
const modulesToInclude = [];
19+
const toCheck = [...explicitlyWhitelisted];
20+
while (toCheck.length) {
21+
const moduleRef = toCheck.pop();
22+
if (!modulesToInclude.includes(moduleRef)) {
23+
modulesToInclude.push(moduleRef);
24+
toCheck.push(...moduleRef.imports);
25+
}
26+
}
27+
28+
return modulesToInclude;
1629
}
1730

1831
includeWhitelisted(

0 commit comments

Comments
 (0)