Skip to content

Commit 133b348

Browse files
committed
Fix type cast that results in wrong type
1 parent 61a9a03 commit 133b348

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/plugins/other/visitor-plugin-common/src/base-resolvers-visitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ export class BaseResolversVisitor<
15331533
const meta: ReturnType<FieldDefinitionPrintFn>['meta'] = {};
15341534
const typeName = node.name as unknown as string;
15351535

1536-
const fieldsToGenerate = this._federation.findFieldNodesToGenerate({ type: parentType });
1536+
const fieldsToGenerate = this._federation.findFieldNodesToGenerate({ type: parentType }); // FIXME: for every field in a object, we are looping through every field of said object. This could be a bottleneck
15371537
const shouldGenerateField =
15381538
fieldsToGenerate.some(field => field.name.value === typeName) ||
15391539
this._federation.isResolveReferenceField(node);

packages/utils/plugins-helpers/src/federation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export class ApolloFederation {
306306
return acc;
307307
}
308308

309-
if (this.isExternal(fieldNode) && this.hasProvides(type, fieldNode.name as unknown as string)) {
309+
if (this.isExternal(fieldNode) && this.hasProvides(type, fieldNode.name.value)) {
310310
acc.push(fieldNode);
311311
return acc;
312312
}

0 commit comments

Comments
 (0)