import { queryOptions } from '@tanstack/react-query'
import { searchQuery } from 'src/lib/api'
import { queryKeys } from './keys'

export const searchQueries = {
  results: (query: string) =>
    queryOptions({
      queryKey: queryKeys.search.query(query),
      queryFn: () => searchQuery(query),
      staleTime: 2 * 60 * 1000,
      gcTime: 30 * 60 * 1000,
    }),
}
