I am considering The Graph’s indexer solution for a new project but there is one large obstacle.
I need the ability to merge both on-chain and off-chain data from various sources into a single subgraph.
Consider the use case where there is a directory of user profiles where data like fungible token balances, NFT ownership, etc. are on-chain but bios, status and other attributes are off-chain.
I understand mutations are not available today but is there another way to achieve this? Would it be possible to retrieve and store off-chain data via API in mappers?
Not so crazy. The Graph is currently very strong with deterministic data like what we see on blockchains. There are initiatives to enhance this with less-deterministic data, mainly File Data Sources as described here.
Until that lands, you basically have two options:
- Create an oracle by yourself that uploads your data on IPFS on anchors it on-chain. You can then write a subgraph that downloads that data and stores it in whatever format you like. The concept is roughly explained in the Data Edge GIP. This is a great approach if you want to make that data public anyways, because you do not need to think about storing, scaling, etc.
- If the data is more private, you can use Graph Client. This tool makes it easy to combine multiple subgraphs in your frontend but can also stitch-in other data sources. Basically everything.
I hope that helps. Let me know how it goes.