Skip to content
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

Adds nfts.getContractEvents and nfts.getCollectionEvents #46

Merged
merged 10 commits into from
May 10, 2023

Conversation

johnpmitsch
Copy link
Contributor

@johnpmitsch johnpmitsch commented May 9, 2023

I left out the filters but going to follow up with adding them in general, it was a little tricky with the enums that apollo-codegen emits since they won't work with strings: see issue here

@johnpmitsch johnpmitsch changed the title Adds nfts.getContractEvents and nfts.getNFTEvents Adds nfts.getContractEvents and nfts.getCollectionEvents May 9, 2023
@johnpmitsch johnpmitsch requested a review from emanuelpinho May 9, 2023 15:06
},
},
// TODO: Figure out type policies
typePolicies: {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't the previous working?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was seeing this:

Invariant Violation: Missing field 'contractAddress' while extracting keyFields from {"tokenEvents":{"pageInfo":{"endCursor":"T2Zmc2V0Q29ubmVjdGlvbjox","hasNextPage":false,"hasPreviousPage":false,"startCursor":"T2Zmc2V0Q29ubmVjdGlvbjow","__typename":"PageInfo"},"edges":[{"node":{"blockNumber":13181737,"fromAddress":"0x0000000000000000000000000000000000000000","timestamp":"2021-09-08T00:03:32.000Z","toAddress":"0x5467ba7a07a11769c2bd499f9fbe94a6b0eff269","transactionHash":"0xf78f4c8ee2029cf961a3cad6c6cafab3fbe14eb1932d705d655cba8b6b071265","transferIndex":398,"type":"MINT","tokenQuantity":1,"__typename":"TokenMintEvent"},"__typename":"NFTTokenEventsConnectionEdge"},{"node":{"blockNumber":14604458,"fromAddress":"0x5467ba7a07a11769c2bd499f9fbe94a6b0eff269","timestamp":"2022-04-17T18:50:08.000Z","toAddress":"0xa673b62171ed57d184214aae4bc0746024ab8cd8","transactionHash":"0xa69713bc3b43b90f4687ca8fe853021b828017feed6104dd4394413800fe85cc","transferIndex":576,"type":"SALE","marketplace":"OPENSEA","receivedTokenContractAddress":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","receivedTokenId":null,"sentTokenId":2000,"__typename":"TokenSaleEvent"},"__typename":"NFTTokenEventsConnectionEdge"}],"__typename":"NFTTokenEventsConnection"},"__typename":"ERC721NFT"}

My thought is to push the type policies in general out until later, especially as we add more queries

Copy link
Contributor

@emanuelpinho emanuelpinho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well structured, just small validation

@johnpmitsch johnpmitsch merged commit a311e0e into main May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants