Add a cache on /metadata (#5189)
In this PR I'm introducing a simple custom graphql-yoga plugin to create a caching mechanism specific to our metadata. The cache key is made of : workspace id + workspace cache version, with this the cache is automatically invalidated each time a change is made on the workspace metadata.
This commit is contained in:
@ -8,6 +8,7 @@ import { useThrottler } from 'src/engine/api/graphql/graphql-config/hooks/use-th
|
||||
import { MetadataGraphQLApiModule } from 'src/engine/api/graphql/metadata-graphql-api.module';
|
||||
import { renderApolloPlayground } from 'src/engine/utils/render-apollo-playground.util';
|
||||
import { DataloaderService } from 'src/engine/dataloaders/dataloader.service';
|
||||
import { useCachedMetadata } from 'src/engine/api/graphql/graphql-config/hooks/use-cached-metadata';
|
||||
|
||||
export const metadataModuleFactory = async (
|
||||
environmentService: EnvironmentService,
|
||||
@ -32,6 +33,7 @@ export const metadataModuleFactory = async (
|
||||
useExceptionHandler({
|
||||
exceptionHandlerService,
|
||||
}),
|
||||
useCachedMetadata(),
|
||||
],
|
||||
path: '/metadata',
|
||||
context: () => ({
|
||||
|
||||
Reference in New Issue
Block a user