1

I'm going though Patrick's solidity course. I'm on 28:36:52. I'm trying to deploy my subgraph and I'm getting this error.

✖ Failed to deploy to Graph node https://api.studio.thegraph.com/deploy/: subgraph resolve error: resolve error: Serialization error: missing field `name` at line 216 column 3

Can someone explain me what does this error mean and how to resolve it.

This is my 216 line on generated/schema.ts

line 215                         get nftAddress(): Bytes {
line 216                              let value = this.get("nftAddress");
line 217                              return value!.toBytes();
                                 }

And Nftmarketplace abi under build folder has name getProceeds near line 216. What's wrong?

Everything is auto generated like schema or build folder so they can't be wrong. I have tried deleting and doing everything 2-3 times. But it's not working. What am I missing?

2 Answers 2

0

I faced this same issue. I believe it's an ABI error. When I Initialized my subgraph I hadn't verified my contract on etherscan so i couldn't get the ABI automatically, thus, I had to add the json file manually. For some reasons, the ABI when pulled from etherscan is configured differently (for lack of a better word) when compared to manual json file.

It worked after I verified my contract on etherscan and graph init --studio marketplace-nft was able to pull the ABI from etherscan.

PS: compare the automatic generated ABI json file to the manual json file to see the difference.

0

I had the same problem and realized the ABI I had given was not in the correct format. The field "name" was missing in the output parameters of all function interfaces. I re-generated the ABI with the missing fields and it solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.