-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalidate GQL cache for org when a new project added to it #976
Invalidate GQL cache for org when a new project added to it #976
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. Let's wait for #972 to be merged in and then add that as an invalidation path here too.
This ensures that navigating to the org will show the new project.
This may avoid unnecessary data returning from GraphQL queries that need to refresh the list of projects.
3db96a6
to
b398515
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, I tested it and found a crash in the backend, fixed it. Wasn't caused by the changes here.
C# Unit Tests53 tests 53 ✅ 5s ⏱️ Results for commit bb835dc. |
Fixes #933.
This PR attempts to only invalidate the
projects
field of orgById to minimize the amount of information the next GQL query needs to pull, however in practice it looks like we'd have to run more granular queries to take advantage of that. URQL apparently does not reduce the info requested in a query just because the GraphQL cache is up-to-date for most of it (since that could fail if you're using persisted queries), so ourorgById
query pulls the entire org data even when it would only have needed to pull theprojects
field. So we could, in theory, do away with commit 3db96a6. In practice, it might as well stay since it does no harm and may, in the future, do some good.