From 5d3d3073bb7e04f4d3b091b65efb64dc4a054f84 Mon Sep 17 00:00:00 2001 From: nicholas-codecov Date: Mon, 6 Jan 2025 07:45:36 -0400 Subject: [PATCH] resolve issue with union type not being checked correctly --- .../CommitDetailPage/queries/CommitPageDataQueryOpts.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/CommitDetailPage/queries/CommitPageDataQueryOpts.tsx b/src/pages/CommitDetailPage/queries/CommitPageDataQueryOpts.tsx index 7f23c4b671..25df363ab2 100644 --- a/src/pages/CommitDetailPage/queries/CommitPageDataQueryOpts.tsx +++ b/src/pages/CommitDetailPage/queries/CommitPageDataQueryOpts.tsx @@ -22,9 +22,9 @@ const BundleAnalysisReportSchema = z.object({ isCached: z.boolean(), }) -const BundleAnalysisReportUnion = z.union([ +const BundleAnalysisReportUnion = z.discriminatedUnion('__typename', [ BundleAnalysisReportSchema, - MissingHeadReportSchema.shape.__typename, + z.object({ __typename: MissingHeadReportSchema.shape.__typename }), ]) const BundleAnalysisComparisonResult = z.union([