Skip to content

Commit

Permalink
chore: Annotate DataCubePreview query
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Oct 3, 2024
1 parent 7efbc43 commit b70e2a5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/browser/dataset-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Flex from "@/components/flex";
import { HintRed, Loading, LoadingDataError } from "@/components/hint";
import { DataSource } from "@/config-types";
import { sourceToLabel } from "@/domain/datasource";
import { getQueryRequestContext } from "@/graphql/hooks";
import {
useDataCubeMetadataQuery,
useDataCubePreviewQuery,
Expand Down Expand Up @@ -86,6 +87,11 @@ export interface Preview {
label: string;
}

const DATA_CUBE_PREVIEW_QUERY_REQUEST_CONTEXT = getQueryRequestContext({
querySource: "DataSetPreview / dataset-preview.tsx",
queryReason: "Needed to display a dataset preview in the /browse page.",
});

export const DataSetPreview = ({
dataSetIri,
dataSource,
Expand All @@ -110,7 +116,10 @@ export const DataSetPreview = ({
useDataCubeMetadataQuery({ variables });
const [
{ data: previewData, fetching: fetchingPreview, error: previewError },
] = useDataCubePreviewQuery({ variables });
] = useDataCubePreviewQuery({
variables,
context: DATA_CUBE_PREVIEW_QUERY_REQUEST_CONTEXT,
});
const classes = useStyles({
descriptionPresent: !!metadata?.dataCubeMetadata.description,
});
Expand Down

0 comments on commit b70e2a5

Please sign in to comment.