diff --git a/graphql-schema/proposal.graphql b/graphql-schema/proposal.graphql index 1d11dad3..4d5d0197 100644 --- a/graphql-schema/proposal.graphql +++ b/graphql-schema/proposal.graphql @@ -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)" diff --git a/graphql-server/pkg/resolvers/proposal.go b/graphql-server/pkg/resolvers/proposal.go index 7268d2ce..8bf7d78d 100644 --- a/graphql-server/pkg/resolvers/proposal.go +++ b/graphql-server/pkg/resolvers/proposal.go @@ -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) {