I am using the graph and am looking to get NFT meta data via ipfs in a transfer event. Everything works as expected unless I try to fetch meta data via ipfs
The schema looks like
type Example @entity {
id: ID!
createdAtTimeStamp: BigInt!
contentURI: String!
tokenId: BigInt!
name: String!
description: String!
image: String!
externalURL: String!
}
and the transfer event
const IPFSHASH = "EXAMPLE_IPFS_HASH";
export function handleTransfer(event: TransferEvent): void {
let example = Example.load(event.params.tokenId.toString());
if (!example) {
example = new Example(event.params.tokenId.toString());
example.createdAtTimeStamp = event.block.timestamp;
example.tokenId = event.params.tokenId;
let exampleContract = ExampleContract.bind(event.address);
example.contentURI = exampleContract.tokenURI(event.params.tokenId);
const ipfsUrl = "/" + event.params.tokenId.toString() + ".json";
let metadata = ipfs.cat(ipfshash + token.tokenURI);
if(metadata) {
.....
}
}
And I cannot get it to compile correctly whenever I use the ipfs lib from the graph with error Failed to compile data source mapping: Subgraph Studio does not support mappings with ipfs methods.