Skip to content

Commit 0ccd842

Browse files
Merge pull request #2367 from andreialecu/chore-lodash
refactor: remove lodash usage
2 parents 316121f + f3f3e49 commit 0ccd842

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/mercurius/lib/utils/build-mercurius-federated-schema.util.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { loadPackage } from '@nestjs/common/utils/load-package.util';
22
import { transformSchema } from '@nestjs/graphql';
33
import { BuildFederatedSchemaOptions } from '@nestjs/graphql';
44
import { GraphQLSchema, isObjectType, buildASTSchema } from 'graphql';
5-
import { forEach } from 'lodash';
65

76
export function buildMercuriusFederatedSchema({
87
typeDefs,
@@ -22,7 +21,7 @@ export function buildMercuriusFederatedSchema({
2221
executableSchema = transformSchema(executableSchema, (type) => {
2322
if (isObjectType(type)) {
2423
const isSubscription = type.name === 'Subscription';
25-
forEach(type.getFields(), (value, key) => {
24+
for (const [key, value] of Object.entries(type.getFields())) {
2625
if (isSubscription && subscriptionResolvers) {
2726
const resolver = subscriptionResolvers[key];
2827
if (resolver && !value.subscribe) {
@@ -43,7 +42,7 @@ export function buildMercuriusFederatedSchema({
4342
};
4443
};
4544
}
46-
});
45+
}
4746
}
4847
return type;
4948
});

0 commit comments

Comments
 (0)