Fix microAmount (#2654)

* Fix microAmount

* Code review returns

* Parse currency values as string

* Jeremy's returns

* fix: scalars not properly implemented

* fix: filters not working on big float scalar

---------

Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
martmull
2023-11-23 15:26:59 +01:00
committed by GitHub
parent 0194f30dd8
commit 59e53ba72d
16 changed files with 139 additions and 29 deletions
@@ -24,6 +24,12 @@ import { WorkspaceSchemaStorageService } from 'src/workspace/workspace-schema-st
type: MemoryStorageType.Local,
options: {},
}),
MemoryStorageModule.forRoot({
identifier: 'usedScalarNames',
type: MemoryStorageType.Local,
options: {},
serializer: new MemoryStorageJsonSerializer<string[]>(),
}),
MemoryStorageModule.forRoot({
identifier: 'cacheVersion',
type: MemoryStorageType.Local,
@@ -14,6 +14,10 @@ export class WorkspaceSchemaStorageService {
>,
@InjectMemoryStorage('typeDefs')
private readonly typeDefsMemoryStorageService: MemoryStorageService<string>,
@InjectMemoryStorage('usedScalarNames')
private readonly usedScalarNamesMemoryStorageService: MemoryStorageService<
string[]
>,
@InjectMemoryStorage('cacheVersion')
private readonly cacheVersionMemoryStorageService: MemoryStorageService<string>,
private readonly workspaceCacheVersionService: WorkspaceCacheVersionService,
@@ -71,8 +75,25 @@ export class WorkspaceSchemaStorageService {
});
}
setUsedScalarNames(
workspaceId: string,
scalarsUsed: string[],
): Promise<void> {
return this.usedScalarNamesMemoryStorageService.write({
key: workspaceId,
data: scalarsUsed,
});
}
getUsedScalarNames(workspaceId: string): Promise<string[] | null> {
return this.usedScalarNamesMemoryStorageService.read({
key: workspaceId,
});
}
async invalidateCache(workspaceId: string): Promise<void> {
await this.objectMetadataMemoryStorageService.delete({ key: workspaceId });
await this.typeDefsMemoryStorageService.delete({ key: workspaceId });
await this.usedScalarNamesMemoryStorageService.delete({ key: workspaceId });
}
}