Browse Source

Fix the events relationships

Theophile Sandoz 3 years ago
parent
commit
d1d6fa55e0
2 changed files with 12 additions and 3 deletions
  1. 3 3
      query-node/schemas/bounty.graphql
  2. 9 0
      query-node/schemas/bountyEvents.graphql

+ 3 - 3
query-node/schemas/bounty.graphql

@@ -101,10 +101,10 @@ type Bounty @entity {
 
   # Events:
   "The event the bounty was created in"
-  createdInEvent: BountyCreatedEvent!
+  createdInEvent: BountyCreatedEvent! @derivedFrom(field: "bounty")
 
   "Event emitted if a bounty reached its maximum funding amount"
-  maxFundingReachedEvent: BountyMaxFundingReachedEvent
+  maxFundingReachedEvent: BountyMaxFundingReachedEvent @derivedFrom(field: "bounty")
 }
 
 "Initial status during creation in Working Period."
@@ -197,7 +197,7 @@ type BountyEntry @entity {
 
   # Events
   "The event the work entry was created in"
-  announcedInEvent: WorkEntryAnnouncedEvent!
+  announcedInEvent: WorkEntryAnnouncedEvent! @derivedFrom(field: "entry")
 }
 
 type BountyContribution @entity {

+ 9 - 0
query-node/schemas/bountyEvents.graphql

@@ -17,6 +17,9 @@ type BountyCreatedEvent implements Event @entity {
   indexInBlock: Int!
 
   ### SPECIFIC DATA ###
+
+  "Related bounty"
+  bounty: Bounty!
 }
 
 type BountyMaxFundingReachedEvent implements Event @entity {
@@ -38,6 +41,9 @@ type BountyMaxFundingReachedEvent implements Event @entity {
   indexInBlock: Int!
 
   ### SPECIFIC DATA ###
+
+  "Related bounty"
+  bounty: Bounty!
 }
 
 type WorkEntryAnnouncedEvent implements Event @entity {
@@ -59,4 +65,7 @@ type WorkEntryAnnouncedEvent implements Event @entity {
   indexInBlock: Int!
 
   ### SPECIFIC DATA ###
+
+  "Related work entry"
+  entry: BountyEntry!
 }