From 452fcb36590632d3100e49d22793059947591986 Mon Sep 17 00:00:00 2001 From: k00b Date: Tue, 22 Jul 2025 18:44:42 -0500 Subject: [PATCH] use cache when checking territory existence so that we don't query the server on every character input --- lib/validate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/validate.js b/lib/validate.js index 71e08300..576687e6 100644 --- a/lib/validate.js +++ b/lib/validate.js @@ -74,7 +74,7 @@ async function subExists (name, { client, models, me, filter }) { let sub // apollo client if (client) { - const { data } = await client.query({ query: SUB, variables: { sub: name }, fetchPolicy: 'no-cache' }) + const { data } = await client.query({ query: SUB, variables: { sub: name } }) sub = data?.sub } else { sub = await models.sub.findUnique({ where: { name } }) @@ -104,6 +104,7 @@ async function subHasPostType (name, type, { client, models }) { if (!client && !models) { throw new Error('cannot check for territory') } + // apollo client if (client) { const { data } = await client.query({ query: SUB, variables: { name } })