From 1aba70cd18379495b3f0bfeaecb60d5415fd2010 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 12 Aug 2024 14:54:56 -0500 Subject: [PATCH] Queries can't save undefined --- src/state/queries/postgate/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state/queries/postgate/index.ts b/src/state/queries/postgate/index.ts index 5cfff7f0ed..ee7c3aa2d8 100644 --- a/src/state/queries/postgate/index.ts +++ b/src/state/queries/postgate/index.ts @@ -129,8 +129,8 @@ export function usePostgateQuery({postUri}: {postUri: string}) { const agent = useAgent() return useQuery({ queryKey: createPostgateQueryKey(postUri), - queryFn() { - return getPostgateRecord({agent, postUri}) + async queryFn() { + return (await getPostgateRecord({agent, postUri})) ?? null }, }) }