Developer Hub
🔮 For applications
SDK
Data Hooks
useSportsNavigation

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, sports } = useSportsNavigation(props)

Props

{
  filter?: {
    sportHub?: SportHub
  }
  withGameCount?: boolean // adds the lightweight games data to sport for counting
  isLive?: boolean // if `true`, the hook will retrieve live navigation
}
enum SportHub {
  Sports = 'sports',
  Esports = 'esports',
  Unique = 'unique'
}

Return Value

{ 
  loading: boolean
  error: Error | null
  sports {
    id
    slug
    name
    // if `withGameCount` props is true includes games data
    games {
      id
    }
  }
}