MCPcopy
hub / github.com/TanStack/query / QueryRow

Function QueryRow

packages/query-devtools/src/Devtools.tsx:1317–1440  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

1315}
1316
1317const QueryRow: Component<{ query: Query }> = (props) => {
1318 const theme = useTheme()
1319 const css = useQueryDevtoolsContext().shadowDOMTarget
1320 ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
1321 : goober.css
1322 const styles = createMemo(() => {
1323 return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
1324 })
1325
1326 const { colors, alpha } = tokens
1327 const t = (light: string, dark: string) => (theme() === 'dark' ? dark : light)
1328
1329 const queryState = createSubscribeToQueryCacheBatcher(
1330 (queryCache) =>
1331 queryCache().find({
1332 queryKey: props.query.queryKey,
1333 })?.state,
1334 true,
1335 (e) => e.query.queryHash === props.query.queryHash,
1336 )
1337
1338 const isDisabled = createSubscribeToQueryCacheBatcher(
1339 (queryCache) =>
1340 queryCache()
1341 .find({
1342 queryKey: props.query.queryKey,
1343 })
1344 ?.isDisabled() ?? false,
1345 true,
1346 (e) => e.query.queryHash === props.query.queryHash,
1347 )
1348
1349 const isStatic = createSubscribeToQueryCacheBatcher(
1350 (queryCache) =>
1351 queryCache()
1352 .find({
1353 queryKey: props.query.queryKey,
1354 })
1355 ?.isStatic() ?? false,
1356 true,
1357 (e) => e.query.queryHash === props.query.queryHash,
1358 )
1359
1360 const isStale = createSubscribeToQueryCacheBatcher(
1361 (queryCache) =>
1362 queryCache()
1363 .find({
1364 queryKey: props.query.queryKey,
1365 })
1366 ?.isStale() ?? false,
1367 true,
1368 (e) => e.query.queryHash === props.query.queryHash,
1369 )
1370
1371 const observers = createSubscribeToQueryCacheBatcher(
1372 (queryCache) =>
1373 queryCache()
1374 .find({

Callers

nothing calls this directly

Calls 13

useThemeFunction · 0.90
useQueryDevtoolsContextFunction · 0.90
getQueryStatusColorFunction · 0.90
isStaleFunction · 0.85
isDisabledMethod · 0.80
isStaticMethod · 0.80
isStaleMethod · 0.80
getObserversCountMethod · 0.80
darkStylesFunction · 0.70
lightStylesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…