Skip to content

Commit

Permalink
get total volume and winner from campaigns query
Browse files Browse the repository at this point in the history
  • Loading branch information
ogous committed Jan 22, 2025
1 parent 36253a1 commit fbd91ea
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 15 deletions.
61 changes: 61 additions & 0 deletions cmd/graphql.ethereum/graph/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cmd/graphql.ethereum/graph/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ type Campaign {
If any outcome declared as winner, it returns bytes8 id
"""
winner: String

"""
It returns total invested amount as usd
"""
totalVolume: Int!
}

type Outcome {
Expand Down
29 changes: 18 additions & 11 deletions cmd/graphql.ethereum/graph/schema.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions lib/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (

type (
Campaign struct {
ID string `gorm:"primaryKey"`
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
Content CampaignContent `json:"content"`
ID string `gorm:"primaryKey"`
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
Content CampaignContent `json:"content"`
TotalVolume int `json:"totalVolume"`
}

Outcome struct {
Expand Down

0 comments on commit fbd91ea

Please sign in to comment.