From e411c1b6f648ca5506ceb22fe018a6b0b0c4d0d9 Mon Sep 17 00:00:00 2001 From: Graham McNeill Date: Tue, 10 Dec 2024 10:21:02 +0000 Subject: [PATCH] [Platform]: fix gql playground for studies widget on disease page (#614) --- packages/sections/src/disease/GWASStudies/Body.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/sections/src/disease/GWASStudies/Body.tsx b/packages/sections/src/disease/GWASStudies/Body.tsx index 613e2a55e..e8cc92a8f 100644 --- a/packages/sections/src/disease/GWASStudies/Body.tsx +++ b/packages/sections/src/disease/GWASStudies/Body.tsx @@ -13,7 +13,7 @@ import { getStudyCategory } from "../../utils/getStudyCategory"; import GWAS_STUDIES_BODY_QUERY from "./GWASStudiesQuery.gql"; import { definition } from "."; import { epmcUrl } from "ui/src/utils/urls"; -import { useEffect, useState } from "react"; +import { ReactElement, useEffect, useState } from "react"; import { responseType } from "ui/src/types/response"; const columns = [ @@ -116,20 +116,18 @@ type BodyProps = { label: string; }; -function Body({ id: efoId, label: diseaseName }: BodyProps) { +function Body({ id: efoId, label: diseaseName }: BodyProps): ReactElement { const variables = { diseaseIds: [efoId], + size: table5HChunkSize, + index: 0, }; const [request, setRequest] = useState(initialResponse); const getData = useBatchQuery({ query: GWAS_STUDIES_BODY_QUERY, - variables: { - diseaseIds: variables.diseaseIds, - size: table5HChunkSize, - index: 0, - }, + variables, dataPath: "data.studies", size: table5HChunkSize, });