⚠️
Important! We’ve moved to V3! This documentation is for V2 only and will be updated in May.
Developer Hub
🔮 For applications
SDK
Data Hooks
useSportsNavigation

useSportsNavigation

The useSportsNavigation hook is used for fetch lightweight sports data for navigation.

ℹ️

Hook represents a logic wrapper over TanStack Query's useQuery hook. Explore TanStack Query docs (opens in a new tab) to understand what data the hook returns.

Usage

import { useSportsNavigation } from '@azuro-org/sdk'
 
 
const { data, isFetching, error } = useSportsNavigation(props)

Props

{
  filter?: {
    sportHub?: SportHub
    sportIds?: Array<string | number>
  }
  isLive?: boolean // if `true`, the hook will retrieve live navigation
  query?: QueryParameter<SportsNavigationQuery['sports']> // useQuery params
}
enum SportHub {
  Sports = 'sports',
  Esports = 'esports',
  Unique = 'unique'
}

Return Value

UseQueryResult<SportsNavigationQuery['sports']>
import { type UseQueryResult } from '@tanstack/react-query'
 
type SportsNavigationQuery = {
    __typename?: 'Query'
    sports: Array<{
        __typename?: 'Sport'
        id: string
        slug: string
        name: string
        sportId: string
        activeGamesCount: number
        activeLiveGamesCount: number
        activePrematchGamesCount: number
        sporthub: {
            __typename?: 'SportHub'
            id: string
            slug: string
        }
    }>
}