[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,14 +7,15 @@ 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 DEFAULT_LIMIT = 15
export const createGetSuggestedFeedsQueryKey = () => ['suggested-feeds']
export function useGetSuggestedFeedsQuery({enabled}: {enabled?: boolean}) {
const agent = useAgent()
const client = useAppviewClient()
const {data: preferences} = usePreferencesQuery()
const savedFeeds = preferences?.savedFeeds
@@ -24,7 +25,8 @@ export function useGetSuggestedFeedsQuery({enabled}: {enabled?: boolean}) {
queryKey: createGetSuggestedFeedsQueryKey(),
queryFn: async () => {
const contentLangs = getContentLanguages().join(',')
const {data} = await agent.app.bsky.unspecced.getSuggestedFeeds(
const data = await client.call(
app.bsky.unspecced.getSuggestedFeeds,
{
limit: DEFAULT_LIMIT,
},