Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
willSendResponse(requestContext: GraphQLRequestContext) {
// remember to dispose the scoped container to prevent memory leaks
Container.reset(requestContext.context.requestId);
// for developers curiosity purpose, here is the logging of current scoped container instances
// we can make multiple parallel requests to see in console how this works
const instancesIds = ((Container as any).instances as ContainerInstance[]).map(
instance => instance.id,
);
console.log("instances left in memory:", instancesIds);
},
}),