Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How to Use select in createQuery with Svelte Query to Process Fetched Data?

$
0
0

I'm using @tanstack/svelte-query with Svelte and want to process the data fetched by createQuery, similar to how select works in React Query's useQuery. How can I achieve this in Svelte?

This code is not working

const query = createQuery({    queryKey: key,    queryFn: async () => {      const response = await actionOption.request(keyId)      return response    },    select: (data) => {      return data.data    },    staleTime: 0,    ...queryOptions  })

Viewing all articles
Browse latest Browse all 1541

Trending Articles