import { QueryHookOptions } from '@apollo/client' ; import { GetChannels as ChannelsType } from '../../generated/server/GetChannels' ; import { GET_CHANNELS } from '../../graphql/server/channels' ; import { ErrorAlertOptionType } from '../../types' ; import { useQuery } from '../../utils' ; export function useChannels ( options ? , errorAlert = 'SHOW_ALERT' ) { const { data , loading , error } = useQuery < ChannelsType > ( GET_CHANNELS , { ... options , } , errorAlert ) ; return { data , loading , error } ; }