From fdf356eb9f8b3323fd5bc941daea430e3dc55d24 Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Mon, 27 May 2024 08:15:45 +0200 Subject: [PATCH 1/2] Try caching --- src/features/messages/queries/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/messages/queries/build.ts b/src/features/messages/queries/build.ts index d6d52bf..8d8fe76 100644 --- a/src/features/messages/queries/build.ts +++ b/src/features/messages/queries/build.ts @@ -50,7 +50,7 @@ export function buildMessageQuery( const variables = { identifier: stringToPostgresBytea(idValue) }; const query = ` - query ($identifier: bytea!){ + query ($identifier: bytea!) @cached(ttl: 5) { message_view( where: {${whereClause}}, limit: ${limit} From 37794a45553cb7a71493a77441e59e693f70f65d Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Mon, 27 May 2024 08:23:54 +0200 Subject: [PATCH 2/2] More caching --- src/features/messages/queries/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/messages/queries/build.ts b/src/features/messages/queries/build.ts index 8d8fe76..0a32878 100644 --- a/src/features/messages/queries/build.ts +++ b/src/features/messages/queries/build.ts @@ -107,7 +107,7 @@ export function buildMessageSearchQuery( }`, ); - const query = `query ($search: bytea, $originChains: [bigint!], $destinationChains: [bigint!], $startTime: timestamp, $endTime: timestamp) { + const query = `query ($search: bytea, $originChains: [bigint!], $destinationChains: [bigint!], $startTime: timestamp, $endTime: timestamp) @cached(ttl: 5) { ${queries.join('\n')} }`; return { query, variables };