[SDK] Migrate discovery and post-thread queries to the appview client (#11355)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-13 22:26:14 +03:00
committed by GitHub
parent b804f267cc
commit 855457c9fa
12 changed files with 137 additions and 126 deletions
@@ -7,7 +7,8 @@ import {
import {getContentLanguages} from '#/state/preferences/languages'
import {STALE} from '#/state/queries'
import {usePreferencesQuery} from '#/state/queries/preferences'
import {useAgent} from '#/state/session'
import {useAppviewClient} from '#/state/session'
import {app} from '#/lexicons'
export const createSuggestedStarterPacksQueryKey = (interests?: string[]) => [
'suggested-starter-packs',
@@ -21,7 +22,7 @@ export function useSuggestedStarterPacksQuery({
enabled?: boolean
overrideInterests?: string[]
}) {
const agent = useAgent()
const client = useAppviewClient()
const {data: preferences} = usePreferencesQuery()
const contentLangs = getContentLanguages().join(',')
@@ -30,8 +31,9 @@ export function useSuggestedStarterPacksQuery({
staleTime: STALE.MINUTES.THREE,
queryKey: createSuggestedStarterPacksQueryKey(overrideInterests),
queryFn: async () => {
const {data} = await agent.app.bsky.unspecced.getSuggestedStarterPacks(
undefined,
return await client.call(
app.bsky.unspecced.getSuggestedStarterPacks,
{},
{
headers: {
...createBskyTopicsHeader(
@@ -43,7 +45,6 @@ export function useSuggestedStarterPacksQuery({
},
},
)
return data
},
})
}