Skip to content

Commit db9bacc

Browse files
comment
1 parent ccabf3a commit db9bacc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

shared/utils/constellation.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ export class Constellation {
6262
filterByDids: [string][] = [],
6363
ttl: number | undefined = undefined,
6464
) {
65+
// Note that using Client from @atproto/lex here is kinda "hard" because it
66+
// expects a native fetch implementation, which is "hard" to provide using
67+
// this.cachedFetch as underlying fetch implementation. In addition to this,
68+
// blue.microcosm.links.getBacklinks is not a published lexicon, meaning
69+
// that we cannot install it using `pnpm exec lex install
70+
// blue.microcosm.links.getBacklinks` and get generated type definitions,
71+
// which kinda defeats the purpose of using Client in the first place. For
72+
// these reasons, we are using this.cachedFetch directly to call the
73+
// constellation API endpoint, and type casting the response.
6574
const source = encodeURIComponent(`${collection}:${recordPath}`)
6675
let urlToCall = `https://${CONSTELLATION_HOST}/xrpc/blue.microcosm.links.getBacklinks?subject=${encodeURIComponent(subject)}&source=${source}&limit=${limit}`
6776
if (cursor) urlToCall += `&cursor=${cursor}`

0 commit comments

Comments
 (0)