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
<code>const query = createQuery({
queryKey: key,
queryFn: async () => {
const response = await actionOption.request(keyId)
return response
},
select: (data) => {
return data.data
},
staleTime: 0,
...queryOptions
})
</code>
<code>const query = createQuery({
queryKey: key,
queryFn: async () => {
const response = await actionOption.request(keyId)
return response
},
select: (data) => {
return data.data
},
staleTime: 0,
...queryOptions
})
</code>
const query = createQuery({
queryKey: key,
queryFn: async () => {
const response = await actionOption.request(keyId)
return response
},
select: (data) => {
return data.data
},
staleTime: 0,
...queryOptions
})