about summary refs log tree commit diff
path: root/src/state/queries/profile.ts
blob: c2cd19482c6622049a7897799d0ff5bcce1dd007 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import {useQuery} from '@tanstack/react-query'

import {PUBLIC_BSKY_AGENT} from '#/state/queries'

export function useProfileQuery({did}: {did: string}) {
  return useQuery({
    queryKey: ['getProfile', did],
    queryFn: async () => {
      const res = await PUBLIC_BSKY_AGENT.getProfile({actor: did})
      return res.data
    },
  })
}