From 00bba07b11c4de3cdd4ab7429373271f8a101d9e Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 11 Apr 2022 16:22:09 +0200 Subject: [PATCH] define hack to pass already queried data to balance resolver --- backend/src/server/context.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/src/server/context.ts b/backend/src/server/context.ts index ffe90aca2..f764c2876 100644 --- a/backend/src/server/context.ts +++ b/backend/src/server/context.ts @@ -2,12 +2,19 @@ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { Role } from '@/auth/Role' import { User as dbUser } from '@entity/User' +import { Transaction as dbTransaction } from '@entity/Transaction' +import Decimal from 'decimal.js-light' export interface Context { token: string | null setHeaders: { key: string; value: string }[] role?: Role user?: dbUser + // hack to use less DB calls for Balance Resolver + lastTransaction?: dbTransaction + transactionCount?: number + linkCount?: number + sumHoldAvailableAmount?: Decimal } const context = (args: any): Context => {