MCPcopy Create free account
hub / github.com/TanStack/query / Test

Function Test

packages/solid-query/src/__tests__/useQuery.test-d.tsx:313–325  ·  view source on GitHub ↗
(props: {
        dataType: TDataType
      })

Source from the content-addressed store, hash-verified

311 ) => 'test'
312
313 function Test<TDataType extends DataType>(props: {
314 dataType: TDataType
315 }) {
316 const query = useQuery(() => ({
317 queryKey: ['test'],
318 queryFn: () => getData(props.dataType),
319 }))
320
321 // Regression guard: this call must compile. With the previous
322 // hand-rolled NoInfer, `data` failed to flow back into the generic
323 // indexed-access parameter `DataTypeToEntity[TDataType]`.
324 return query.data ? getLabel(props.dataType, query.data) : null
325 }
326
327 expectTypeOf(Test).toBeFunction()
328 })

Callers

nothing calls this directly

Calls 3

getDataFunction · 0.70
getLabelFunction · 0.70
useQueryFunction · 0.50

Tested by

no test coverage detected