The error is coming from ApolloServerPluginUsageReporting
This issue is fixed on apollo-server-core version v3.8.2. Github issue Reference
If you cannot upgrade your Apollo version, alternatively, you can try to create wrapper around function willResolveField
(apollo-server-core) with try/catch to suppress it.
public willResolveField(info: GraphQLResolveInfo): () => void {
if (!this.startHrTime) {
throw internalError('willResolveField called before startTiming!');
}
try { <<-- put your wrapper here
if (this.stopped) {
throw internalError('willResolveField called after stopTiming!');
}
} catch(){}
const path = info.path;
const node = this.newNode(path);
node.type = info.returnType.toString();
node.parentType = info.parentType.toString();
node.startTime = durationHrTimeToNanos(process.hrtime(this.startHrTime));
if (typeof path.key === 'string' && path.key !== info.fieldName) {
// This field was aliased; send the original field name too (for FieldStats).
node.originalFieldName = info.fieldName;
}
return () => {
node.endTime = durationHrTimeToNanos(process.hrtime(this.startHrTime));
};
}