Generate GraphQL schema during startup #5164
Merged
+44
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to fix a timing issue when regenerating the GraphQL schema after the branch schema has been updated. I don't completely know the exact conditions that triggers the issue.
It could be that two requests are coming in at the same time before the GraphQL schema has been generated for an updating branch and they step on each others toes, or we start to generate the schema before the SchemaBranch has been properly processed so that the registry for this branch appears to be empty.
After making these changes where we generate the GraphQL schema upon startup and also generate the new schema within the task of refreshing all the branches I haven't been able to reproduce the error any more. On the
stable
branch it was quite easy to do it before with the procedure described below.Unfortunately in order to be able to regenerate the GraphQL schema within the registry refresh function I had to introduce a circular import. I'd like to remove that part and change the way the tasks for the scheduler are managed. However, I don't want to do that within a hotfix release. Instead I want to revert back to that within the
develop
branch.