-
Notifications
You must be signed in to change notification settings - Fork 3
feat(retriever): add SubgraphRetriever #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looking good! |
src/subgraph/service.ts
Outdated
* Returns an empty array if no providers are found or if an error occurs during the fetch. | ||
*/ | ||
async getProvidersForCommP (commP: CommP): Promise<ApprovedProviderInfo[]> { | ||
const hexCommP = toHex(commP.bytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const hexCommP = toHex(commP.bytes) | |
const commPParsed = asCommP(commP) | |
if (commPParsed == null) { | |
throw new Error(`Invalid CommP: ${commP}`) | |
} | |
const hexCommP = toHex(commPParsed.bytes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces subgraph-based piece retrieval by adding a SubgraphService
and a SubgraphRetriever
, integrates them into the main Synapse
flow, and updates types, exports, and documentation accordingly.
- Extend
SynapseOptions
withsubgraphService
andsubgraphConfig
to configure subgraph retrieval. - Implement
SubgraphService
(GraphQL client) andSubgraphRetriever
(with fallback to chain/CDN retrievers). - Integrate the new retriever into
synapse.ts
, export it in the retriever module, and add usage documentation inREADME.md
.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/types.ts | Added SubgraphConfig and SubgraphRetrievalService options |
src/subgraph/service.ts | New GraphQL-based SubgraphService implementation |
src/retriever/subgraph.ts | New SubgraphRetriever with child fallback |
src/synapse.ts | Hooked up subgraph retriever in Synapse initialization |
src/retriever/index.ts | Exported SubgraphRetriever |
README.md | Added "Subgraph Service" section and updated Synapse options docs |
Comments suppressed due to low confidence (1)
src/subgraph/service.ts:336
- The log prefix 'SubgraphService: queryProviders' in
safeConvertHexToCid
is misleading since this is CID-conversion logic, not part ofqueryProviders
. Consider updating it to referencesafeConvertHexToCid
(or removing the incorrect method name) for clarity.
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work
## [0.19.0](v0.18.0...v0.19.0) (2025-07-11) ### Features * implement SynapseStorage[#piece](https://github.com/FilOzone/synapse-sdk/issues/piece)Status(commp) ([#127](#127)) ([9ee7f5b](9ee7f5b)) * **retriever:** add SubgraphRetriever ([#115](#115)) ([6352278](6352278)) ### Trivial Changes * Update .github/workflows/add-issues-and-prs-to-fs-project-board.yml [skip ci] ([579ef07](579ef07))
🎉 This PR is included in version 0.19.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR introduces the
SubgraphRetriever
, a new component that allows fetching piece information from a user-configured subgraph.It can be chained with other retrievers, such as
ChainRetriever
andFilCDNRetriever
, to create a flexible and powerful data discovery pipeline. This provides an alternative for users who rely on subgraphs forcommp
to provider mapping.This also contains an
SubgraphService
that can be used independently -