Add TTL caching directive to GraphQL queries (#75)

pull/76/head
J M Rossy 6 months ago committed by GitHub
commit ae5b0999d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      src/features/messages/queries/build.ts

@ -50,7 +50,7 @@ export function buildMessageQuery(
const variables = { identifier: stringToPostgresBytea(idValue) }; const variables = { identifier: stringToPostgresBytea(idValue) };
const query = ` const query = `
query ($identifier: bytea!){ query ($identifier: bytea!) @cached(ttl: 5) {
message_view( message_view(
where: {${whereClause}}, where: {${whereClause}},
limit: ${limit} limit: ${limit}
@ -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')} ${queries.join('\n')}
}`; }`;
return { query, variables }; return { query, variables };

Loading…
Cancel
Save