(props: { initialSearch?: string })
| 1600 | } |
| 1601 | |
| 1602 | const QueryDetails = (props: { initialSearch?: string }) => { |
| 1603 | const { selectedQueryHash, setSelectedQueryHash } = useDevtoolsState() |
| 1604 | |
| 1605 | const theme = useTheme() |
| 1606 | const themed = createThemed(theme) |
| 1607 | |
| 1608 | const queryClient = useQueryDevtoolsContext().client |
| 1609 | |
| 1610 | const [restoringLoading, setRestoringLoading] = createSignal(false) |
| 1611 | const [dataMode, setDataMode] = createSignal<'view' | 'edit'>('view') |
| 1612 | const [dataEditError, setDataEditError] = createSignal<boolean>(false) |
| 1613 | |
| 1614 | const errorTypes = createMemo(() => { |
| 1615 | return useQueryDevtoolsContext().errorTypes || [] |
| 1616 | }) |
| 1617 | |
| 1618 | const activeQuery = createSubscribeToQueryCacheBatcher( |
| 1619 | (queryCache) => queryCache().get(selectedQueryHash() ?? ''), |
| 1620 | false, |
| 1621 | ) |
| 1622 | |
| 1623 | const activeQueryFresh = createSubscribeToQueryCacheBatcher((queryCache) => { |
| 1624 | return queryCache().get(selectedQueryHash() ?? '') |
| 1625 | }, false) |
| 1626 | |
| 1627 | const activeQueryState = createSubscribeToQueryCacheBatcher( |
| 1628 | (queryCache) => queryCache().get(selectedQueryHash() ?? '')?.state, |
| 1629 | false, |
| 1630 | ) |
| 1631 | |
| 1632 | const activeQueryStateData = createSubscribeToQueryCacheBatcher( |
| 1633 | (queryCache) => { |
| 1634 | return queryCache().get(selectedQueryHash() ?? '')?.state.data |
| 1635 | }, |
| 1636 | false, |
| 1637 | ) |
| 1638 | |
| 1639 | const statusLabel = createSubscribeToQueryCacheBatcher((queryCache) => { |
| 1640 | const query = queryCache().get(selectedQueryHash() ?? '') |
| 1641 | if (!query) return 'inactive' |
| 1642 | return getQueryStatusLabel(query) |
| 1643 | }) |
| 1644 | |
| 1645 | const queryStatus = createSubscribeToQueryCacheBatcher((queryCache) => { |
| 1646 | const query = queryCache().get(selectedQueryHash() ?? '') |
| 1647 | if (!query) return 'pending' |
| 1648 | return query.state.status |
| 1649 | }) |
| 1650 | |
| 1651 | const observerCount = createSubscribeToQueryCacheBatcher( |
| 1652 | (queryCache) => |
| 1653 | queryCache() |
| 1654 | .get(selectedQueryHash() ?? '') |
| 1655 | ?.getObserversCount() ?? 0, |
| 1656 | ) |
| 1657 | |
| 1658 | const color = createMemo(() => getQueryStatusColorByLabel(statusLabel())) |
| 1659 |
nothing calls this directly
no test coverage detected