Skip to content

Commit

Permalink
graphql-server: Softcast proposal type
Browse files Browse the repository at this point in the history
  • Loading branch information
Rico committed Sep 13, 2022
1 parent 6f4e308 commit d04f706
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion graphql-schema/proposal.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Proposal implements Node {
proposalId: Int!
title: String!
description: String!
type: ProposalType!
type: String!
submitTime: DateTime!
depositEndTime: DateTime
"Sum of all deposit in chain's coin denom (non chain's coin denom deposits excluded)"
Expand Down
6 changes: 3 additions & 3 deletions graphql-server/pkg/resolvers/proposal.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ func (r *proposalResolver) ProposalID(ctx context.Context, obj *models.Proposal)
return obj.ID, nil
}

func (r *proposalResolver) Type(ctx context.Context, obj *models.Proposal) (models.ProposalType, error) {
func (r *proposalResolver) Type(ctx context.Context, obj *models.Proposal) (string, error) {
proposalType := new(models.ProposalType)
err := proposalType.UnmarshalGQL(obj.ProposalType)
if err != nil {
return "", nil
return obj.ProposalType, nil
}

return *proposalType, nil
return proposalType.String(), nil
}

func (r *proposalResolver) DepositTotal(ctx context.Context, obj *models.Proposal) ([]types.DbDecCoin, error) {
Expand Down

0 comments on commit d04f706

Please sign in to comment.