-
Notifications
You must be signed in to change notification settings - Fork 3k
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
refactor(ui): Adding apollo caching to manage domains page. #6494
refactor(ui): Adding apollo caching to manage domains page. #6494
Conversation
@@ -64,12 +64,12 @@ export const DomainsList = () => { | |||
query, | |||
}, | |||
}, | |||
fetchPolicy: 'no-cache', | |||
fetchPolicy: 'cache-first', |
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.
interesting, nice. I know there's been bugs with using apollo cache before, but idk if that's how we were using it or if it's just difficult to work with. If it's working well for domains then we can at the very least extend this to other similar situations! (ie. the glossary)
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.
Seems to be working!
7ddd512
to
eac6684
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.
very cool!
Summary
In this PR, we do our first POC of list view caching on the Domains page. No longer will we have the 3 second delay to see newly created domains. Also when navigating between pages, the Domains will be cached so another fetch is not required.
As part of this, I also added a new indexed field to Domains index that tracks the "created time" of a Domain. This allows us to consistently and correctly sort the list of domains, even when a new one is added locally.
Demo
Screen.Recording.2022-11-18.at.12.25.12.PM.mov
Checklist