Closed syonthomas closed 4 months ago
Further testing showed that this solution has a race condition and does not work for more than two buildSchema runs. I have another solution ready, but I will wait a couple of days to refresh the PR to see if this solution finally works.
@syonthomas Actually I've managed to fix this last week in a more reasonable fashion. Created a PR now, which supersede this PR 🔒
Overview
This PR addresses the issue described in #1321, where the function buildExtendedResolversMetadata alters instance properties, causing multiple calls to buildSchema to exhibit unexpected behavior.
Problem Statement
The primary problem is that buildExtendedResolversMetadata modifies the following instance properties of MetadataStorage:
This mutation leads to issues when buildSchema is called multiple times, such as missing arguments in subsequent schema builds, as noted in the original issue.
Solution
The proposed solution in this PR involves preserving the original state of MetadataStorage. On successive calls to buildSchema, the original instance of MetadataStorage is restored, ensuring that repeated schema builds do not encounter the unintended side effects of modified metadata.
Implementation Details