useTransactionWebVitalsQuery.tsx 916 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import type {Sort} from 'sentry/utils/discover/fields';
  2. import {useTransactionWebVitalsScoresQuery} from 'sentry/views/insights/browser/webVitals/queries/storedScoreQueries/useTransactionWebVitalsScoresQuery';
  3. import type {WebVitals} from 'sentry/views/insights/browser/webVitals/types';
  4. type Props = {
  5. defaultSort?: Sort;
  6. enabled?: boolean;
  7. limit?: number;
  8. query?: string;
  9. shouldEscapeFilters?: boolean;
  10. sortName?: string;
  11. transaction?: string | null;
  12. webVital?: WebVitals | 'total';
  13. };
  14. export const useTransactionWebVitalsQuery = ({
  15. limit,
  16. transaction,
  17. defaultSort,
  18. sortName = 'sort',
  19. webVital,
  20. enabled,
  21. query,
  22. shouldEscapeFilters = true,
  23. }: Props) => {
  24. const storedScoresResult = useTransactionWebVitalsScoresQuery({
  25. limit,
  26. transaction,
  27. defaultSort,
  28. sortName,
  29. enabled,
  30. webVital,
  31. query,
  32. shouldEscapeFilters,
  33. });
  34. return storedScoresResult;
  35. };