import type { OperationVariables, QueryHookOptions } from '@apollo/client'; import { useQuery } from '@apollo/client'; import type { DocumentNode } from 'graphql'; import type { ReactNode } from 'react'; import { AsyncRenderer } from '@vegaprotocol/ui-toolkit'; interface PageQueryContainerProps { query: DocumentNode; options?: QueryHookOptions; render: (data: TData) => ReactNode; } export const PageQueryContainer = ({ query, options, render, }: PageQueryContainerProps) => { const { data, loading, error } = useQuery(query, options); return ( loading={loading} error={error} data={data} render={render} /> ); };