#enable queries by id ?

9 messages · Page 1 of 1 (latest)

velvet raptor
#

how to add proper types? in useQueries?

woven grail
#

Looks like you've added types already? What is the error?

velvet raptor
#

for now i put any m not able to find solution

woven grail
velvet raptor
woven grail
#

So what was the issue with:

const [credits, images, videos, reviews] = useQueries({
    queries: tmdbMovie.queries.map<UseQueryOptions<ICredits, Error>>((query) => ({
      queryKey: [`${tMovie.id}/${query}`],
      enabled: !!tMovie,
    })),
  });

I just tried it and it seems to work. credits, images, videos and reviews get the type UseQueryResult<ICredits, Error>.

velvet raptor
#

its giving only credits type completion - <UseQueryOptions<ICredits, Error> in here m passing ICredit how to pass mutiple types ?
i tried doing this type MovieMetaResult = ICredit | Iimages | Ivideos | Ireviews
<UseQueryOptions<MovieMetaResult , Error> n pss like this but not giving completion