graphprotocol / adchain-subgraph

Example subgraph project for querying the AdChain TCR
MIT License
3 stars 7 forks source link

Implement two-way graphql relationship using @derivedFrom() directive #3

Closed fordN closed 6 years ago

fordN commented 6 years ago

Closes graphprotocol/graph-node#232

In order to implement the two-way relationship between Challenge and Application the Challenge type was updated to use challengeId as the primary ID rather than listingHash allowing for unique Challenges to be brought into the Application type using the @derivedFrom directive. Also updated was the handling of ChallengeRemoved and ChallengeSucceeded events which now set the application field to ensure the reference is maintained as the Challenge entity is created and updated.

html5cat commented 6 years ago

Do you think it would make sense to have a few sample queries or something like that to test data and changes?

fordN commented 6 years ago

I've updated the README example queries to include a "complex" where filter and the derivedFrom relationship.