[FE] Update remote table schema + refactor Tables list (#5548)
Closes #5062. Refactoring tables list to avoid rendering all toggles on each sync or schema update while using fresh data: - introducing id for RemoteTables in apollo cache - manually updating the cache for the record that was updated after a sync or schema update instead of fetching all tables again
This commit is contained in:
@ -30,7 +30,13 @@ export const useApolloFactory = (options: Partial<Options<any>> = {}) => {
|
||||
const apolloClient = useMemo(() => {
|
||||
apolloRef.current = new ApolloFactory({
|
||||
uri: `${REACT_APP_SERVER_BASE_URL}/graphql`,
|
||||
cache: new InMemoryCache(),
|
||||
cache: new InMemoryCache({
|
||||
typePolicies: {
|
||||
RemoteTable: {
|
||||
keyFields: ['name'],
|
||||
},
|
||||
},
|
||||
}),
|
||||
headers: {
|
||||
...(currentWorkspace?.currentCacheVersion && {
|
||||
'X-Schema-Version': currentWorkspace.currentCacheVersion,
|
||||
|
||||
Reference in New Issue
Block a user