From 3767e8f24ab5106f0db5696e07547d70fdff528e Mon Sep 17 00:00:00 2001 From: Chaitanya Date: Mon, 7 Oct 2024 15:09:12 +0530 Subject: [PATCH] feat: labels on proposal and proposals queries (#938) --- src/graphql/helpers.ts | 1 + src/graphql/schema.gql | 1 + src/helpers/schema.sql | 1 + 3 files changed, 3 insertions(+) diff --git a/src/graphql/helpers.ts b/src/graphql/helpers.ts index a31cd889..b0041526 100644 --- a/src/graphql/helpers.ts +++ b/src/graphql/helpers.ts @@ -380,6 +380,7 @@ export function formatUser(user) { export function formatProposal(proposal) { proposal.choices = jsonParse(proposal.choices, []); + proposal.labels = jsonParse(proposal.labels, []) || []; proposal.strategies = jsonParse(proposal.strategies, []); proposal.validation = jsonParse(proposal.validation, { name: 'any', diff --git a/src/graphql/schema.gql b/src/graphql/schema.gql index 83b79c65..afc6f2c1 100644 --- a/src/graphql/schema.gql +++ b/src/graphql/schema.gql @@ -480,6 +480,7 @@ type Proposal { body: String discussion: String! choices: [String]! + labels: [String]! start: Int! end: Int! quorum: Float! diff --git a/src/helpers/schema.sql b/src/helpers/schema.sql index 78a2eec2..eced9c00 100644 --- a/src/helpers/schema.sql +++ b/src/helpers/schema.sql @@ -45,6 +45,7 @@ CREATE TABLE proposals ( body MEDIUMTEXT NOT NULL, discussion TEXT NOT NULL, choices JSON NOT NULL, + labels JSON DEFAULT NULL, start INT(11) NOT NULL, end INT(11) NOT NULL, quorum DECIMAL(64,30) NOT NULL,