Hook is used for fetch lightweight sports data for navigation.
Hook represents a logic wrapper over standard Apollo's useQuery
hook. Explore Apollo's docs (opens in a new tab) to understand what data the hooks return.
You can find the list of available sports here (opens in a new tab).
Usage
import { useSportsNavigation } from '@azuro-org/sdk'
const { loading, data } = useSportsNavigation(props)
Props
{
withGameCount?: boolean // adds the lightweight games data to sport for counting
}
Return Value
{
loading: boolean
error: Error | null
data: {
sports {
id
slug
name
// if `withGameCount` props is true includes games data
games {
id
}
}
}
}