From 38f11e1957b846dbf8e2edbeabda80bd1a1fc783 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Fri, 15 May 2020 19:04:32 +0530 Subject: [PATCH 01/62] Added vote tables --- .../down.yaml | 5 +++++ .../up.yaml | 14 ++++++++++++++ .../down.yaml | 6 ++++++ .../up.yaml | 13 +++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/up.yaml diff --git a/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/down.yaml b/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/down.yaml new file mode 100644 index 000000000..dc86ba407 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: DROP TABLE "public"."votes"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/up.yaml b/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/up.yaml new file mode 100644 index 000000000..c541a3411 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/up.yaml @@ -0,0 +1,14 @@ +- args: + cascade: false + read_only: false + sql: CREATE TABLE "public"."votes"("id" serial NOT NULL, "post_id" integer NOT + NULL, "user_id" integer NOT NULL, "address" bpchar NOT NULL, "amount" integer + NOT NULL, "vote" bpchar NOT NULL, "created_at" timestamp NOT NULL DEFAULT now(), + "updated_at" timestamp NOT NULL DEFAULT now(), PRIMARY KEY ("id") , FOREIGN + KEY ("post_id") REFERENCES "public"."posts"("id") ON UPDATE restrict ON DELETE + restrict, UNIQUE ("id")); + type: run_sql +- args: + name: votes + schema: public + type: add_existing_table_or_view diff --git a/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/down.yaml b/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/down.yaml new file mode 100644 index 000000000..19f96cb20 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/down.yaml @@ -0,0 +1,6 @@ +- args: + name: voter + table: + name: votes + schema: public + type: delete_remote_relationship diff --git a/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/up.yaml b/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/up.yaml new file mode 100644 index 000000000..431e449d6 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/up.yaml @@ -0,0 +1,13 @@ +- args: + hasura_fields: + - user_id + name: voter + remote_field: + user: + arguments: + id: $user_id + remote_schema: auth + table: + name: votes + schema: public + type: create_remote_relationship From e0183a1e202bd6b948a4dce70977b87f6e9fb4d8 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Fri, 15 May 2020 19:11:40 +0530 Subject: [PATCH 02/62] Added permissions --- .../down.yaml | 6 +++ .../up.yaml | 20 ++++++++ .../down.yaml | 6 +++ .../up.yaml | 20 ++++++++ .../down.yaml | 6 +++ .../up.yaml | 21 +++++++++ .../down.yaml | 12 +++++ .../up.yaml | 46 +++++++++++++++++++ .../down.yaml | 6 +++ .../up.yaml | 20 ++++++++ 10 files changed, 163 insertions(+) create mode 100644 hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/up.yaml diff --git a/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/down.yaml new file mode 100644 index 000000000..4bbe3384e --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: anonymous + table: + name: votes + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/up.yaml new file mode 100644 index 000000000..d15861323 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/up.yaml @@ -0,0 +1,20 @@ +- args: + permission: + allow_aggregations: false + columns: + - id + - post_id + - user_id + - address + - amount + - vote + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: anonymous + table: + name: votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/down.yaml new file mode 100644 index 000000000..bea23bd23 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: proposal_bot + table: + name: votes + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/up.yaml new file mode 100644 index 000000000..ef1cce9af --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/up.yaml @@ -0,0 +1,20 @@ +- args: + permission: + allow_aggregations: false + columns: + - address + - vote + - amount + - id + - post_id + - user_id + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: proposal_bot + table: + name: votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/down.yaml new file mode 100644 index 000000000..c2ab30ecd --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: votes + schema: public + type: drop_insert_permission diff --git a/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/up.yaml new file mode 100644 index 000000000..bef266e96 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/up.yaml @@ -0,0 +1,21 @@ +- args: + permission: + allow_upsert: true + check: + user_id: + _eq: X-Hasura-User-Id + columns: + - address + - amount + - post_id + - user_id + - vote + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: votes + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/down.yaml new file mode 100644 index 000000000..367f4fb9a --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/down.yaml @@ -0,0 +1,12 @@ +- args: + role: user + table: + name: votes + schema: public + type: drop_delete_permission +- args: + role: user + table: + name: votes + schema: public + type: drop_update_permission diff --git a/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/up.yaml new file mode 100644 index 000000000..0e2e2c040 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/up.yaml @@ -0,0 +1,46 @@ +- args: + permission: + check: + user_id: + _eq: X-Hasura-User-Id + columns: + - address + - amount + - post_id + - user_id + - vote + filter: + user_id: + _eq: X-Hasura-User-Id + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: votes + schema: public + type: create_update_permission +- args: + permission: + check: + user_id: + _eq: X-Hasura-User-Id + columns: + - address + - amount + - post_id + - user_id + - vote + filter: + user_id: + _eq: X-Hasura-User-Id + localPresets: + - key: "" + value: "" + set: {} + role: user + table: + name: votes + schema: public + type: create_delete_permission diff --git a/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/down.yaml new file mode 100644 index 000000000..1a201f45d --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: votes + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/up.yaml new file mode 100644 index 000000000..1c833afbf --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/up.yaml @@ -0,0 +1,20 @@ +- args: + permission: + allow_aggregations: false + columns: + - address + - vote + - amount + - id + - post_id + - user_id + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: user + table: + name: votes + schema: public + type: create_select_permission From f31ad97e054191b7655cd59cc4811ed7187cb1e3 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Fri, 15 May 2020 19:24:11 +0530 Subject: [PATCH 03/62] Added votes post relationship --- .../down.yaml | 6 ++++++ .../up.yaml | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/up.yaml diff --git a/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/down.yaml b/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/down.yaml new file mode 100644 index 000000000..5ce9596d2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: post + table: + name: votes + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/up.yaml b/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/up.yaml new file mode 100644 index 000000000..de0b30564 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/up.yaml @@ -0,0 +1,8 @@ +- args: + name: post + table: + name: votes + schema: public + using: + foreign_key_constraint_on: post_id + type: create_object_relationship From 5d11d81eda00ce449dde9fc5d61e95d409b1737a Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Sun, 17 May 2020 16:07:29 +0530 Subject: [PATCH 04/62] Added UI --- front-end/src/components/GovernanceCard.tsx | 18 ++-- .../Proposals/SecondProposal.tsx | 20 +++-- .../Referenda/VoteReferendum.tsx | 20 +++-- .../Post/GovernanceSideBar/VoteMotion.tsx | 20 +++-- .../components/Post/Poll/CouncilSignals.tsx | 82 +++++++++++++++++++ .../components/Post/Poll/OffChainSignals.tsx | 44 ++++++++++ front-end/src/components/Post/Poll/index.tsx | 23 ++++++ front-end/src/components/Post/Poll/query.ts | 46 +++++++++++ front-end/src/components/Post/Post.tsx | 2 + .../src/ui-components/CouncilSignalBar.tsx | 74 +++++++++++++++++ .../src/ui-components/OffChainSignalBar.tsx | 63 ++++++++++++++ 11 files changed, 376 insertions(+), 36 deletions(-) create mode 100644 front-end/src/components/Post/Poll/CouncilSignals.tsx create mode 100644 front-end/src/components/Post/Poll/OffChainSignals.tsx create mode 100644 front-end/src/components/Post/Poll/index.tsx create mode 100644 front-end/src/components/Post/Poll/query.ts create mode 100644 front-end/src/ui-components/CouncilSignalBar.tsx create mode 100644 front-end/src/ui-components/OffChainSignalBar.tsx diff --git a/front-end/src/components/GovernanceCard.tsx b/front-end/src/components/GovernanceCard.tsx index 277f6d8f4..6045652c9 100644 --- a/front-end/src/components/GovernanceCard.tsx +++ b/front-end/src/components/GovernanceCard.tsx @@ -22,7 +22,7 @@ interface GovernanceProps { topic: string } -const GovernanceAction = function ({ +const GovernanceCard = function ({ address, className, comments, @@ -73,14 +73,14 @@ const GovernanceAction = function ({ ); }; -export default styled(GovernanceAction)` +export default styled(GovernanceCard)` padding: 2rem 3rem 1.5rem 3rem; background-color: white; border-style: solid; border-width: 1px; border-color: grey_border; border-radius: 3px; - + &:hover { background-color: white_transparent; border-style: solid; @@ -112,7 +112,7 @@ export default styled(GovernanceAction)` top: 0; right: 0; } - + .title-wrapper { max-width: calc(100% - 10rem); @@ -124,7 +124,7 @@ export default styled(GovernanceAction)` h4, h5 { font-family: font_default; display: block; - margin-bottom: 0.6rem; + margin-bottom: 0.6rem; } h4 { @@ -158,12 +158,12 @@ export default styled(GovernanceAction)` margin-right: 1.5rem; } } - + @media only screen and (max-width: 576px) { & { - padding: 1.2rem 1.5rem; + padding: 1.2rem 1.5rem; } - + h4 { font-size: md; } @@ -178,4 +178,4 @@ export default styled(GovernanceAction)` font-size: 1rem!important; } } -`; \ No newline at end of file +`; diff --git a/front-end/src/components/Post/GovernanceSideBar/Proposals/SecondProposal.tsx b/front-end/src/components/Post/GovernanceSideBar/Proposals/SecondProposal.tsx index a31077c9d..8e84c5975 100644 --- a/front-end/src/components/Post/GovernanceSideBar/Proposals/SecondProposal.tsx +++ b/front-end/src/components/Post/GovernanceSideBar/Proposals/SecondProposal.tsx @@ -68,15 +68,17 @@ const SecondProposal = ({ className, proposalId, address, accounts, onAccountCha }; const GetAccountsButton = () => - - - ; + + + + + ; const noAccount = accounts.length === 0; diff --git a/front-end/src/components/Post/GovernanceSideBar/Referenda/VoteReferendum.tsx b/front-end/src/components/Post/GovernanceSideBar/Referenda/VoteReferendum.tsx index 1fc319f9b..b0eb3fc58 100644 --- a/front-end/src/components/Post/GovernanceSideBar/Referenda/VoteReferendum.tsx +++ b/front-end/src/components/Post/GovernanceSideBar/Referenda/VoteReferendum.tsx @@ -88,15 +88,17 @@ const VoteRefrendum = ({ className, referendumId, address, accounts, onAccountCh }; const GetAccountsButton = () => - - - ; + + + + + ; const noAccount = accounts.length === 0; diff --git a/front-end/src/components/Post/GovernanceSideBar/VoteMotion.tsx b/front-end/src/components/Post/GovernanceSideBar/VoteMotion.tsx index e0ebc3cce..a9b15b55b 100644 --- a/front-end/src/components/Post/GovernanceSideBar/VoteMotion.tsx +++ b/front-end/src/components/Post/GovernanceSideBar/VoteMotion.tsx @@ -101,15 +101,17 @@ const VoteMotion = ({ }; const GetAccountsButton = () => - -
Only council members can vote on motions.

- -
; + + +
Only council members can vote on motions.

+ +
+
; const noAccount = accounts.length === 0; diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx new file mode 100644 index 000000000..c35f7bcea --- /dev/null +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -0,0 +1,82 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import styled from '@xstyled/styled-components'; +import * as React from 'react'; +import { Grid, Icon } from 'semantic-ui-react'; + +import Address from '../../../ui-components/Address'; +import Card from '../../../ui-components/Card'; +import CouncilSignalBar from '../../../ui-components/CouncilSignalBar'; + +interface Props { + className?: string +} + +const CouncilSignals = ({ className }: Props) => { + const addresses = [ + 'HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F', + 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP', + 'JKspFU6ohf1Grg3Phdzj2pSgWvsYWzSfKghhfzMbdhNBWs5', + 'Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P' + ]; + + return ( + +

Council Signals

+ + + {addresses.map(address => + + +
+
+
+
+ + {address === 'HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F' ? <> +
+ +
+ Aye + : <> +
+ +
+ Nay + } +
+
+ )} +
+
+ ); +}; + +export default styled(CouncilSignals)` + .council-votes { + margin-top: 2em; + } + .thumbs { + display: inline-block; + text-align: center; + vertical-align: middle; + color: white; + width: 2rem; + height: 2rem; + border-radius: 50%; + font-size: 1rem; + } + + .thumbs.up { + background-color: green_primary; + } + + .thumbs.down { + background-color: red_primary; + } +`; diff --git a/front-end/src/components/Post/Poll/OffChainSignals.tsx b/front-end/src/components/Post/Poll/OffChainSignals.tsx new file mode 100644 index 000000000..e50bf8ca3 --- /dev/null +++ b/front-end/src/components/Post/Poll/OffChainSignals.tsx @@ -0,0 +1,44 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import styled from '@xstyled/styled-components'; +import * as React from 'react'; + +import AyeNayButtons from '../../../ui-components/AyeNayButtons'; +import Card from '../../../ui-components/Card'; +import { Form } from '../../../ui-components/Form'; +import OffChainSignalBar from '../../../ui-components/OffChainSignalBar'; + +interface Props { + className?: string +} + +const CouncilSignals = ({ className }: Props) => { + const voteRefrendum = (bool: Boolean) => { + console.log(bool); + }; + + return ( + + +
Signals are off chain.
+
+ voteRefrendum(true)} + onClickNay={() => voteRefrendum(false)} + /> + +
+ ); +}; + +export default styled(CouncilSignals)` + .info { + margin: 1em 0; + } +`; diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx new file mode 100644 index 000000000..345c0ea40 --- /dev/null +++ b/front-end/src/components/Post/Poll/index.tsx @@ -0,0 +1,23 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import * as React from 'react'; + +import CouncilSignals from './CouncilSignals'; +import OffChainSignals from './OffChainSignals'; + +interface Props { + +} + +const Poll = () => { + return ( + <> + + + + ); +}; + +export default Poll; diff --git a/front-end/src/components/Post/Poll/query.ts b/front-end/src/components/Post/Poll/query.ts new file mode 100644 index 000000000..36ed09c54 --- /dev/null +++ b/front-end/src/components/Post/Poll/query.ts @@ -0,0 +1,46 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import gql from 'graphql-tag'; + +export const votesFields = gql` + fragment votesFields on votes { + id + voter { + id + username + kusama_default_address + polkadot_default_address + } + vote + created_at + updated_at + } +`; + +export const QUERY_POST_VOTES = gql` + query Votes ($postId: Int!) { + votes(where: {post_id: {_eq: $postId}}) { + ...votesFields + } + } + ${votesFields} +`; + +export const ADD_VOTE = gql` + mutation AddVote ($postId: Int!, $userId: Int!, $vote: String!) { + __typename + insert_votes_one(objects: {post_id: $postId, user_id: $userId, vote: $vote}) { + affected_rows + } + } +`; + +export const DELETE_VOTE = gql` + mutation DeletePostReaction ($postId: Int!, $userId: Int!) { + delete_vote(where: {_and: [{post_id: {_eq: $postId}}, {user_id: {_eq: $userId}}}]}) { + affected_rows + } + } +`; diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index a4732d077..7ea4fb027 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -40,6 +40,7 @@ import PostReactionBar from '../Reactionbar/PostReactionBar'; import ReportButton from '../ReportButton'; import SubscriptionButton from '../SubscriptionButton/SubscriptionButton'; import GovenanceSideBar from './GovernanceSideBar'; +import Poll from './Poll'; import CreatePostComment from './PostCommentForm'; import PostMotionInfo from './PostGovernanceInfo/PostMotionInfo'; import PostProposalInfo from './PostGovernanceInfo/PostProposalInfo'; @@ -182,6 +183,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> + ); diff --git a/front-end/src/ui-components/CouncilSignalBar.tsx b/front-end/src/ui-components/CouncilSignalBar.tsx new file mode 100644 index 000000000..d22849b02 --- /dev/null +++ b/front-end/src/ui-components/CouncilSignalBar.tsx @@ -0,0 +1,74 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import styled from '@xstyled/styled-components'; +import React from 'react'; + +interface Props { + className?: string + ayeSignals: number + naySignals: number + councilSize?: number +} + +const CouncilSignalBar = ({ ayeSignals, className, councilSize = 13, naySignals }: Props) => { + const notSignaled = councilSize - ayeSignals - naySignals; + + return ( +
+
{ayeSignals === 1 ? '1 Aye' : `${ayeSignals} Ayes`}
+
{naySignals === 1 ? '1 Nay' : `${naySignals} Nays`}
+
+
+ {[...Array(ayeSignals)].map((e, i) =>
)} + {[...Array(notSignaled)].map((e, i) =>
)} + {[...Array(naySignals)].map((e, i) =>
)} +
+
+ ); +}; + +export default styled(CouncilSignalBar)` + position: relative; + .signal-bar { + display: flex; + align-items: stretch; + justify-content: space-between; + width: 100%; + height: 0.8rem; + border-radius: 3px; + overflow: hidden; + } + .ayes, .nays { + display: inline-flex; + margin-bottom: -1rem; + } + .nays { + position: absolute; + right: 0; + } + .aye, .nay, .not-signaled { + display: inline-flex; + margin-right: 1px; + width: 100%; + } + .aye { + background-color: green_primary; + } + .nay { + background-color: red_primary; + } + .not-signaled { + background-color: grey_light; + } + .threshold { + display: inline-flex; + position: absolute; + left: 50%; + width: 0.1rem; + height: 2rem; + background-color: grey_secondary; + margin-top: 1.3rem; + } +`; diff --git a/front-end/src/ui-components/OffChainSignalBar.tsx b/front-end/src/ui-components/OffChainSignalBar.tsx new file mode 100644 index 000000000..1a7fd0b84 --- /dev/null +++ b/front-end/src/ui-components/OffChainSignalBar.tsx @@ -0,0 +1,63 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import styled from '@xstyled/styled-components'; +import React from 'react'; +import { Progress } from 'semantic-ui-react'; + +interface Props { + className?: string + ayeSignals: number + naySignals: number + councilSize?: number +} + +const OffChainSignalBar = ({ ayeSignals, className, naySignals }: Props) => { + + return ( +
+
{ayeSignals === 1 ? '1 Aye' : `${ayeSignals} Ayes`}
+
{naySignals === 1 ? '1 Nay' : `${naySignals} Nays`}
+ +
+ ); +}; + +export default styled(OffChainSignalBar)` + position: relative; + .signal-bar { + display: flex; + align-items: stretch; + justify-content: space-between; + width: 100%; + height: 0.8rem; + border-radius: 3px; + overflow: hidden; + } + .ayes, .nays { + display: inline-flex; + margin-bottom: -1rem; + } + .nays { + position: absolute; + right: 0; + } + .ui.progress { + height: 1rem; + margin: 0.2rem 0; + background-color: grey_light; + .bar { + height: 1rem; + } + } + + .passing { + .bar { + background-color: green_primary; + } + } +`; From b41d60ad16b333ebf5e881288010b2af52498bbd Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Sun, 17 May 2020 18:43:11 +0530 Subject: [PATCH 05/62] Added Offchain Poll --- .../components/Post/Poll/OffChainSignals.tsx | 66 +- front-end/src/components/Post/Poll/index.tsx | 32 +- front-end/src/components/Post/Poll/query.ts | 31 +- front-end/src/components/Post/Poll/votes.ts | 6 + front-end/src/components/Post/Post.tsx | 2 +- front-end/src/generated/graphql.tsx | 743 ++++++++++++++++++ front-end/src/ui-components/Card.tsx | 8 +- .../src/ui-components/OffChainSignalBar.tsx | 7 +- .../up.yaml | 14 - .../down.yaml | 6 - .../up.yaml | 20 - .../down.yaml | 2 +- .../up.yaml | 13 + .../down.yaml | 2 +- .../up.yaml | 2 +- .../down.yaml | 2 +- .../up.yaml | 2 +- .../down.yaml | 6 + .../up.yaml | 12 + .../down.yaml | 2 +- .../up.yaml | 7 +- .../down.yaml | 2 +- .../up.yaml | 7 +- .../down.yaml | 2 +- .../up.yaml | 8 +- .../down.yaml | 4 +- .../up.yaml | 16 +- 27 files changed, 915 insertions(+), 109 deletions(-) create mode 100644 front-end/src/components/Post/Poll/votes.ts delete mode 100644 hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/up.yaml delete mode 100644 hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/down.yaml delete mode 100644 hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/up.yaml rename hasura/hasura-migrations/migrations/{1589549403527_create_table_public_votes => 1589713322733_create_table_public_post_votes}/down.yaml (59%) create mode 100644 hasura/hasura-migrations/migrations/1589713322733_create_table_public_post_votes/up.yaml rename hasura/hasura-migrations/migrations/{1589550785821_add_relationship__table_public_votes => 1589713356426_add_relationship__table_public_post_votes}/down.yaml (79%) rename hasura/hasura-migrations/migrations/{1589550785821_add_relationship__table_public_votes => 1589713356426_add_relationship__table_public_post_votes}/up.yaml (86%) rename hasura/hasura-migrations/migrations/{1589549502924_table_votes_create_remote_relationship_voter => 1589713396627_table_post_votes_create_remote_relationship_voter}/down.yaml (79%) rename hasura/hasura-migrations/migrations/{1589549502924_table_votes_create_remote_relationship_voter => 1589713396627_table_post_votes_create_remote_relationship_voter}/up.yaml (90%) create mode 100644 hasura/hasura-migrations/migrations/1589713424209_add_relationship__table_public_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1589713424209_add_relationship__table_public_posts/up.yaml rename hasura/hasura-migrations/migrations/{1589549908456_update_permission_anonymous_public_table_votes => 1589713763447_update_permission_anonymous_public_table_post_votes}/down.yaml (79%) rename hasura/hasura-migrations/migrations/{1589549908456_update_permission_anonymous_public_table_votes => 1589713763447_update_permission_anonymous_public_table_post_votes}/up.yaml (77%) rename hasura/hasura-migrations/migrations/{1589550082808_update_permission_user_public_table_votes => 1589713783663_update_permission_user_public_table_post_votes}/down.yaml (78%) rename hasura/hasura-migrations/migrations/{1589550082808_update_permission_user_public_table_votes => 1589713783663_update_permission_user_public_table_post_votes}/up.yaml (77%) rename hasura/hasura-migrations/migrations/{1589550038394_update_permission_user_public_table_votes => 1589713825290_update_permission_user_public_table_post_votes}/down.yaml (78%) rename hasura/hasura-migrations/migrations/{1589550038394_update_permission_user_public_table_votes => 1589713825290_update_permission_user_public_table_post_votes}/up.yaml (72%) rename hasura/hasura-migrations/migrations/{1589550076113_apply_same_permissions_public_table_votes => 1589713857773_apply_same_permissions_public_table_post_votes}/down.yaml (78%) rename hasura/hasura-migrations/migrations/{1589550076113_apply_same_permissions_public_table_votes => 1589713857773_apply_same_permissions_public_table_post_votes}/up.yaml (74%) diff --git a/front-end/src/components/Post/Poll/OffChainSignals.tsx b/front-end/src/components/Post/Poll/OffChainSignals.tsx index e50bf8ca3..585e61bdb 100644 --- a/front-end/src/components/Post/Poll/OffChainSignals.tsx +++ b/front-end/src/components/Post/Poll/OffChainSignals.tsx @@ -3,36 +3,76 @@ // of the Apache-2.0 license. See the LICENSE file for details. import styled from '@xstyled/styled-components'; -import * as React from 'react'; +import { ApolloQueryResult } from 'apollo-client'; +import React, { useContext, useState } from 'react'; +import { UserDetailsContext } from '../../../context/UserDetailsContext'; +import { PostVotesQuery, PostVotesQueryVariables, useAddPostVoteMutation, useDeleteVoteMutation } from '../../../generated/graphql'; import AyeNayButtons from '../../../ui-components/AyeNayButtons'; import Card from '../../../ui-components/Card'; +import FilteredError from '../../../ui-components/FilteredError'; import { Form } from '../../../ui-components/Form'; import OffChainSignalBar from '../../../ui-components/OffChainSignalBar'; +import { AYE, NAY } from './votes'; interface Props { - className?: string + ayes: number, + className?: string, + nays: number, + postId: number + refetch: (variables?: PostVotesQueryVariables | undefined) => Promise> } -const CouncilSignals = ({ className }: Props) => { - const voteRefrendum = (bool: Boolean) => { - console.log(bool); +const CouncilSignals = ({ className, ayes, nays, postId, refetch }: Props) => { + const { id } = useContext(UserDetailsContext); + const [error, setErr] = useState(null); + const [addPostVoteMutation] = useAddPostVoteMutation(); + const [deleteVoteMutation] = useDeleteVoteMutation(); + + const castVote = async (vote: string) => { + if (!id) { + return; + } + + try { + await deleteVoteMutation({ + variables: { + postId, + userId: id + } + }); + + await addPostVoteMutation({ + variables: { + postId, + userId: id, + vote + } + }); + + refetch(); + } catch (error) { + setErr(error); + } }; return (
Signals are off chain.
-
+
+ {error?.message && } +
+ {id ? voteRefrendum(true)} - onClickNay={() => voteRefrendum(false)} + onClickAye={() => castVote(AYE)} + onClickNay={() => castVote(NAY)} /> - + : null}
); }; @@ -41,4 +81,8 @@ export default styled(CouncilSignals)` .info { margin: 1em 0; } + + .errorText { + color: red_secondary; + } `; diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index 345c0ea40..2939ce4a2 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -2,19 +2,43 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import * as React from 'react'; +import React from 'react'; +import { usePostVotesQuery } from '../../../generated/graphql'; +import Card from '../../../ui-components/Card'; +import FilteredError from '../../../ui-components/FilteredError'; import CouncilSignals from './CouncilSignals'; import OffChainSignals from './OffChainSignals'; +import { AYE, NAY } from './votes'; interface Props { - + postId: number } -const Poll = () => { +const Poll = ({ postId }: Props) => { + const { data, error, refetch } = usePostVotesQuery({ variables: { postId } }); + let ayes = 0; + let nays = 0; + + data?.post_votes?.forEach(vote => { + if (vote.vote === AYE) { + ayes++; + } + if (vote.vote === NAY) { + nays++; + } + }); + + if (error?.message) return ; + return ( <> - + ); diff --git a/front-end/src/components/Post/Poll/query.ts b/front-end/src/components/Post/Poll/query.ts index 36ed09c54..6422600e1 100644 --- a/front-end/src/components/Post/Poll/query.ts +++ b/front-end/src/components/Post/Poll/query.ts @@ -4,8 +4,8 @@ import gql from 'graphql-tag'; -export const votesFields = gql` - fragment votesFields on votes { +export const postVotesFields = gql` + fragment postVotesFields on post_votes { id voter { id @@ -20,26 +20,33 @@ export const votesFields = gql` `; export const QUERY_POST_VOTES = gql` - query Votes ($postId: Int!) { - votes(where: {post_id: {_eq: $postId}}) { - ...votesFields + query PostVotes ($postId: Int!) { + post_votes(where: {post_id: {_eq: $postId}}) { + ...postVotesFields } } - ${votesFields} + ${postVotesFields} `; -export const ADD_VOTE = gql` - mutation AddVote ($postId: Int!, $userId: Int!, $vote: String!) { +export const ADD_POST_VOTE = gql` + mutation AddPostVote ($postId: Int!, $userId: Int!, $vote: bpchar!) { __typename - insert_votes_one(objects: {post_id: $postId, user_id: $userId, vote: $vote}) { - affected_rows + insert_post_votes_one(object: {post_id: $postId, user_id: $userId, vote: $vote}) { + id } } `; export const DELETE_VOTE = gql` - mutation DeletePostReaction ($postId: Int!, $userId: Int!) { - delete_vote(where: {_and: [{post_id: {_eq: $postId}}, {user_id: {_eq: $userId}}}]}) { + mutation DeleteVote ($postId: Int!, $userId: Int!) { + delete_post_votes( + where: { + _and: [ + {post_id: {_eq: $postId}}, + {user_id: {_eq: $userId}} + ] + } + ) { affected_rows } } diff --git a/front-end/src/components/Post/Poll/votes.ts b/front-end/src/components/Post/Poll/votes.ts new file mode 100644 index 000000000..6c68414a9 --- /dev/null +++ b/front-end/src/components/Post/Poll/votes.ts @@ -0,0 +1,6 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +export const AYE = 'AYE'; +export const NAY = 'NAY'; diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index 7ea4fb027..bc9667b5d 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -183,7 +183,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - + ); diff --git a/front-end/src/generated/graphql.tsx b/front-end/src/generated/graphql.tsx index 91d77f60d..90ec1fe7e 100644 --- a/front-end/src/generated/graphql.tsx +++ b/front-end/src/generated/graphql.tsx @@ -615,26 +615,34 @@ export type Comment_Reactions_Insert_Input = { export type Comment_Reactions_Max_Fields = { __typename?: 'comment_reactions_max_fields', comment_id?: Maybe, + created_at?: Maybe, id?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; export type Comment_Reactions_Max_Order_By = { comment_id?: Maybe, + created_at?: Maybe, id?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; export type Comment_Reactions_Min_Fields = { __typename?: 'comment_reactions_min_fields', comment_id?: Maybe, + created_at?: Maybe, id?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; export type Comment_Reactions_Min_Order_By = { comment_id?: Maybe, + created_at?: Maybe, id?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; @@ -3001,6 +3009,8 @@ export type Mutation_Root = { delete_post_topics_by_pk?: Maybe, delete_post_types?: Maybe, delete_post_types_by_pk?: Maybe, + delete_post_votes?: Maybe, + delete_post_votes_by_pk?: Maybe, delete_posts?: Maybe, delete_posts_by_pk?: Maybe, executeRaw: Scalars['Json'], @@ -3016,6 +3026,8 @@ export type Mutation_Root = { insert_post_topics_one?: Maybe, insert_post_types?: Maybe, insert_post_types_one?: Maybe, + insert_post_votes?: Maybe, + insert_post_votes_one?: Maybe, insert_posts?: Maybe, insert_posts_one?: Maybe, login?: Maybe, @@ -3094,6 +3106,8 @@ export type Mutation_Root = { update_post_topics_by_pk?: Maybe, update_post_types?: Maybe, update_post_types_by_pk?: Maybe, + update_post_votes?: Maybe, + update_post_votes_by_pk?: Maybe, update_posts?: Maybe, update_posts_by_pk?: Maybe, upsertBlockIndex: BlockIndex, @@ -3644,6 +3658,16 @@ export type Mutation_RootDelete_Post_Types_By_PkArgs = { }; +export type Mutation_RootDelete_Post_VotesArgs = { + where: Post_Votes_Bool_Exp +}; + + +export type Mutation_RootDelete_Post_Votes_By_PkArgs = { + id: Scalars['Int'] +}; + + export type Mutation_RootDelete_PostsArgs = { where: Posts_Bool_Exp }; @@ -3732,6 +3756,18 @@ export type Mutation_RootInsert_Post_Types_OneArgs = { }; +export type Mutation_RootInsert_Post_VotesArgs = { + objects: Array, + on_conflict?: Maybe +}; + + +export type Mutation_RootInsert_Post_Votes_OneArgs = { + object: Post_Votes_Insert_Input, + on_conflict?: Maybe +}; + + export type Mutation_RootInsert_PostsArgs = { objects: Array, on_conflict?: Maybe @@ -4203,6 +4239,20 @@ export type Mutation_RootUpdate_Post_Types_By_PkArgs = { }; +export type Mutation_RootUpdate_Post_VotesArgs = { + _inc?: Maybe, + _set?: Maybe, + where: Post_Votes_Bool_Exp +}; + + +export type Mutation_RootUpdate_Post_Votes_By_PkArgs = { + _inc?: Maybe, + _set?: Maybe, + pk_columns: Post_Votes_Pk_Columns_Input +}; + + export type Mutation_RootUpdate_PostsArgs = { _inc?: Maybe, _set?: Maybe, @@ -5317,27 +5367,35 @@ export type Post_Reactions_Insert_Input = { export type Post_Reactions_Max_Fields = { __typename?: 'post_reactions_max_fields', + created_at?: Maybe, id?: Maybe, post_id?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; export type Post_Reactions_Max_Order_By = { + created_at?: Maybe, id?: Maybe, post_id?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; export type Post_Reactions_Min_Fields = { __typename?: 'post_reactions_min_fields', + created_at?: Maybe, id?: Maybe, post_id?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; export type Post_Reactions_Min_Order_By = { + created_at?: Maybe, id?: Maybe, post_id?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; @@ -5954,6 +6012,293 @@ export type Post_Types_Variance_Order_By = { id?: Maybe, }; +export type Post_Votes = { + __typename?: 'post_votes', + created_at: Scalars['timestamp'], + id: Scalars['Int'], + post: Posts, + post_id: Scalars['Int'], + updated_at: Scalars['timestamp'], + user_id: Scalars['Int'], + vote: Scalars['bpchar'], + voter?: Maybe, +}; + +export type Post_Votes_Aggregate = { + __typename?: 'post_votes_aggregate', + aggregate?: Maybe, + nodes: Array, +}; + +export type Post_Votes_Aggregate_Fields = { + __typename?: 'post_votes_aggregate_fields', + avg?: Maybe, + count?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, +}; + + +export type Post_Votes_Aggregate_FieldsCountArgs = { + columns?: Maybe>, + distinct?: Maybe +}; + +export type Post_Votes_Aggregate_Order_By = { + avg?: Maybe, + count?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, +}; + +export type Post_Votes_Arr_Rel_Insert_Input = { + data: Array, + on_conflict?: Maybe, +}; + +export type Post_Votes_Avg_Fields = { + __typename?: 'post_votes_avg_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Avg_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Bool_Exp = { + _and?: Maybe>>, + _not?: Maybe, + _or?: Maybe>>, + created_at?: Maybe, + id?: Maybe, + post?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, + vote?: Maybe, +}; + +export enum Post_Votes_Constraint { + PostVotesPkey = 'post_votes_pkey' +} + +export type Post_Votes_Inc_Input = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Insert_Input = { + created_at?: Maybe, + id?: Maybe, + post?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, + vote?: Maybe, +}; + +export type Post_Votes_Max_Fields = { + __typename?: 'post_votes_max_fields', + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Max_Order_By = { + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Min_Fields = { + __typename?: 'post_votes_min_fields', + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Min_Order_By = { + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Mutation_Response = { + __typename?: 'post_votes_mutation_response', + affected_rows: Scalars['Int'], + returning: Array, +}; + +export type Post_Votes_Obj_Rel_Insert_Input = { + data: Post_Votes_Insert_Input, + on_conflict?: Maybe, +}; + +export type Post_Votes_On_Conflict = { + constraint: Post_Votes_Constraint, + update_columns: Array, + where?: Maybe, +}; + +export type Post_Votes_Order_By = { + created_at?: Maybe, + id?: Maybe, + post?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, + vote?: Maybe, +}; + +export type Post_Votes_Pk_Columns_Input = { + id: Scalars['Int'], +}; + +export enum Post_Votes_Select_Column { + CreatedAt = 'created_at', + Id = 'id', + PostId = 'post_id', + UpdatedAt = 'updated_at', + UserId = 'user_id', + Vote = 'vote' +} + +export type Post_Votes_Set_Input = { + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, + vote?: Maybe, +}; + +export type Post_Votes_Stddev_Fields = { + __typename?: 'post_votes_stddev_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Stddev_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Stddev_Pop_Fields = { + __typename?: 'post_votes_stddev_pop_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Stddev_Pop_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Stddev_Samp_Fields = { + __typename?: 'post_votes_stddev_samp_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Stddev_Samp_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Sum_Fields = { + __typename?: 'post_votes_sum_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Sum_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export enum Post_Votes_Update_Column { + CreatedAt = 'created_at', + Id = 'id', + PostId = 'post_id', + UpdatedAt = 'updated_at', + UserId = 'user_id', + Vote = 'vote' +} + +export type Post_Votes_Var_Pop_Fields = { + __typename?: 'post_votes_var_pop_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Var_Pop_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Var_Samp_Fields = { + __typename?: 'post_votes_var_samp_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Var_Samp_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Variance_Fields = { + __typename?: 'post_votes_variance_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Votes_Variance_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + export type Posts = { __typename?: 'posts', author?: Maybe, @@ -5966,6 +6311,8 @@ export type Posts = { onchain_link?: Maybe, post_reactions: Array, post_reactions_aggregate: Post_Reactions_Aggregate, + post_votes: Array, + post_votes_aggregate: Post_Votes_Aggregate, title?: Maybe, topic: Post_Topics, topic_id: Scalars['Int'], @@ -6010,6 +6357,24 @@ export type PostsPost_Reactions_AggregateArgs = { where?: Maybe }; + +export type PostsPost_VotesArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type PostsPost_Votes_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + export type Posts_Aggregate = { __typename?: 'posts_aggregate', aggregate?: Maybe, @@ -6082,6 +6447,7 @@ export type Posts_Bool_Exp = { id?: Maybe, onchain_link?: Maybe, post_reactions?: Maybe, + post_votes?: Maybe, title?: Maybe, topic?: Maybe, topic_id?: Maybe, @@ -6109,6 +6475,7 @@ export type Posts_Insert_Input = { id?: Maybe, onchain_link?: Maybe, post_reactions?: Maybe, + post_votes?: Maybe, title?: Maybe, topic?: Maybe, topic_id?: Maybe, @@ -6188,6 +6555,7 @@ export type Posts_Order_By = { id?: Maybe, onchain_link?: Maybe, post_reactions_aggregate?: Maybe, + post_votes_aggregate?: Maybe, title?: Maybe, topic?: Maybe, topic_id?: Maybe, @@ -7857,6 +8225,9 @@ export type Query_Root = { post_types: Array, post_types_aggregate: Post_Types_Aggregate, post_types_by_pk?: Maybe, + post_votes: Array, + post_votes_aggregate: Post_Votes_Aggregate, + post_votes_by_pk?: Maybe, posts: Array, posts_aggregate: Posts_Aggregate, posts_by_pk?: Maybe, @@ -8351,6 +8722,29 @@ export type Query_RootPost_Types_By_PkArgs = { }; +export type Query_RootPost_VotesArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Query_RootPost_Votes_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Query_RootPost_Votes_By_PkArgs = { + id: Scalars['Int'] +}; + + export type Query_RootPostsArgs = { distinct_on?: Maybe>, limit?: Maybe, @@ -9856,12 +10250,23 @@ export type Subscription = { export type Subscription_Root = { __typename?: 'subscription_root', + blockIndex?: Maybe, + blockNumber?: Maybe, comment_reactions: Array, comment_reactions_aggregate: Comment_Reactions_Aggregate, comment_reactions_by_pk?: Maybe, comments: Array, comments_aggregate: Comments_Aggregate, comments_by_pk?: Maybe, + council?: Maybe, + councilMember?: Maybe, + era?: Maybe, + heartBeat?: Maybe, + motion?: Maybe, + motionProposalArgument?: Maybe, + motionStatus?: Maybe, + nomination?: Maybe, + offlineValidator?: Maybe, onchain_links: Array, onchain_links_aggregate: Onchain_Links_Aggregate, onchain_links_by_pk?: Maybe, @@ -9874,9 +10279,38 @@ export type Subscription_Root = { post_types: Array, post_types_aggregate: Post_Types_Aggregate, post_types_by_pk?: Maybe, + post_votes: Array, + post_votes_aggregate: Post_Votes_Aggregate, + post_votes_by_pk?: Maybe, posts: Array, posts_aggregate: Posts_Aggregate, posts_by_pk?: Maybe, + preimage?: Maybe, + preimageArgument?: Maybe, + preimageStatus?: Maybe, + proposal?: Maybe, + proposalStatus?: Maybe, + referendum?: Maybe, + referendumStatus?: Maybe, + reward?: Maybe, + session?: Maybe, + slashing?: Maybe, + stake?: Maybe, + subscribed?: Maybe, + totalIssuance?: Maybe, + treasurySpendProposal?: Maybe, + treasuryStatus?: Maybe, + validator?: Maybe, +}; + + +export type Subscription_RootBlockIndexArgs = { + where?: Maybe +}; + + +export type Subscription_RootBlockNumberArgs = { + where?: Maybe }; @@ -9926,6 +10360,51 @@ export type Subscription_RootComments_By_PkArgs = { }; +export type Subscription_RootCouncilArgs = { + where?: Maybe +}; + + +export type Subscription_RootCouncilMemberArgs = { + where?: Maybe +}; + + +export type Subscription_RootEraArgs = { + where?: Maybe +}; + + +export type Subscription_RootHeartBeatArgs = { + where?: Maybe +}; + + +export type Subscription_RootMotionArgs = { + where?: Maybe +}; + + +export type Subscription_RootMotionProposalArgumentArgs = { + where?: Maybe +}; + + +export type Subscription_RootMotionStatusArgs = { + where?: Maybe +}; + + +export type Subscription_RootNominationArgs = { + where?: Maybe +}; + + +export type Subscription_RootOfflineValidatorArgs = { + where?: Maybe +}; + + export type Subscription_RootOnchain_LinksArgs = { distinct_on?: Maybe>, limit?: Maybe, @@ -10018,6 +10497,29 @@ export type Subscription_RootPost_Types_By_PkArgs = { }; +export type Subscription_RootPost_VotesArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Subscription_RootPost_Votes_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Subscription_RootPost_Votes_By_PkArgs = { + id: Scalars['Int'] +}; + + export type Subscription_RootPostsArgs = { distinct_on?: Maybe>, limit?: Maybe, @@ -10041,6 +10543,81 @@ export type Subscription_RootPosts_By_PkArgs = { }; +export type Subscription_RootPreimageArgs = { + where?: Maybe +}; + + +export type Subscription_RootPreimageArgumentArgs = { + where?: Maybe +}; + + +export type Subscription_RootPreimageStatusArgs = { + where?: Maybe +}; + + +export type Subscription_RootProposalArgs = { + where?: Maybe +}; + + +export type Subscription_RootProposalStatusArgs = { + where?: Maybe +}; + + +export type Subscription_RootReferendumArgs = { + where?: Maybe +}; + + +export type Subscription_RootReferendumStatusArgs = { + where?: Maybe +}; + + +export type Subscription_RootRewardArgs = { + where?: Maybe +}; + + +export type Subscription_RootSessionArgs = { + where?: Maybe +}; + + +export type Subscription_RootSlashingArgs = { + where?: Maybe +}; + + +export type Subscription_RootStakeArgs = { + where?: Maybe +}; + + +export type Subscription_RootTotalIssuanceArgs = { + where?: Maybe +}; + + +export type Subscription_RootTreasurySpendProposalArgs = { + where?: Maybe +}; + + +export type Subscription_RootTreasuryStatusArgs = { + where?: Maybe +}; + + +export type Subscription_RootValidatorArgs = { + where?: Maybe +}; + + export type Timestamp_Comparison_Exp = { _eq?: Maybe, _gt?: Maybe, @@ -11025,6 +11602,57 @@ export type GetCouncilMembersQuery = ( )>> } ); +export type PostVotesFieldsFragment = ( + { __typename?: 'post_votes' } + & Pick + & { voter: Maybe<( + { __typename?: 'User' } + & Pick + )> } +); + +export type PostVotesQueryVariables = { + postId: Scalars['Int'] +}; + + +export type PostVotesQuery = ( + { __typename?: 'query_root' } + & { post_votes: Array<( + { __typename?: 'post_votes' } + & PostVotesFieldsFragment + )> } +); + +export type AddPostVoteMutationVariables = { + postId: Scalars['Int'], + userId: Scalars['Int'], + vote: Scalars['bpchar'] +}; + + +export type AddPostVoteMutation = ( + { __typename: 'mutation_root' } + & { insert_post_votes_one: Maybe<( + { __typename?: 'post_votes' } + & Pick + )> } +); + +export type DeleteVoteMutationVariables = { + postId: Scalars['Int'], + userId: Scalars['Int'] +}; + + +export type DeleteVoteMutation = ( + { __typename?: 'mutation_root' } + & { delete_post_votes: Maybe<( + { __typename?: 'post_votes_mutation_response' } + & Pick + )> } +); + export type EditPostMutationVariables = { id: Scalars['Int'], content: Scalars['String'], @@ -12013,6 +12641,20 @@ export type VerifyEmailMutation = ( )> } ); +export const PostVotesFieldsFragmentDoc = gql` + fragment postVotesFields on post_votes { + id + voter { + id + username + kusama_default_address + polkadot_default_address + } + vote + created_at + updated_at +} + `; export const PostReactionFieldsFragmentDoc = gql` fragment postReactionFields on post_reactions { id @@ -12552,6 +13194,107 @@ export function useGetCouncilMembersLazyQuery(baseOptions?: ApolloReactHooks.Laz export type GetCouncilMembersQueryHookResult = ReturnType; export type GetCouncilMembersLazyQueryHookResult = ReturnType; export type GetCouncilMembersQueryResult = ApolloReactCommon.QueryResult; +export const PostVotesDocument = gql` + query PostVotes($postId: Int!) { + post_votes(where: {post_id: {_eq: $postId}}) { + ...postVotesFields + } +} + ${PostVotesFieldsFragmentDoc}`; + +/** + * __usePostVotesQuery__ + * + * To run a query within a React component, call `usePostVotesQuery` and pass it any options that fit your needs. + * When your component renders, `usePostVotesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = usePostVotesQuery({ + * variables: { + * postId: // value for 'postId' + * }, + * }); + */ +export function usePostVotesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + return ApolloReactHooks.useQuery(PostVotesDocument, baseOptions); + } +export function usePostVotesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + return ApolloReactHooks.useLazyQuery(PostVotesDocument, baseOptions); + } +export type PostVotesQueryHookResult = ReturnType; +export type PostVotesLazyQueryHookResult = ReturnType; +export type PostVotesQueryResult = ApolloReactCommon.QueryResult; +export const AddPostVoteDocument = gql` + mutation AddPostVote($postId: Int!, $userId: Int!, $vote: bpchar!) { + __typename + insert_post_votes_one(object: {post_id: $postId, user_id: $userId, vote: $vote}) { + id + } +} + `; +export type AddPostVoteMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useAddPostVoteMutation__ + * + * To run a mutation, you first call `useAddPostVoteMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAddPostVoteMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [addPostVoteMutation, { data, loading, error }] = useAddPostVoteMutation({ + * variables: { + * postId: // value for 'postId' + * userId: // value for 'userId' + * vote: // value for 'vote' + * }, + * }); + */ +export function useAddPostVoteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(AddPostVoteDocument, baseOptions); + } +export type AddPostVoteMutationHookResult = ReturnType; +export type AddPostVoteMutationResult = ApolloReactCommon.MutationResult; +export type AddPostVoteMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const DeleteVoteDocument = gql` + mutation DeleteVote($postId: Int!, $userId: Int!) { + delete_post_votes(where: {_and: [{post_id: {_eq: $postId}}, {user_id: {_eq: $userId}}]}) { + affected_rows + } +} + `; +export type DeleteVoteMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useDeleteVoteMutation__ + * + * To run a mutation, you first call `useDeleteVoteMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteVoteMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [deleteVoteMutation, { data, loading, error }] = useDeleteVoteMutation({ + * variables: { + * postId: // value for 'postId' + * userId: // value for 'userId' + * }, + * }); + */ +export function useDeleteVoteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(DeleteVoteDocument, baseOptions); + } +export type DeleteVoteMutationHookResult = ReturnType; +export type DeleteVoteMutationResult = ApolloReactCommon.MutationResult; +export type DeleteVoteMutationOptions = ApolloReactCommon.BaseMutationOptions; export const EditPostDocument = gql` mutation EditPost($id: Int!, $content: String!, $title: String!) { update_posts(where: {id: {_eq: $id}}, _set: {content: $content, title: $title}) { diff --git a/front-end/src/ui-components/Card.tsx b/front-end/src/ui-components/Card.tsx index a1f60a6aa..04a949661 100644 --- a/front-end/src/ui-components/Card.tsx +++ b/front-end/src/ui-components/Card.tsx @@ -19,10 +19,10 @@ const Card = ({ className, children }:Props ) => { export default styled(Card)` background-color: white; padding: 2rem 3rem 2rem 3rem; - border-style: solid; - border-width: 1px; - border-color: grey_border; border-radius: 3px; + -webkit-box-shadow: 5px 5px 5px 0px rgba(227,227,227,1); + -moz-box-shadow: 5px 5px 5px 0px rgba(227,227,227,1); + box-shadow: 5px 5px 5px 0px rgba(227,227,227,1); margin-bottom: 1rem; @media only screen and (max-width: 768px) { padding: 2rem; @@ -38,4 +38,4 @@ export default styled(Card)` .ui.divided.grid:not([class*="vertically divided"])>.row>.column { box-shadow: none; } -`; \ No newline at end of file +`; diff --git a/front-end/src/ui-components/OffChainSignalBar.tsx b/front-end/src/ui-components/OffChainSignalBar.tsx index 1a7fd0b84..ffcb68636 100644 --- a/front-end/src/ui-components/OffChainSignalBar.tsx +++ b/front-end/src/ui-components/OffChainSignalBar.tsx @@ -14,6 +14,11 @@ interface Props { } const OffChainSignalBar = ({ ayeSignals, className, naySignals }: Props) => { + let percent = 0; + const total = ayeSignals + naySignals; + if (total > 0) { + percent = ayeSignals/total*100; + } return (
@@ -21,7 +26,7 @@ const OffChainSignalBar = ({ ayeSignals, className, naySignals }: Props) => {
{naySignals === 1 ? '1 Nay' : `${naySignals} Nays`}
); diff --git a/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/up.yaml b/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/up.yaml deleted file mode 100644 index c541a3411..000000000 --- a/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/up.yaml +++ /dev/null @@ -1,14 +0,0 @@ -- args: - cascade: false - read_only: false - sql: CREATE TABLE "public"."votes"("id" serial NOT NULL, "post_id" integer NOT - NULL, "user_id" integer NOT NULL, "address" bpchar NOT NULL, "amount" integer - NOT NULL, "vote" bpchar NOT NULL, "created_at" timestamp NOT NULL DEFAULT now(), - "updated_at" timestamp NOT NULL DEFAULT now(), PRIMARY KEY ("id") , FOREIGN - KEY ("post_id") REFERENCES "public"."posts"("id") ON UPDATE restrict ON DELETE - restrict, UNIQUE ("id")); - type: run_sql -- args: - name: votes - schema: public - type: add_existing_table_or_view diff --git a/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/down.yaml deleted file mode 100644 index bea23bd23..000000000 --- a/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/down.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - role: proposal_bot - table: - name: votes - schema: public - type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/up.yaml deleted file mode 100644 index ef1cce9af..000000000 --- a/hasura/hasura-migrations/migrations/1589549939612_update_permission_proposal_bot_public_table_votes/up.yaml +++ /dev/null @@ -1,20 +0,0 @@ -- args: - permission: - allow_aggregations: false - columns: - - address - - vote - - amount - - id - - post_id - - user_id - - created_at - - updated_at - computed_fields: [] - filter: {} - limit: null - role: proposal_bot - table: - name: votes - schema: public - type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/down.yaml b/hasura/hasura-migrations/migrations/1589713322733_create_table_public_post_votes/down.yaml similarity index 59% rename from hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/down.yaml rename to hasura/hasura-migrations/migrations/1589713322733_create_table_public_post_votes/down.yaml index dc86ba407..6aebbbd4a 100644 --- a/hasura/hasura-migrations/migrations/1589549403527_create_table_public_votes/down.yaml +++ b/hasura/hasura-migrations/migrations/1589713322733_create_table_public_post_votes/down.yaml @@ -1,5 +1,5 @@ - args: cascade: false read_only: false - sql: DROP TABLE "public"."votes"; + sql: DROP TABLE "public"."post_votes"; type: run_sql diff --git a/hasura/hasura-migrations/migrations/1589713322733_create_table_public_post_votes/up.yaml b/hasura/hasura-migrations/migrations/1589713322733_create_table_public_post_votes/up.yaml new file mode 100644 index 000000000..bb6f3fd8d --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589713322733_create_table_public_post_votes/up.yaml @@ -0,0 +1,13 @@ +- args: + cascade: false + read_only: false + sql: CREATE TABLE "public"."post_votes"("id" serial NOT NULL, "post_id" integer + NOT NULL, "user_id" integer NOT NULL, "vote" bpchar NOT NULL, "created_at" timestamp + NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), PRIMARY + KEY ("id") , FOREIGN KEY ("post_id") REFERENCES "public"."posts"("id") ON UPDATE + restrict ON DELETE restrict, UNIQUE ("id")); + type: run_sql +- args: + name: post_votes + schema: public + type: add_existing_table_or_view diff --git a/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/down.yaml b/hasura/hasura-migrations/migrations/1589713356426_add_relationship__table_public_post_votes/down.yaml similarity index 79% rename from hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/down.yaml rename to hasura/hasura-migrations/migrations/1589713356426_add_relationship__table_public_post_votes/down.yaml index 5ce9596d2..20dc0635a 100644 --- a/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/down.yaml +++ b/hasura/hasura-migrations/migrations/1589713356426_add_relationship__table_public_post_votes/down.yaml @@ -1,6 +1,6 @@ - args: relationship: post table: - name: votes + name: post_votes schema: public type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/up.yaml b/hasura/hasura-migrations/migrations/1589713356426_add_relationship__table_public_post_votes/up.yaml similarity index 86% rename from hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/up.yaml rename to hasura/hasura-migrations/migrations/1589713356426_add_relationship__table_public_post_votes/up.yaml index de0b30564..7eb8f62e4 100644 --- a/hasura/hasura-migrations/migrations/1589550785821_add_relationship__table_public_votes/up.yaml +++ b/hasura/hasura-migrations/migrations/1589713356426_add_relationship__table_public_post_votes/up.yaml @@ -1,7 +1,7 @@ - args: name: post table: - name: votes + name: post_votes schema: public using: foreign_key_constraint_on: post_id diff --git a/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/down.yaml b/hasura/hasura-migrations/migrations/1589713396627_table_post_votes_create_remote_relationship_voter/down.yaml similarity index 79% rename from hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/down.yaml rename to hasura/hasura-migrations/migrations/1589713396627_table_post_votes_create_remote_relationship_voter/down.yaml index 19f96cb20..1aa7b02eb 100644 --- a/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/down.yaml +++ b/hasura/hasura-migrations/migrations/1589713396627_table_post_votes_create_remote_relationship_voter/down.yaml @@ -1,6 +1,6 @@ - args: name: voter table: - name: votes + name: post_votes schema: public type: delete_remote_relationship diff --git a/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/up.yaml b/hasura/hasura-migrations/migrations/1589713396627_table_post_votes_create_remote_relationship_voter/up.yaml similarity index 90% rename from hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/up.yaml rename to hasura/hasura-migrations/migrations/1589713396627_table_post_votes_create_remote_relationship_voter/up.yaml index 431e449d6..941d9c8ab 100644 --- a/hasura/hasura-migrations/migrations/1589549502924_table_votes_create_remote_relationship_voter/up.yaml +++ b/hasura/hasura-migrations/migrations/1589713396627_table_post_votes_create_remote_relationship_voter/up.yaml @@ -8,6 +8,6 @@ id: $user_id remote_schema: auth table: - name: votes + name: post_votes schema: public type: create_remote_relationship diff --git a/hasura/hasura-migrations/migrations/1589713424209_add_relationship__table_public_posts/down.yaml b/hasura/hasura-migrations/migrations/1589713424209_add_relationship__table_public_posts/down.yaml new file mode 100644 index 000000000..a47e326ca --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589713424209_add_relationship__table_public_posts/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: post_votes + table: + name: posts + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1589713424209_add_relationship__table_public_posts/up.yaml b/hasura/hasura-migrations/migrations/1589713424209_add_relationship__table_public_posts/up.yaml new file mode 100644 index 000000000..4b4f19249 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1589713424209_add_relationship__table_public_posts/up.yaml @@ -0,0 +1,12 @@ +- args: + name: post_votes + table: + name: posts + schema: public + using: + foreign_key_constraint_on: + column: post_id + table: + name: post_votes + schema: public + type: create_array_relationship diff --git a/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589713763447_update_permission_anonymous_public_table_post_votes/down.yaml similarity index 79% rename from hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/down.yaml rename to hasura/hasura-migrations/migrations/1589713763447_update_permission_anonymous_public_table_post_votes/down.yaml index 4bbe3384e..080430470 100644 --- a/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/down.yaml +++ b/hasura/hasura-migrations/migrations/1589713763447_update_permission_anonymous_public_table_post_votes/down.yaml @@ -1,6 +1,6 @@ - args: role: anonymous table: - name: votes + name: post_votes schema: public type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589713763447_update_permission_anonymous_public_table_post_votes/up.yaml similarity index 77% rename from hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/up.yaml rename to hasura/hasura-migrations/migrations/1589713763447_update_permission_anonymous_public_table_post_votes/up.yaml index d15861323..6e47930d5 100644 --- a/hasura/hasura-migrations/migrations/1589549908456_update_permission_anonymous_public_table_votes/up.yaml +++ b/hasura/hasura-migrations/migrations/1589713763447_update_permission_anonymous_public_table_post_votes/up.yaml @@ -1,12 +1,11 @@ - args: permission: - allow_aggregations: false + allow_aggregations: true + backend_only: false columns: - id - post_id - user_id - - address - - amount - vote - created_at - updated_at @@ -15,6 +14,6 @@ limit: null role: anonymous table: - name: votes + name: post_votes schema: public type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589713783663_update_permission_user_public_table_post_votes/down.yaml similarity index 78% rename from hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/down.yaml rename to hasura/hasura-migrations/migrations/1589713783663_update_permission_user_public_table_post_votes/down.yaml index 1a201f45d..861d68ca9 100644 --- a/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/down.yaml +++ b/hasura/hasura-migrations/migrations/1589713783663_update_permission_user_public_table_post_votes/down.yaml @@ -1,6 +1,6 @@ - args: role: user table: - name: votes + name: post_votes schema: public type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589713783663_update_permission_user_public_table_post_votes/up.yaml similarity index 77% rename from hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/up.yaml rename to hasura/hasura-migrations/migrations/1589713783663_update_permission_user_public_table_post_votes/up.yaml index 1c833afbf..939316f90 100644 --- a/hasura/hasura-migrations/migrations/1589550082808_update_permission_user_public_table_votes/up.yaml +++ b/hasura/hasura-migrations/migrations/1589713783663_update_permission_user_public_table_post_votes/up.yaml @@ -1,10 +1,9 @@ - args: permission: - allow_aggregations: false + allow_aggregations: true + backend_only: false columns: - - address - vote - - amount - id - post_id - user_id @@ -15,6 +14,6 @@ limit: null role: user table: - name: votes + name: post_votes schema: public type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589713825290_update_permission_user_public_table_post_votes/down.yaml similarity index 78% rename from hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/down.yaml rename to hasura/hasura-migrations/migrations/1589713825290_update_permission_user_public_table_post_votes/down.yaml index c2ab30ecd..ed01bddd6 100644 --- a/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/down.yaml +++ b/hasura/hasura-migrations/migrations/1589713825290_update_permission_user_public_table_post_votes/down.yaml @@ -1,6 +1,6 @@ - args: role: user table: - name: votes + name: post_votes schema: public type: drop_insert_permission diff --git a/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589713825290_update_permission_user_public_table_post_votes/up.yaml similarity index 72% rename from hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/up.yaml rename to hasura/hasura-migrations/migrations/1589713825290_update_permission_user_public_table_post_votes/up.yaml index bef266e96..60f45927e 100644 --- a/hasura/hasura-migrations/migrations/1589550038394_update_permission_user_public_table_votes/up.yaml +++ b/hasura/hasura-migrations/migrations/1589713825290_update_permission_user_public_table_post_votes/up.yaml @@ -1,21 +1,17 @@ - args: permission: allow_upsert: true + backend_only: false check: user_id: _eq: X-Hasura-User-Id columns: - - address - - amount - post_id - user_id - vote - localPresets: - - key: "" - value: "" set: {} role: user table: - name: votes + name: post_votes schema: public type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/down.yaml b/hasura/hasura-migrations/migrations/1589713857773_apply_same_permissions_public_table_post_votes/down.yaml similarity index 78% rename from hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/down.yaml rename to hasura/hasura-migrations/migrations/1589713857773_apply_same_permissions_public_table_post_votes/down.yaml index 367f4fb9a..e494a2aea 100644 --- a/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/down.yaml +++ b/hasura/hasura-migrations/migrations/1589713857773_apply_same_permissions_public_table_post_votes/down.yaml @@ -1,12 +1,12 @@ - args: role: user table: - name: votes + name: post_votes schema: public type: drop_delete_permission - args: role: user table: - name: votes + name: post_votes schema: public type: drop_update_permission diff --git a/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/up.yaml b/hasura/hasura-migrations/migrations/1589713857773_apply_same_permissions_public_table_post_votes/up.yaml similarity index 74% rename from hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/up.yaml rename to hasura/hasura-migrations/migrations/1589713857773_apply_same_permissions_public_table_post_votes/up.yaml index 0e2e2c040..8f358a47c 100644 --- a/hasura/hasura-migrations/migrations/1589550076113_apply_same_permissions_public_table_votes/up.yaml +++ b/hasura/hasura-migrations/migrations/1589713857773_apply_same_permissions_public_table_post_votes/up.yaml @@ -1,46 +1,38 @@ - args: permission: + backend_only: false check: user_id: _eq: X-Hasura-User-Id columns: - - address - - amount - post_id - user_id - vote filter: user_id: _eq: X-Hasura-User-Id - localPresets: - - key: "" - value: "" set: {} role: user table: - name: votes + name: post_votes schema: public type: create_update_permission - args: permission: + backend_only: false check: user_id: _eq: X-Hasura-User-Id columns: - - address - - amount - post_id - user_id - vote filter: user_id: _eq: X-Hasura-User-Id - localPresets: - - key: "" - value: "" set: {} role: user table: - name: votes + name: post_votes schema: public type: create_delete_permission From 89c0489eec811b101899271bf963ebf83bb28293 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Sun, 17 May 2020 19:48:15 +0530 Subject: [PATCH 06/62] Everything works --- .../components/Post/Poll/CouncilSignals.tsx | 96 ++++++++++++++++--- front-end/src/components/Post/Poll/index.tsx | 2 +- front-end/src/types.ts | 5 + 3 files changed, 88 insertions(+), 15 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index c35f7bcea..74e34946a 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -2,43 +2,111 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { DeriveElectionsInfo } from '@polkadot/api-derive/types'; +import { ApiPromiseContext } from '@substrate/context'; import styled from '@xstyled/styled-components'; -import * as React from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { Grid, Icon } from 'semantic-ui-react'; +import { PostVotesQuery } from '../../../generated/graphql'; +import { network } from '../../../global/networkConstants'; +import { OffchainVote } from '../../../types'; import Address from '../../../ui-components/Address'; import Card from '../../../ui-components/Card'; import CouncilSignalBar from '../../../ui-components/CouncilSignalBar'; +import getEncodedAddress from '../../../util/getEncodedAddress'; +import getNetwork from '../../../util/getNetwork'; +import { AYE, NAY } from './votes'; interface Props { className?: string + data?: PostVotesQuery | undefined } -const CouncilSignals = ({ className }: Props) => { - const addresses = [ - 'HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F', - 'FoQJpPyadYccjavVdTWxpxU7rUEaYhfLCPwXgkfD6Zat9QP', - 'JKspFU6ohf1Grg3Phdzj2pSgWvsYWzSfKghhfzMbdhNBWs5', - 'Fr4NzY1udSFFLzb2R3qxVQkwz9cZraWkyfH4h3mVVk7BK7P' - ]; +const CouncilSignals = ({ className, data }: Props) => { + const [ayes, setAyes] = useState(0); + const [nays, setNays] = useState(0); + const [councilVotes, setCouncilVotes] = useState([]); + const { api, isApiReady } = useContext(ApiPromiseContext); + + useEffect(() => { + + if (!isApiReady){ + return; + } + + let unsubscribe: () => void; + + api.derive.elections.info((info: DeriveElectionsInfo) => { + const memberMap: { [address: string]: boolean } = {}; + const currentNetwork = getNetwork(); + + info?.members.map(([accountId]) => { + const address = getEncodedAddress(accountId.toString()) || ''; + memberMap[address] = true; + }); + + let ayes = 0; + let nays = 0; + const councilVotes: OffchainVote[] = []; + + console.log(memberMap); + console.log(data?.post_votes); + + data?.post_votes?.forEach(vote => { + let defaultAddress = ''; + + if (currentNetwork === network.KUSAMA) { + defaultAddress = vote.voter?.kusama_default_address || ''; + } + + if (currentNetwork === network.POLKADOT) { + defaultAddress = vote.voter?.polkadot_default_address || ''; + } + + if (memberMap[defaultAddress]) { + councilVotes.push({ + address: defaultAddress, + vote: vote.vote + }); + + if (vote.vote === AYE) { + ayes++; + } + + if (vote.vote === NAY) { + nays++; + } + } + }); + + setAyes(ayes); + setNays(nays); + setCouncilVotes(councilVotes); + }) + .then(unsub => { unsubscribe = unsub; }) + .catch(e => console.error(e)); + + return () => unsubscribe && unsubscribe(); + }, [api, isApiReady, data]); return (

Council Signals

- {addresses.map(address => - + {councilVotes.map(councilVote => +
-
+
- {address === 'HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F' ? <> + {councilVote.vote === AYE ? <>
diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index 2939ce4a2..44f05767f 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -39,7 +39,7 @@ const Poll = ({ postId }: Props) => { postId={postId} refetch={refetch} /> - + ); }; diff --git a/front-end/src/types.ts b/front-end/src/types.ts index 708af43ff..054067ebf 100644 --- a/front-end/src/types.ts +++ b/front-end/src/types.ts @@ -133,3 +133,8 @@ export enum VoteThresholdEnum { } export type VoteThreshold = keyof typeof VoteThresholdEnum; + +export interface OffchainVote { + address: string; + vote: 'AYE' | 'NAY' +} From f3c68c0fb230f088a6334732567b317a32e015a5 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Sun, 17 May 2020 19:58:03 +0530 Subject: [PATCH 07/62] onchain only --- front-end/src/components/Post/Post.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index bc9667b5d..004a422b0 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -183,7 +183,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - + {onchainId ? : null}
); From 80b24abc41277426b698160951f525a15a5ba5a2 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Sun, 17 May 2020 20:02:24 +0530 Subject: [PATCH 08/62] removed console --- front-end/src/components/Post/Poll/CouncilSignals.tsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 74e34946a..2a8583ddd 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -50,9 +50,6 @@ const CouncilSignals = ({ className, data }: Props) => { let nays = 0; const councilVotes: OffchainVote[] = []; - console.log(memberMap); - console.log(data?.post_votes); - data?.post_votes?.forEach(vote => { let defaultAddress = ''; From 5a386016e6d92ec5eacbcf7a46f666ecbbb5e02f Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 18 May 2020 19:50:24 +0530 Subject: [PATCH 09/62] using default address field --- .../src/components/Post/Poll/CouncilSignals.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 2a8583ddd..455fb4462 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -9,13 +9,12 @@ import React, { useContext, useEffect, useState } from 'react'; import { Grid, Icon } from 'semantic-ui-react'; import { PostVotesQuery } from '../../../generated/graphql'; -import { network } from '../../../global/networkConstants'; import { OffchainVote } from '../../../types'; import Address from '../../../ui-components/Address'; import Card from '../../../ui-components/Card'; import CouncilSignalBar from '../../../ui-components/CouncilSignalBar'; +import getDefaultAddressField from '../../../util/getDefaultAddressField'; import getEncodedAddress from '../../../util/getEncodedAddress'; -import getNetwork from '../../../util/getNetwork'; import { AYE, NAY } from './votes'; interface Props { @@ -39,7 +38,6 @@ const CouncilSignals = ({ className, data }: Props) => { api.derive.elections.info((info: DeriveElectionsInfo) => { const memberMap: { [address: string]: boolean } = {}; - const currentNetwork = getNetwork(); info?.members.map(([accountId]) => { const address = getEncodedAddress(accountId.toString()) || ''; @@ -48,18 +46,11 @@ const CouncilSignals = ({ className, data }: Props) => { let ayes = 0; let nays = 0; + const defaultAddressField = getDefaultAddressField(); const councilVotes: OffchainVote[] = []; data?.post_votes?.forEach(vote => { - let defaultAddress = ''; - - if (currentNetwork === network.KUSAMA) { - defaultAddress = vote.voter?.kusama_default_address || ''; - } - - if (currentNetwork === network.POLKADOT) { - defaultAddress = vote.voter?.polkadot_default_address || ''; - } + const defaultAddress = vote.voter?.[defaultAddressField] || ''; if (memberMap[defaultAddress]) { councilVotes.push({ From ccabda6b9a51635871ce53359dc71614448cd739 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 18 May 2020 19:52:26 +0530 Subject: [PATCH 10/62] removed span --- front-end/src/components/Post/Poll/CouncilSignals.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 455fb4462..c24195f6d 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -97,13 +97,11 @@ const CouncilSignals = ({ className, data }: Props) => { {councilVote.vote === AYE ? <>
-
- Aye +
Aye : <>
-
- Nay +
Nay } From d8f156fd45a4d9ab8f6e48939071ebb5278619cb Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 08:38:17 +0530 Subject: [PATCH 11/62] Split useEffect --- .../components/Post/Poll/CouncilSignals.tsx | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index c24195f6d..4558b0439 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -25,11 +25,11 @@ interface Props { const CouncilSignals = ({ className, data }: Props) => { const [ayes, setAyes] = useState(0); const [nays, setNays] = useState(0); + const [memberSet, setMemberSet] = useState>(new Set()); const [councilVotes, setCouncilVotes] = useState([]); const { api, isApiReady } = useContext(ApiPromiseContext); useEffect(() => { - if (!isApiReady){ return; } @@ -37,46 +37,50 @@ const CouncilSignals = ({ className, data }: Props) => { let unsubscribe: () => void; api.derive.elections.info((info: DeriveElectionsInfo) => { - const memberMap: { [address: string]: boolean } = {}; + const memberSet = new Set(); info?.members.map(([accountId]) => { const address = getEncodedAddress(accountId.toString()) || ''; - memberMap[address] = true; - }); - - let ayes = 0; - let nays = 0; - const defaultAddressField = getDefaultAddressField(); - const councilVotes: OffchainVote[] = []; - - data?.post_votes?.forEach(vote => { - const defaultAddress = vote.voter?.[defaultAddressField] || ''; - - if (memberMap[defaultAddress]) { - councilVotes.push({ - address: defaultAddress, - vote: vote.vote - }); - - if (vote.vote === AYE) { - ayes++; - } - - if (vote.vote === NAY) { - nays++; - } - } + memberSet.add(address); }); - setAyes(ayes); - setNays(nays); - setCouncilVotes(councilVotes); + setMemberSet(memberSet); }) .then(unsub => { unsubscribe = unsub; }) .catch(e => console.error(e)); return () => unsubscribe && unsubscribe(); - }, [api, isApiReady, data]); + }, [api, isApiReady]); + + useEffect(() => { + let ayes = 0; + let nays = 0; + const defaultAddressField = getDefaultAddressField(); + const councilVotes: OffchainVote[] = []; + + data?.post_votes?.forEach(vote => { + const defaultAddress = vote.voter?.[defaultAddressField] || ''; + + if (memberSet.has(defaultAddress)) { + councilVotes.push({ + address: defaultAddress, + vote: vote.vote + }); + + if (vote.vote === AYE) { + ayes++; + } + + if (vote.vote === NAY) { + nays++; + } + } + }); + + setAyes(ayes); + setNays(nays); + setCouncilVotes(councilVotes); + }, [data, memberSet]); return ( From 6b77498ac20dbca4be705d0edec1b8a70023f5d4 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 08:42:14 +0530 Subject: [PATCH 12/62] Using encoded address --- .../src/components/Post/Poll/CouncilSignals.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 4558b0439..0871ffdd8 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -62,10 +62,13 @@ const CouncilSignals = ({ className, data }: Props) => { const defaultAddress = vote.voter?.[defaultAddressField] || ''; if (memberSet.has(defaultAddress)) { - councilVotes.push({ - address: defaultAddress, - vote: vote.vote - }); + const address = getEncodedAddress(defaultAddress); + if (address) { + councilVotes.push({ + address, + vote: vote.vote + }); + } if (vote.vote === AYE) { ayes++; @@ -94,7 +97,7 @@ const CouncilSignals = ({ className, data }: Props) => {
-
+
From febe898ee14464818ced0dce81642413cd9bfa09 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 08:43:33 +0530 Subject: [PATCH 13/62] && instead of ? --- front-end/src/components/Post/Poll/OffChainSignals.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front-end/src/components/Post/Poll/OffChainSignals.tsx b/front-end/src/components/Post/Poll/OffChainSignals.tsx index 585e61bdb..ab4aad425 100644 --- a/front-end/src/components/Post/Poll/OffChainSignals.tsx +++ b/front-end/src/components/Post/Poll/OffChainSignals.tsx @@ -66,13 +66,13 @@ const CouncilSignals = ({ className, ayes, nays, postId, refetch }: Props) => {
{error?.message && }
- {id ?
+ {id && castVote(AYE)} onClickNay={() => castVote(NAY)} /> - : null} + }
); }; From c8d3ee17b9eb76ca53d180f492f343f4fb4ed466 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 08:53:08 +0530 Subject: [PATCH 14/62] Using use callback --- .../src/components/Post/Poll/OffChainSignals.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/front-end/src/components/Post/Poll/OffChainSignals.tsx b/front-end/src/components/Post/Poll/OffChainSignals.tsx index ab4aad425..328ef1d24 100644 --- a/front-end/src/components/Post/Poll/OffChainSignals.tsx +++ b/front-end/src/components/Post/Poll/OffChainSignals.tsx @@ -4,7 +4,7 @@ import styled from '@xstyled/styled-components'; import { ApolloQueryResult } from 'apollo-client'; -import React, { useContext, useState } from 'react'; +import React, { useCallback, useContext, useState } from 'react'; import { UserDetailsContext } from '../../../context/UserDetailsContext'; import { PostVotesQuery, PostVotesQueryVariables, useAddPostVoteMutation, useDeleteVoteMutation } from '../../../generated/graphql'; @@ -29,32 +29,32 @@ const CouncilSignals = ({ className, ayes, nays, postId, refetch }: Props) => { const [addPostVoteMutation] = useAddPostVoteMutation(); const [deleteVoteMutation] = useDeleteVoteMutation(); - const castVote = async (vote: string) => { + const castVote = useCallback((vote: string) => { if (!id) { return; } try { - await deleteVoteMutation({ + deleteVoteMutation({ variables: { postId, userId: id } - }); + }).catch(console.error); - await addPostVoteMutation({ + addPostVoteMutation({ variables: { postId, userId: id, vote } - }); + }).catch(console.error); refetch(); } catch (error) { setErr(error); } - }; + }, [id, addPostVoteMutation, deleteVoteMutation, postId, refetch]); return ( From 0d8c981c9729f8b34fb12f563139c282452aa374 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 08:54:50 +0530 Subject: [PATCH 15/62] Box shadow --- front-end/src/ui-components/Card.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/front-end/src/ui-components/Card.tsx b/front-end/src/ui-components/Card.tsx index 04a949661..f25856c93 100644 --- a/front-end/src/ui-components/Card.tsx +++ b/front-end/src/ui-components/Card.tsx @@ -20,9 +20,7 @@ export default styled(Card)` background-color: white; padding: 2rem 3rem 2rem 3rem; border-radius: 3px; - -webkit-box-shadow: 5px 5px 5px 0px rgba(227,227,227,1); - -moz-box-shadow: 5px 5px 5px 0px rgba(227,227,227,1); - box-shadow: 5px 5px 5px 0px rgba(227,227,227,1); + box-shadow: box_shadow_secondary_grey; margin-bottom: 1rem; @media only screen and (max-width: 768px) { padding: 2rem; From 004af734ed0f2f452a773f796edf173debcc730c Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 08:57:12 +0530 Subject: [PATCH 16/62] conditional component dispaly --- front-end/src/components/Post/Post.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index 590107fe9..5de49623b 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -183,7 +183,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {onchainId ? : null} + {onchainId && } ); @@ -234,4 +234,4 @@ export default styled(Post)` visibility: hidden; } } -`; \ No newline at end of file +`; From 54198603945c527247002a70d47031e8968d5d17 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 09:00:02 +0530 Subject: [PATCH 17/62] comment --- front-end/src/components/Post/Post.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index 5de49623b..2431fb40d 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -183,6 +183,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> + {/* Showing Poll for only onchain posts */} {onchainId && } From dc3c4d9e45478124cc2ba1935edecee461801f9c Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 09:08:15 +0530 Subject: [PATCH 18/62] Using enum --- .../src/components/Post/Poll/CouncilSignals.tsx | 15 +++++++-------- .../src/components/Post/Poll/OffChainSignals.tsx | 8 ++++---- front-end/src/components/Post/Poll/index.tsx | 8 ++++---- front-end/src/components/Post/Poll/votes.ts | 6 ------ front-end/src/types.ts | 7 ++++++- 5 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 front-end/src/components/Post/Poll/votes.ts diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 0871ffdd8..b4e48b27b 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -9,13 +9,12 @@ import React, { useContext, useEffect, useState } from 'react'; import { Grid, Icon } from 'semantic-ui-react'; import { PostVotesQuery } from '../../../generated/graphql'; -import { OffchainVote } from '../../../types'; +import { OffchainVote, Vote } from '../../../types'; import Address from '../../../ui-components/Address'; import Card from '../../../ui-components/Card'; import CouncilSignalBar from '../../../ui-components/CouncilSignalBar'; import getDefaultAddressField from '../../../util/getDefaultAddressField'; import getEncodedAddress from '../../../util/getEncodedAddress'; -import { AYE, NAY } from './votes'; interface Props { className?: string @@ -58,23 +57,23 @@ const CouncilSignals = ({ className, data }: Props) => { const defaultAddressField = getDefaultAddressField(); const councilVotes: OffchainVote[] = []; - data?.post_votes?.forEach(vote => { - const defaultAddress = vote.voter?.[defaultAddressField] || ''; + data?.post_votes?.forEach(({ vote, voter }) => { + const defaultAddress = voter?.[defaultAddressField] || ''; if (memberSet.has(defaultAddress)) { const address = getEncodedAddress(defaultAddress); if (address) { councilVotes.push({ address, - vote: vote.vote + vote }); } - if (vote.vote === AYE) { + if (vote === Vote.AYE) { ayes++; } - if (vote.vote === NAY) { + if (vote === Vote.NAY) { nays++; } } @@ -101,7 +100,7 @@ const CouncilSignals = ({ className, data }: Props) => {
- {councilVote.vote === AYE ? <> + {councilVote.vote === Vote.AYE ? <>
Aye diff --git a/front-end/src/components/Post/Poll/OffChainSignals.tsx b/front-end/src/components/Post/Poll/OffChainSignals.tsx index 328ef1d24..369317985 100644 --- a/front-end/src/components/Post/Poll/OffChainSignals.tsx +++ b/front-end/src/components/Post/Poll/OffChainSignals.tsx @@ -8,12 +8,12 @@ import React, { useCallback, useContext, useState } from 'react'; import { UserDetailsContext } from '../../../context/UserDetailsContext'; import { PostVotesQuery, PostVotesQueryVariables, useAddPostVoteMutation, useDeleteVoteMutation } from '../../../generated/graphql'; +import { Vote } from '../../../types'; import AyeNayButtons from '../../../ui-components/AyeNayButtons'; import Card from '../../../ui-components/Card'; import FilteredError from '../../../ui-components/FilteredError'; import { Form } from '../../../ui-components/Form'; import OffChainSignalBar from '../../../ui-components/OffChainSignalBar'; -import { AYE, NAY } from './votes'; interface Props { ayes: number, @@ -29,7 +29,7 @@ const CouncilSignals = ({ className, ayes, nays, postId, refetch }: Props) => { const [addPostVoteMutation] = useAddPostVoteMutation(); const [deleteVoteMutation] = useDeleteVoteMutation(); - const castVote = useCallback((vote: string) => { + const castVote = useCallback((vote: Vote) => { if (!id) { return; } @@ -69,8 +69,8 @@ const CouncilSignals = ({ className, ayes, nays, postId, refetch }: Props) => { {id &&
castVote(AYE)} - onClickNay={() => castVote(NAY)} + onClickAye={() => castVote(Vote.AYE)} + onClickNay={() => castVote(Vote.NAY)} /> } diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index 44f05767f..8d0d233b3 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -5,11 +5,11 @@ import React from 'react'; import { usePostVotesQuery } from '../../../generated/graphql'; +import { Vote } from '../../../types'; import Card from '../../../ui-components/Card'; import FilteredError from '../../../ui-components/FilteredError'; import CouncilSignals from './CouncilSignals'; import OffChainSignals from './OffChainSignals'; -import { AYE, NAY } from './votes'; interface Props { postId: number @@ -20,11 +20,11 @@ const Poll = ({ postId }: Props) => { let ayes = 0; let nays = 0; - data?.post_votes?.forEach(vote => { - if (vote.vote === AYE) { + data?.post_votes?.forEach(({ vote }) => { + if (vote === Vote.AYE) { ayes++; } - if (vote.vote === NAY) { + if (vote === Vote.NAY) { nays++; } }); diff --git a/front-end/src/components/Post/Poll/votes.ts b/front-end/src/components/Post/Poll/votes.ts deleted file mode 100644 index 6c68414a9..000000000 --- a/front-end/src/components/Post/Poll/votes.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2019-2020 @paritytech/polkassembly authors & contributors -// This software may be modified and distributed under the terms -// of the Apache-2.0 license. See the LICENSE file for details. - -export const AYE = 'AYE'; -export const NAY = 'NAY'; diff --git a/front-end/src/types.ts b/front-end/src/types.ts index 054067ebf..6ff4ef952 100644 --- a/front-end/src/types.ts +++ b/front-end/src/types.ts @@ -134,7 +134,12 @@ export enum VoteThresholdEnum { export type VoteThreshold = keyof typeof VoteThresholdEnum; +export enum Vote { + AYE = 'AYE', + NAY = 'NAY' +} + export interface OffchainVote { address: string; - vote: 'AYE' | 'NAY' + vote: Vote; } From f646b36bfff6353aca6a11951c97c77aa6148531 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 13:25:45 +0530 Subject: [PATCH 19/62] Added own vote --- .../components/Post/Poll/OffChainSignals.tsx | 59 +++++++++++++++---- front-end/src/components/Post/Poll/index.tsx | 11 +++- 2 files changed, 55 insertions(+), 15 deletions(-) diff --git a/front-end/src/components/Post/Poll/OffChainSignals.tsx b/front-end/src/components/Post/Poll/OffChainSignals.tsx index 369317985..e51e48c6c 100644 --- a/front-end/src/components/Post/Poll/OffChainSignals.tsx +++ b/front-end/src/components/Post/Poll/OffChainSignals.tsx @@ -10,6 +10,7 @@ import { UserDetailsContext } from '../../../context/UserDetailsContext'; import { PostVotesQuery, PostVotesQueryVariables, useAddPostVoteMutation, useDeleteVoteMutation } from '../../../generated/graphql'; import { Vote } from '../../../types'; import AyeNayButtons from '../../../ui-components/AyeNayButtons'; +import Button from '../../../ui-components/Button'; import Card from '../../../ui-components/Card'; import FilteredError from '../../../ui-components/FilteredError'; import { Form } from '../../../ui-components/Form'; @@ -18,31 +19,44 @@ import OffChainSignalBar from '../../../ui-components/OffChainSignalBar'; interface Props { ayes: number, className?: string, + ownVote?: Vote | null, nays: number, postId: number refetch: (variables?: PostVotesQueryVariables | undefined) => Promise> } -const CouncilSignals = ({ className, ayes, nays, postId, refetch }: Props) => { +const CouncilSignals = ({ className, ayes, ownVote, nays, postId, refetch }: Props) => { const { id } = useContext(UserDetailsContext); const [error, setErr] = useState(null); const [addPostVoteMutation] = useAddPostVoteMutation(); const [deleteVoteMutation] = useDeleteVoteMutation(); - const castVote = useCallback((vote: Vote) => { + const cancelVote = useCallback(async () => { if (!id) { return; } try { - deleteVoteMutation({ + await deleteVoteMutation({ variables: { postId, userId: id } - }).catch(console.error); + }); + + refetch(); + } catch (error) { + setErr(error); + } + }, [id, deleteVoteMutation, postId, refetch]); - addPostVoteMutation({ + const castVote = useCallback(async (vote: Vote) => { + if (!id) { + return; + } + + try { + await addPostVoteMutation({ variables: { postId, userId: id, @@ -54,7 +68,7 @@ const CouncilSignals = ({ className, ayes, nays, postId, refetch }: Props) => { } catch (error) { setErr(error); } - }, [id, addPostVoteMutation, deleteVoteMutation, postId, refetch]); + }, [id, addPostVoteMutation, postId, refetch]); return ( @@ -66,13 +80,32 @@ const CouncilSignals = ({ className, ayes, nays, postId, refetch }: Props) => {
{error?.message && }
- {id &&
- castVote(Vote.AYE)} - onClickNay={() => castVote(Vote.NAY)} - /> - } + {id && (ownVote + ? <> +
You voted {ownVote}.
+
+ + + + + +
+ + :
+ castVote(Vote.AYE)} + onClickNay={() => castVote(Vote.NAY)} + /> + + )}
); }; diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index 8d0d233b3..e2714b9d1 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -2,8 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import React from 'react'; +import React, { useContext } from 'react'; +import { UserDetailsContext } from '../../../context/UserDetailsContext'; import { usePostVotesQuery } from '../../../generated/graphql'; import { Vote } from '../../../types'; import Card from '../../../ui-components/Card'; @@ -16,11 +17,16 @@ interface Props { } const Poll = ({ postId }: Props) => { + const { id } = useContext(UserDetailsContext); const { data, error, refetch } = usePostVotesQuery({ variables: { postId } }); let ayes = 0; let nays = 0; + let ownVote: Vote | null = null; - data?.post_votes?.forEach(({ vote }) => { + data?.post_votes?.forEach(({ vote, voter }) => { + if (voter?.id === id) { + ownVote = vote; + } if (vote === Vote.AYE) { ayes++; } @@ -36,6 +42,7 @@ const Poll = ({ postId }: Props) => { From 064e898fffb7816a01881fdfe5479c2a19dc718c Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 14:55:20 +0530 Subject: [PATCH 20/62] Added check of has_poll on create post itself --- front-end/src/components/Post/Post.tsx | 3 +- front-end/src/generated/graphql.tsx | 42 +++++++++++++++---- front-end/src/screens/CreatePost/index.tsx | 11 ++++- front-end/src/screens/CreatePost/query.ts | 5 ++- front-end/src/screens/DiscussionPost/query.ts | 1 + front-end/src/screens/MotionPost/query.ts | 1 + front-end/src/screens/ProposalPost/query.ts | 1 + front-end/src/screens/ReferendumPost/query.ts | 1 + front-end/src/screens/TreasuryPost/query.ts | 1 + 9 files changed, 53 insertions(+), 13 deletions(-) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index 2431fb40d..a3b776971 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -183,8 +183,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {/* Showing Poll for only onchain posts */} - {onchainId && } + {post.has_poll && }
); diff --git a/front-end/src/generated/graphql.tsx b/front-end/src/generated/graphql.tsx index 90ec1fe7e..279d831fc 100644 --- a/front-end/src/generated/graphql.tsx +++ b/front-end/src/generated/graphql.tsx @@ -487,6 +487,18 @@ export type BlockNumberWhereUniqueInput = { number?: Maybe, }; +export type Boolean_Comparison_Exp = { + _eq?: Maybe, + _gt?: Maybe, + _gte?: Maybe, + _in?: Maybe>, + _is_null?: Maybe, + _lt?: Maybe, + _lte?: Maybe, + _neq?: Maybe, + _nin?: Maybe>, +}; + export type Bpchar_Comparison_Exp = { _eq?: Maybe, @@ -6307,6 +6319,7 @@ export type Posts = { comments_aggregate: Comments_Aggregate, content?: Maybe, created_at: Scalars['timestamptz'], + has_poll: Scalars['Boolean'], id: Scalars['Int'], onchain_link?: Maybe, post_reactions: Array, @@ -6444,6 +6457,7 @@ export type Posts_Bool_Exp = { comments?: Maybe, content?: Maybe, created_at?: Maybe, + has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, post_reactions?: Maybe, @@ -6472,6 +6486,7 @@ export type Posts_Insert_Input = { comments?: Maybe, content?: Maybe, created_at?: Maybe, + has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, post_reactions?: Maybe, @@ -6552,6 +6567,7 @@ export type Posts_Order_By = { comments_aggregate?: Maybe, content?: Maybe, created_at?: Maybe, + has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, post_reactions_aggregate?: Maybe, @@ -6572,6 +6588,7 @@ export enum Posts_Select_Column { AuthorId = 'author_id', Content = 'content', CreatedAt = 'created_at', + HasPoll = 'has_poll', Id = 'id', Title = 'title', TopicId = 'topic_id', @@ -6583,6 +6600,7 @@ export type Posts_Set_Input = { author_id?: Maybe, content?: Maybe, created_at?: Maybe, + has_poll?: Maybe, id?: Maybe, title?: Maybe, topic_id?: Maybe, @@ -6654,6 +6672,7 @@ export enum Posts_Update_Column { AuthorId = 'author_id', Content = 'content', CreatedAt = 'created_at', + HasPoll = 'has_poll', Id = 'id', Title = 'title', TopicId = 'topic_id', @@ -11920,7 +11939,8 @@ export type CreatePostMutationVariables = { userId: Scalars['Int'], content: Scalars['String'], topicId: Scalars['Int'], - title: Scalars['String'] + title: Scalars['String'], + hasPoll?: Maybe }; @@ -11959,7 +11979,7 @@ export type OnchainLinkDiscussionFragment = ( export type DiscussionPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12055,7 +12075,7 @@ export type OnchainLinkMotionFragment = ( export type MotionPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12300,7 +12320,7 @@ export type OnchainLinkProposalFragment = ( export type ProposalPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12358,7 +12378,7 @@ export type OnchainLinkReferendumFragment = ( export type ReferendumPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12583,7 +12603,7 @@ export type OnchainLinkTreasuryProposalFragment = ( export type TreasuryProposalPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12721,6 +12741,7 @@ export const DiscussionPostFragmentDoc = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { @@ -12798,6 +12819,7 @@ export const MotionPostFragmentDoc = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { @@ -12853,6 +12875,7 @@ export const ProposalPostFragmentDoc = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { @@ -12913,6 +12936,7 @@ export const ReferendumPostFragmentDoc = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { @@ -12959,6 +12983,7 @@ export const TreasuryProposalPostFragmentDoc = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { @@ -13844,9 +13869,9 @@ export type Get_Refresh_TokenQueryHookResult = ReturnType; export type Get_Refresh_TokenQueryResult = ApolloReactCommon.QueryResult; export const CreatePostDocument = gql` - mutation createPost($userId: Int!, $content: String!, $topicId: Int!, $title: String!) { + mutation createPost($userId: Int!, $content: String!, $topicId: Int!, $title: String!, $hasPoll: Boolean) { __typename - insert_posts(objects: {author_id: $userId, content: $content, title: $title, topic_id: $topicId}) { + insert_posts(objects: {author_id: $userId, content: $content, title: $title, topic_id: $topicId, has_poll: $hasPoll}) { affected_rows returning { id @@ -13873,6 +13898,7 @@ export type CreatePostMutationFn = ApolloReactCommon.MutationFunction { const [title, setTitle] = useState(''); const [content, setContent] = useState(''); + const [hasPoll, setHasPoll] = useState(false); const { queueNotification } = useContext(NotificationContext); const [selectedTopic, setSetlectedTopic] = useState(1); const currentUser = useContext(UserDetailsContext); @@ -59,6 +60,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { setIsSending(true); createPostMutation({ variables: { content, + hasPoll, title, topicId: selectedTopic, userId: currentUser.id @@ -83,6 +85,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const onTitleChange = (event: React.ChangeEvent[]) => {setTitle(event[0].currentTarget.value); return event[0].currentTarget.value;}; const onContentChange = (data: Array) => {setContent(data[0]); return data[0].length ? data[0] : null;}; + const onPollChanged = (event: React.ChangeEvent) => { setHasPoll(event.target.checked);}; return ( @@ -108,6 +111,12 @@ const CreatePost = ({ className }:Props): JSX.Element => { rules={{ required: true }} /> + + + Add a poll to this discussion + + + setSetlectedTopic(id)} /> @@ -138,4 +147,4 @@ export default styled(CreatePost)` justify-content: center; margin-top: 3rem; } -`; \ No newline at end of file +`; diff --git a/front-end/src/screens/CreatePost/query.ts b/front-end/src/screens/CreatePost/query.ts index 8abf14dcc..c1cc4ff01 100644 --- a/front-end/src/screens/CreatePost/query.ts +++ b/front-end/src/screens/CreatePost/query.ts @@ -5,13 +5,14 @@ import gql from 'graphql-tag'; export const CREATE_POST = gql` - mutation createPost($userId: Int! $content: String! $topicId: Int! $title: String!) { + mutation createPost($userId: Int! $content: String! $topicId: Int! $title: String!, $hasPoll: Boolean) { __typename insert_posts(objects: { author_id: $userId, content: $content, title: $title, - topic_id: $topicId + topic_id: $topicId, + has_poll: $hasPoll }) { affected_rows returning { diff --git a/front-end/src/screens/DiscussionPost/query.ts b/front-end/src/screens/DiscussionPost/query.ts index 230cd6097..90b547d1c 100644 --- a/front-end/src/screens/DiscussionPost/query.ts +++ b/front-end/src/screens/DiscussionPost/query.ts @@ -24,6 +24,7 @@ const discussionPost = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/MotionPost/query.ts b/front-end/src/screens/MotionPost/query.ts index b1866d747..ae19b487f 100644 --- a/front-end/src/screens/MotionPost/query.ts +++ b/front-end/src/screens/MotionPost/query.ts @@ -67,6 +67,7 @@ const motionPost = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/ProposalPost/query.ts b/front-end/src/screens/ProposalPost/query.ts index 985a8237c..ae22cdae8 100644 --- a/front-end/src/screens/ProposalPost/query.ts +++ b/front-end/src/screens/ProposalPost/query.ts @@ -42,6 +42,7 @@ const proposalPost = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/ReferendumPost/query.ts b/front-end/src/screens/ReferendumPost/query.ts index 6f3bf46f0..98bca7b9b 100644 --- a/front-end/src/screens/ReferendumPost/query.ts +++ b/front-end/src/screens/ReferendumPost/query.ts @@ -47,6 +47,7 @@ const referendumPost = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/TreasuryPost/query.ts b/front-end/src/screens/TreasuryPost/query.ts index c301995b9..dd7784bc9 100644 --- a/front-end/src/screens/TreasuryPost/query.ts +++ b/front-end/src/screens/TreasuryPost/query.ts @@ -33,6 +33,7 @@ const treasuryProposalPost = gql` } content created_at + has_poll id updated_at comments(order_by: {created_at: asc}) { From 37808680b9cd8318aa4c767c61e2ddde56ae5b28 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 25 May 2020 14:55:25 +0530 Subject: [PATCH 21/62] Added check of has_poll on create post itself --- .../down.yaml | 5 ++++ .../up.yaml | 6 +++++ .../down.yaml | 25 +++++++++++++++++ .../up.yaml | 26 ++++++++++++++++++ .../down.yaml | 23 ++++++++++++++++ .../up.yaml | 24 +++++++++++++++++ .../down.yaml | 25 +++++++++++++++++ .../up.yaml | 26 ++++++++++++++++++ .../down.yaml | 26 ++++++++++++++++++ .../up.yaml | 27 +++++++++++++++++++ .../down.yaml | 25 +++++++++++++++++ .../up.yaml | 26 ++++++++++++++++++ 12 files changed, 264 insertions(+) create mode 100644 hasura/hasura-migrations/migrations/1590394794357_alter_table_public_posts_add_column_has_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590394794357_alter_table_public_posts_add_column_has_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398012080_update_permission_anonymous_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398012080_update_permission_anonymous_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398036930_update_permission_proposal_bot_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398036930_update_permission_proposal_bot_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398042712_update_permission_proposal_bot_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398042712_update_permission_proposal_bot_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398048601_update_permission_user_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398048601_update_permission_user_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398053786_update_permission_user_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590398053786_update_permission_user_public_table_posts/up.yaml diff --git a/hasura/hasura-migrations/migrations/1590394794357_alter_table_public_posts_add_column_has_poll/down.yaml b/hasura/hasura-migrations/migrations/1590394794357_alter_table_public_posts_add_column_has_poll/down.yaml new file mode 100644 index 000000000..b1c9891a5 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590394794357_alter_table_public_posts_add_column_has_poll/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" DROP COLUMN "has_poll"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1590394794357_alter_table_public_posts_add_column_has_poll/up.yaml b/hasura/hasura-migrations/migrations/1590394794357_alter_table_public_posts_add_column_has_poll/up.yaml new file mode 100644 index 000000000..235157a57 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590394794357_alter_table_public_posts_add_column_has_poll/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ADD COLUMN "has_poll" boolean NOT NULL DEFAULT + false; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1590398012080_update_permission_anonymous_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590398012080_update_permission_anonymous_public_table_posts/down.yaml new file mode 100644 index 000000000..aa768ffa0 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398012080_update_permission_anonymous_public_table_posts/down.yaml @@ -0,0 +1,25 @@ +- args: + role: anonymous + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - id + - author_id + - content + - title + - topic_id + - type_id + - created_at + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590398012080_update_permission_anonymous_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590398012080_update_permission_anonymous_public_table_posts/up.yaml new file mode 100644 index 000000000..387106ee8 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398012080_update_permission_anonymous_public_table_posts/up.yaml @@ -0,0 +1,26 @@ +- args: + role: anonymous + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590398036930_update_permission_proposal_bot_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590398036930_update_permission_proposal_bot_public_table_posts/down.yaml new file mode 100644 index 000000000..bc769a231 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398036930_update_permission_proposal_bot_public_table_posts/down.yaml @@ -0,0 +1,23 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + author_id: + _eq: X-Hasura-User-Id + columns: + - author_id + - content + - title + - topic_id + - type_id + set: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1590398036930_update_permission_proposal_bot_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590398036930_update_permission_proposal_bot_public_table_posts/up.yaml new file mode 100644 index 000000000..7ae6b9296 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398036930_update_permission_proposal_bot_public_table_posts/up.yaml @@ -0,0 +1,24 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + author_id: + _eq: X-Hasura-User-Id + columns: + - author_id + - content + - has_poll + - title + - topic_id + - type_id + set: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1590398042712_update_permission_proposal_bot_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590398042712_update_permission_proposal_bot_public_table_posts/down.yaml new file mode 100644 index 000000000..23bc0c2a1 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398042712_update_permission_proposal_bot_public_table_posts/down.yaml @@ -0,0 +1,25 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - id + - type_id + - content + - title + - created_at + - updated_at + - topic_id + computed_fields: [] + filter: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590398042712_update_permission_proposal_bot_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590398042712_update_permission_proposal_bot_public_table_posts/up.yaml new file mode 100644 index 000000000..72ebc41c9 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398042712_update_permission_proposal_bot_public_table_posts/up.yaml @@ -0,0 +1,26 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590398048601_update_permission_user_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590398048601_update_permission_user_public_table_posts/down.yaml new file mode 100644 index 000000000..93ec82637 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398048601_update_permission_user_public_table_posts/down.yaml @@ -0,0 +1,26 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + _and: + - author_id: + _eq: X-Hasura-User-Id + - type_id: + _eq: 1 + columns: + - author_id + - content + - title + - topic_id + - type_id + set: {} + role: user + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1590398048601_update_permission_user_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590398048601_update_permission_user_public_table_posts/up.yaml new file mode 100644 index 000000000..e14efb6dc --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398048601_update_permission_user_public_table_posts/up.yaml @@ -0,0 +1,27 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + _and: + - author_id: + _eq: X-Hasura-User-Id + - type_id: + _eq: 1 + columns: + - author_id + - content + - has_poll + - title + - topic_id + - type_id + set: {} + role: user + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1590398053786_update_permission_user_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590398053786_update_permission_user_public_table_posts/down.yaml new file mode 100644 index 000000000..c4c35c92e --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398053786_update_permission_user_public_table_posts/down.yaml @@ -0,0 +1,25 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - id + - type_id + - content + - title + - created_at + - updated_at + - topic_id + computed_fields: [] + filter: {} + role: user + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590398053786_update_permission_user_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590398053786_update_permission_user_public_table_posts/up.yaml new file mode 100644 index 000000000..2e88ff057 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590398053786_update_permission_user_public_table_posts/up.yaml @@ -0,0 +1,26 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: posts + schema: public + type: create_select_permission From a56e8d07984d2fbab9d6b1f3874a0e182ea8d7ac Mon Sep 17 00:00:00 2001 From: erler Date: Mon, 25 May 2020 17:30:57 +0200 Subject: [PATCH 22/62] box-shadow fix --- front-end/src/themes/theme.ts | 1 + front-end/src/ui-components/Card.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/front-end/src/themes/theme.ts b/front-end/src/themes/theme.ts index 68655725e..c200b5dde 100644 --- a/front-end/src/themes/theme.ts +++ b/front-end/src/themes/theme.ts @@ -44,6 +44,7 @@ export const theme = { }, shadows: { box_shadow_big: '0 0.8rem 2rem rgba(83, 89, 92, 0.15)', + box_shadow_card: '0 0.4rem 1rem rgba(83, 89, 92, 0.15)', box_shadow_secondary_grey: '0 0 0 1px #706D6D inset', box_shadow_secondary_red: '0 0 0 1px #D94C3D inset' } diff --git a/front-end/src/ui-components/Card.tsx b/front-end/src/ui-components/Card.tsx index f25856c93..e8085c7af 100644 --- a/front-end/src/ui-components/Card.tsx +++ b/front-end/src/ui-components/Card.tsx @@ -20,7 +20,7 @@ export default styled(Card)` background-color: white; padding: 2rem 3rem 2rem 3rem; border-radius: 3px; - box-shadow: box_shadow_secondary_grey; + box-shadow: box_shadow_card; margin-bottom: 1rem; @media only screen and (max-width: 768px) { padding: 2rem; From 33f5039e114857cde70e8d02e2d8e2dfeef98d33 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Tue, 26 May 2020 13:50:32 +0530 Subject: [PATCH 23/62] Update front-end/src/ui-components/CouncilSignalBar.tsx Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com> --- front-end/src/ui-components/CouncilSignalBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-end/src/ui-components/CouncilSignalBar.tsx b/front-end/src/ui-components/CouncilSignalBar.tsx index d22849b02..0ca98d9c8 100644 --- a/front-end/src/ui-components/CouncilSignalBar.tsx +++ b/front-end/src/ui-components/CouncilSignalBar.tsx @@ -9,7 +9,7 @@ interface Props { className?: string ayeSignals: number naySignals: number - councilSize?: number + councilSize: number } const CouncilSignalBar = ({ ayeSignals, className, councilSize = 13, naySignals }: Props) => { From 02dbf541e87e7467ac46a390d8d6f608a3295b69 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Tue, 26 May 2020 13:50:44 +0530 Subject: [PATCH 24/62] Update front-end/src/components/Post/Poll/CouncilSignals.tsx Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com> --- front-end/src/components/Post/Poll/CouncilSignals.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index b4e48b27b..c76092c80 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -89,6 +89,7 @@ const CouncilSignals = ({ className, data }: Props) => {

Council Signals

From a8b226d833ba5934caefc517b20b5e50315d240f Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Tue, 26 May 2020 13:50:54 +0530 Subject: [PATCH 25/62] Update front-end/src/ui-components/OffChainSignalBar.tsx Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com> --- front-end/src/ui-components/OffChainSignalBar.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/front-end/src/ui-components/OffChainSignalBar.tsx b/front-end/src/ui-components/OffChainSignalBar.tsx index ffcb68636..2f2b25f49 100644 --- a/front-end/src/ui-components/OffChainSignalBar.tsx +++ b/front-end/src/ui-components/OffChainSignalBar.tsx @@ -10,7 +10,6 @@ interface Props { className?: string ayeSignals: number naySignals: number - councilSize?: number } const OffChainSignalBar = ({ ayeSignals, className, naySignals }: Props) => { From 98406bdf4f99c22d169876086a244b065229f9b5 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 08:52:38 +0530 Subject: [PATCH 26/62] Adding address of council if it exist --- front-end/src/components/Post/Poll/CouncilSignals.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index c76092c80..6f11d6ad7 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -39,8 +39,10 @@ const CouncilSignals = ({ className, data }: Props) => { const memberSet = new Set(); info?.members.map(([accountId]) => { - const address = getEncodedAddress(accountId.toString()) || ''; - memberSet.add(address); + const address = getEncodedAddress(accountId.toString()); + if (address) { + memberSet.add(address); + } }); setMemberSet(memberSet); From d5c1ccfbd38e8b87331d4da8a648b3114bfb5088 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 08:54:19 +0530 Subject: [PATCH 27/62] checking defaultAddress not empty string --- front-end/src/components/Post/Poll/CouncilSignals.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 6f11d6ad7..3b191f5c6 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -60,9 +60,9 @@ const CouncilSignals = ({ className, data }: Props) => { const councilVotes: OffchainVote[] = []; data?.post_votes?.forEach(({ vote, voter }) => { - const defaultAddress = voter?.[defaultAddressField] || ''; + const defaultAddress = voter?.[defaultAddressField]; - if (memberSet.has(defaultAddress)) { + if (defaultAddress && memberSet.has(defaultAddress)) { const address = getEncodedAddress(defaultAddress); if (address) { councilVotes.push({ From 4aa551842120f12a204baa1fd858cfdd91233441 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 08:58:14 +0530 Subject: [PATCH 28/62] renamed OffChainSignals -> GeneralSignals --- .../Post/Poll/{OffChainSignals.tsx => GeneralSignals.tsx} | 4 ++-- front-end/src/components/Post/Poll/index.tsx | 4 ++-- .../{OffChainSignalBar.tsx => GeneralChainSignalBar.tsx} | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename front-end/src/components/Post/Poll/{OffChainSignals.tsx => GeneralSignals.tsx} (96%) rename front-end/src/ui-components/{OffChainSignalBar.tsx => GeneralChainSignalBar.tsx} (91%) diff --git a/front-end/src/components/Post/Poll/OffChainSignals.tsx b/front-end/src/components/Post/Poll/GeneralSignals.tsx similarity index 96% rename from front-end/src/components/Post/Poll/OffChainSignals.tsx rename to front-end/src/components/Post/Poll/GeneralSignals.tsx index e51e48c6c..b733469b0 100644 --- a/front-end/src/components/Post/Poll/OffChainSignals.tsx +++ b/front-end/src/components/Post/Poll/GeneralSignals.tsx @@ -14,7 +14,7 @@ import Button from '../../../ui-components/Button'; import Card from '../../../ui-components/Card'; import FilteredError from '../../../ui-components/FilteredError'; import { Form } from '../../../ui-components/Form'; -import OffChainSignalBar from '../../../ui-components/OffChainSignalBar'; +import GeneralChainSignalBar from '../../../ui-components/GeneralChainSignalBar'; interface Props { ayes: number, @@ -72,7 +72,7 @@ const CouncilSignals = ({ className, ayes, ownVote, nays, postId, refetch }: Pro return ( - diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index e2714b9d1..ddd7fbceb 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -10,7 +10,7 @@ import { Vote } from '../../../types'; import Card from '../../../ui-components/Card'; import FilteredError from '../../../ui-components/FilteredError'; import CouncilSignals from './CouncilSignals'; -import OffChainSignals from './OffChainSignals'; +import GeneralSignals from './GeneralSignals'; interface Props { postId: number @@ -39,7 +39,7 @@ const Poll = ({ postId }: Props) => { return ( <> - { +const GeneralChainSignalBar = ({ ayeSignals, className, naySignals }: Props) => { let percent = 0; const total = ayeSignals + naySignals; if (total > 0) { @@ -31,7 +31,7 @@ const OffChainSignalBar = ({ ayeSignals, className, naySignals }: Props) => { ); }; -export default styled(OffChainSignalBar)` +export default styled(GeneralChainSignalBar)` position: relative; .signal-bar { display: flex; From 836563affdb730de74986f9f48f2b23ef7cc349c Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 14:05:40 +0530 Subject: [PATCH 29/62] Commented poll --- front-end/src/components/Post/Post.tsx | 2 +- front-end/src/screens/CreatePost/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index a3b776971..5d9b1fc27 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -183,7 +183,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {post.has_poll && } + {/* post.has_poll && */} ); diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index 18a70703a..57f2b0a05 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -111,11 +111,11 @@ const CreatePost = ({ className }:Props): JSX.Element => { rules={{ required: true }} /> - + {/* Add a poll to this discussion - + */} setSetlectedTopic(id)} From 6649cdae1f69f8313e02c35faaf3b14af1cabcb2 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 14:09:01 +0530 Subject: [PATCH 30/62] lint --- front-end/src/components/Post/Post.tsx | 2 +- front-end/src/screens/CreatePost/index.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index 5d9b1fc27..134e2567e 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -40,7 +40,7 @@ import PostReactionBar from '../Reactionbar/PostReactionBar'; import ReportButton from '../ReportButton'; import SubscriptionButton from '../SubscriptionButton/SubscriptionButton'; import GovenanceSideBar from './GovernanceSideBar'; -import Poll from './Poll'; +// import Poll from './Poll'; import CreatePostComment from './PostCommentForm'; import PostMotionInfo from './PostGovernanceInfo/PostMotionInfo'; import PostProposalInfo from './PostGovernanceInfo/PostProposalInfo'; diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index 57f2b0a05..c07f0e01c 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -111,11 +111,11 @@ const CreatePost = ({ className }:Props): JSX.Element => { rules={{ required: true }} /> - {/* + Add a poll to this discussion - */} + setSetlectedTopic(id)} @@ -147,4 +147,8 @@ export default styled(CreatePost)` justify-content: center; margin-top: 3rem; } + + .hidden { + display: none; + } `; From 73fc7e391d3a44edce755f946acff10dc2b9661d Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 16:08:53 +0530 Subject: [PATCH 31/62] Update front-end/src/ui-components/CouncilSignalBar.tsx Co-authored-by: Michel Erler <7072141+erler@users.noreply.github.com> --- front-end/src/ui-components/CouncilSignalBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-end/src/ui-components/CouncilSignalBar.tsx b/front-end/src/ui-components/CouncilSignalBar.tsx index 0ca98d9c8..59a2d415c 100644 --- a/front-end/src/ui-components/CouncilSignalBar.tsx +++ b/front-end/src/ui-components/CouncilSignalBar.tsx @@ -12,7 +12,7 @@ interface Props { councilSize: number } -const CouncilSignalBar = ({ ayeSignals, className, councilSize = 13, naySignals }: Props) => { +const CouncilSignalBar = ({ ayeSignals, className, councilSize, naySignals }: Props) => { const notSignaled = councilSize - ayeSignals - naySignals; return ( From 32d7932c2e6e436a0ecd0598c3b185eb6f0d0a9c Mon Sep 17 00:00:00 2001 From: thib Date: Wed, 27 May 2020 12:48:10 +0200 Subject: [PATCH 32/62] fix table setup --- .../1590576328516_run_sql_migration/down.yaml | 1 + .../1590576328516_run_sql_migration/up.yaml | 7 +++++++ .../down.yaml | 7 +++++++ .../up.yaml | 12 ++++++++++++ .../down.yaml | 6 ++++++ .../up.yaml | 18 ++++++++++++++++++ .../down.yaml | 6 ++++++ .../up.yaml | 18 ++++++++++++++++++ 8 files changed, 75 insertions(+) create mode 100644 hasura/hasura-migrations/migrations/1590576328516_run_sql_migration/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590576328516_run_sql_migration/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590576353167_alter_table_public_post_votes_add_column_updated_at/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590576353167_alter_table_public_post_votes_add_column_updated_at/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590576386997_update_permission_user_public_table_post_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590576386997_update_permission_user_public_table_post_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590576430409_update_permission_anonymous_public_table_post_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590576430409_update_permission_anonymous_public_table_post_votes/up.yaml diff --git a/hasura/hasura-migrations/migrations/1590576328516_run_sql_migration/down.yaml b/hasura/hasura-migrations/migrations/1590576328516_run_sql_migration/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590576328516_run_sql_migration/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/hasura-migrations/migrations/1590576328516_run_sql_migration/up.yaml b/hasura/hasura-migrations/migrations/1590576328516_run_sql_migration/up.yaml new file mode 100644 index 000000000..bcc3b7784 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590576328516_run_sql_migration/up.yaml @@ -0,0 +1,7 @@ +- args: + cascade: true + read_only: false + sql: |- + ALTER TABLE post_votes + DROP COLUMN updated_at; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1590576353167_alter_table_public_post_votes_add_column_updated_at/down.yaml b/hasura/hasura-migrations/migrations/1590576353167_alter_table_public_post_votes_add_column_updated_at/down.yaml new file mode 100644 index 000000000..55fa7107f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590576353167_alter_table_public_post_votes_add_column_updated_at/down.yaml @@ -0,0 +1,7 @@ +- args: + cascade: false + read_only: false + sql: |- + DROP TRIGGER IF EXISTS "set_public_post_votes_updated_at" ON "public"."post_votes"; + ALTER TABLE "public"."post_votes" DROP COLUMN "updated_at"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1590576353167_alter_table_public_post_votes_add_column_updated_at/up.yaml b/hasura/hasura-migrations/migrations/1590576353167_alter_table_public_post_votes_add_column_updated_at/up.yaml new file mode 100644 index 000000000..2c785d5dc --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590576353167_alter_table_public_post_votes_add_column_updated_at/up.yaml @@ -0,0 +1,12 @@ +- args: + cascade: false + read_only: false + sql: "ALTER TABLE \"public\".\"post_votes\" ADD COLUMN \"updated_at\" timestamptz + NULL DEFAULT now();\n\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS + TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\" + = NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_post_votes_updated_at\"\nBEFORE + UPDATE ON \"public\".\"post_votes\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT + ON TRIGGER \"set_public_post_votes_updated_at\" ON \"public\".\"post_votes\" + \nIS 'trigger to set value of column \"updated_at\" to current timestamp on + row update';" + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1590576386997_update_permission_user_public_table_post_votes/down.yaml b/hasura/hasura-migrations/migrations/1590576386997_update_permission_user_public_table_post_votes/down.yaml new file mode 100644 index 000000000..861d68ca9 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590576386997_update_permission_user_public_table_post_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: post_votes + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1590576386997_update_permission_user_public_table_post_votes/up.yaml b/hasura/hasura-migrations/migrations/1590576386997_update_permission_user_public_table_post_votes/up.yaml new file mode 100644 index 000000000..41bed3aa4 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590576386997_update_permission_user_public_table_post_votes/up.yaml @@ -0,0 +1,18 @@ +- args: + permission: + allow_aggregations: false + columns: + - id + - post_id + - user_id + - vote + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: user + table: + name: post_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590576430409_update_permission_anonymous_public_table_post_votes/down.yaml b/hasura/hasura-migrations/migrations/1590576430409_update_permission_anonymous_public_table_post_votes/down.yaml new file mode 100644 index 000000000..080430470 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590576430409_update_permission_anonymous_public_table_post_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: anonymous + table: + name: post_votes + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1590576430409_update_permission_anonymous_public_table_post_votes/up.yaml b/hasura/hasura-migrations/migrations/1590576430409_update_permission_anonymous_public_table_post_votes/up.yaml new file mode 100644 index 000000000..795aff546 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590576430409_update_permission_anonymous_public_table_post_votes/up.yaml @@ -0,0 +1,18 @@ +- args: + permission: + allow_aggregations: false + columns: + - vote + - id + - post_id + - user_id + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: anonymous + table: + name: post_votes + schema: public + type: create_select_permission From 13684673636e28b3611c23288e54a376b3adc59f Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 17:34:00 +0530 Subject: [PATCH 33/62] Using council members from chain db rather than onchain. Showing old council of poll closing time has passed --- .../components/Post/Poll/CouncilSignals.tsx | 48 +++--- front-end/src/components/Post/Poll/index.tsx | 5 +- front-end/src/components/Post/Poll/query.ts | 11 ++ front-end/src/components/Post/Post.tsx | 4 +- front-end/src/generated/graphql.tsx | 147 ++++++++++++++++-- front-end/src/global/networkConstants.ts | 8 +- front-end/src/screens/CreatePost/index.tsx | 11 +- front-end/src/screens/CreatePost/query.ts | 12 +- front-end/src/screens/DiscussionPost/query.ts | 1 + front-end/src/screens/MotionPost/query.ts | 1 + front-end/src/screens/ProposalPost/query.ts | 1 + front-end/src/screens/ReferendumPost/query.ts | 1 + front-end/src/screens/TreasuryPost/query.ts | 1 + front-end/src/types.ts | 3 +- .../down.yaml | 5 + .../up.yaml | 5 + .../down.yaml | 26 ++++ .../up.yaml | 27 ++++ .../down.yaml | 24 +++ .../up.yaml | 25 +++ .../down.yaml | 26 ++++ .../up.yaml | 27 ++++ .../down.yaml | 27 ++++ .../up.yaml | 28 ++++ .../down.yaml | 26 ++++ .../up.yaml | 27 ++++ 26 files changed, 480 insertions(+), 47 deletions(-) create mode 100644 hasura/hasura-migrations/migrations/1590551879644_alter_table_public_posts_add_column_block_number/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551879644_alter_table_public_posts_add_column_block_number/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551903082_update_permission_anonymous_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551903082_update_permission_anonymous_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551914387_update_permission_proposal_bot_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551914387_update_permission_proposal_bot_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551918775_update_permission_proposal_bot_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551918775_update_permission_proposal_bot_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551931219_update_permission_user_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551931219_update_permission_user_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551936342_update_permission_user_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1590551936342_update_permission_user_public_table_posts/up.yaml diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 3b191f5c6..45248aeb6 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -2,13 +2,13 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { DeriveElectionsInfo } from '@polkadot/api-derive/types'; -import { ApiPromiseContext } from '@substrate/context'; import styled from '@xstyled/styled-components'; -import React, { useContext, useEffect, useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { Grid, Icon } from 'semantic-ui-react'; +import { chainProperties } from 'src/global/networkConstants'; +import getNetwork from 'src/util/getNetwork'; -import { PostVotesQuery } from '../../../generated/graphql'; +import { PostVotesQuery, useCouncilAtBlockNumberQuery, useGet_Current_Block_NumberQuery } from '../../../generated/graphql'; import { OffchainVote, Vote } from '../../../types'; import Address from '../../../ui-components/Address'; import Card from '../../../ui-components/Card'; @@ -19,39 +19,45 @@ import getEncodedAddress from '../../../util/getEncodedAddress'; interface Props { className?: string data?: PostVotesQuery | undefined + blockNumber?: number } -const CouncilSignals = ({ className, data }: Props) => { +const CouncilSignals = ({ className, blockNumber, data }: Props) => { + const network = getNetwork(); const [ayes, setAyes] = useState(0); const [nays, setNays] = useState(0); const [memberSet, setMemberSet] = useState>(new Set()); const [councilVotes, setCouncilVotes] = useState([]); - const { api, isApiReady } = useContext(ApiPromiseContext); + const currentBlockNumber = useGet_Current_Block_NumberQuery(); + const councilAtPostBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: blockNumber || 0 } }); + const councilAtCurrentBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0 } }); + const TWO_WEEKS = chainProperties?.[network]?.twoWeeksBlocks; useEffect(() => { - if (!isApiReady){ - return; - } - - let unsubscribe: () => void; + const currentBlock = currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0; + const pollClosingBlockNumber = (blockNumber || 0) + TWO_WEEKS; - api.derive.elections.info((info: DeriveElectionsInfo) => { - const memberSet = new Set(); + const memberSet = new Set(); - info?.members.map(([accountId]) => { - const address = getEncodedAddress(accountId.toString()); + if (pollClosingBlockNumber > currentBlock) { + councilAtCurrentBlockNumber?.data?.councils?.[0]?.members?.forEach((member) => { + const address = getEncodedAddress(member.address); if (address) { memberSet.add(address); } }); + } else { + councilAtPostBlockNumber?.data?.councils?.[0]?.members?.forEach((member) => { + const address = getEncodedAddress(member.address); - setMemberSet(memberSet); - }) - .then(unsub => { unsubscribe = unsub; }) - .catch(e => console.error(e)); + if (address) { + memberSet.add(address); + } + }); + } - return () => unsubscribe && unsubscribe(); - }, [api, isApiReady]); + setMemberSet(memberSet); + }, [blockNumber, currentBlockNumber, councilAtPostBlockNumber, councilAtCurrentBlockNumber, TWO_WEEKS]); useEffect(() => { let ayes = 0; diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index ddd7fbceb..59bfadabd 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -14,9 +14,10 @@ import GeneralSignals from './GeneralSignals'; interface Props { postId: number + blockNumber?: number } -const Poll = ({ postId }: Props) => { +const Poll = ({ postId, blockNumber }: Props) => { const { id } = useContext(UserDetailsContext); const { data, error, refetch } = usePostVotesQuery({ variables: { postId } }); let ayes = 0; @@ -46,7 +47,7 @@ const Poll = ({ postId }: Props) => { postId={postId} refetch={refetch} /> - + ); }; diff --git a/front-end/src/components/Post/Poll/query.ts b/front-end/src/components/Post/Poll/query.ts index 6422600e1..422ed7466 100644 --- a/front-end/src/components/Post/Poll/query.ts +++ b/front-end/src/components/Post/Poll/query.ts @@ -51,3 +51,14 @@ export const DELETE_VOTE = gql` } } `; + +export const COUNCIL_AT_BLOCK_NUMBER = gql` + query councilAtBlockNumber ($blockNumber: Int!) { + councils(where: {blockNumber: {number_lte: $blockNumber}}, orderBy: id_DESC, first: 1) { + members { + address + } + } + } + +`; diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index 134e2567e..a3b776971 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -40,7 +40,7 @@ import PostReactionBar from '../Reactionbar/PostReactionBar'; import ReportButton from '../ReportButton'; import SubscriptionButton from '../SubscriptionButton/SubscriptionButton'; import GovenanceSideBar from './GovernanceSideBar'; -// import Poll from './Poll'; +import Poll from './Poll'; import CreatePostComment from './PostCommentForm'; import PostMotionInfo from './PostGovernanceInfo/PostMotionInfo'; import PostProposalInfo from './PostGovernanceInfo/PostProposalInfo'; @@ -183,7 +183,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {/* post.has_poll && */} + {post.has_poll && }
); diff --git a/front-end/src/generated/graphql.tsx b/front-end/src/generated/graphql.tsx index 1b23f9962..09fcdf25c 100644 --- a/front-end/src/generated/graphql.tsx +++ b/front-end/src/generated/graphql.tsx @@ -6314,6 +6314,7 @@ export type Posts = { __typename?: 'posts', author?: Maybe, author_id: Scalars['Int'], + block_number?: Maybe, comments: Array, comments_aggregate: Comments_Aggregate, content?: Maybe, @@ -6436,6 +6437,7 @@ export type Posts_Arr_Rel_Insert_Input = { export type Posts_Avg_Fields = { __typename?: 'posts_avg_fields', author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6443,6 +6445,7 @@ export type Posts_Avg_Fields = { export type Posts_Avg_Order_By = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6453,6 +6456,7 @@ export type Posts_Bool_Exp = { _not?: Maybe, _or?: Maybe>>, author_id?: Maybe, + block_number?: Maybe, comments?: Maybe, content?: Maybe, created_at?: Maybe, @@ -6475,6 +6479,7 @@ export enum Posts_Constraint { export type Posts_Inc_Input = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6482,6 +6487,7 @@ export type Posts_Inc_Input = { export type Posts_Insert_Input = { author_id?: Maybe, + block_number?: Maybe, comments?: Maybe, content?: Maybe, created_at?: Maybe, @@ -6501,6 +6507,7 @@ export type Posts_Insert_Input = { export type Posts_Max_Fields = { __typename?: 'posts_max_fields', author_id?: Maybe, + block_number?: Maybe, content?: Maybe, created_at?: Maybe, id?: Maybe, @@ -6512,6 +6519,7 @@ export type Posts_Max_Fields = { export type Posts_Max_Order_By = { author_id?: Maybe, + block_number?: Maybe, content?: Maybe, created_at?: Maybe, id?: Maybe, @@ -6524,6 +6532,7 @@ export type Posts_Max_Order_By = { export type Posts_Min_Fields = { __typename?: 'posts_min_fields', author_id?: Maybe, + block_number?: Maybe, content?: Maybe, created_at?: Maybe, id?: Maybe, @@ -6535,6 +6544,7 @@ export type Posts_Min_Fields = { export type Posts_Min_Order_By = { author_id?: Maybe, + block_number?: Maybe, content?: Maybe, created_at?: Maybe, id?: Maybe, @@ -6563,6 +6573,7 @@ export type Posts_On_Conflict = { export type Posts_Order_By = { author_id?: Maybe, + block_number?: Maybe, comments_aggregate?: Maybe, content?: Maybe, created_at?: Maybe, @@ -6585,6 +6596,7 @@ export type Posts_Pk_Columns_Input = { export enum Posts_Select_Column { AuthorId = 'author_id', + BlockNumber = 'block_number', Content = 'content', CreatedAt = 'created_at', HasPoll = 'has_poll', @@ -6597,6 +6609,7 @@ export enum Posts_Select_Column { export type Posts_Set_Input = { author_id?: Maybe, + block_number?: Maybe, content?: Maybe, created_at?: Maybe, has_poll?: Maybe, @@ -6610,6 +6623,7 @@ export type Posts_Set_Input = { export type Posts_Stddev_Fields = { __typename?: 'posts_stddev_fields', author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6617,6 +6631,7 @@ export type Posts_Stddev_Fields = { export type Posts_Stddev_Order_By = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6625,6 +6640,7 @@ export type Posts_Stddev_Order_By = { export type Posts_Stddev_Pop_Fields = { __typename?: 'posts_stddev_pop_fields', author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6632,6 +6648,7 @@ export type Posts_Stddev_Pop_Fields = { export type Posts_Stddev_Pop_Order_By = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6640,6 +6657,7 @@ export type Posts_Stddev_Pop_Order_By = { export type Posts_Stddev_Samp_Fields = { __typename?: 'posts_stddev_samp_fields', author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6647,6 +6665,7 @@ export type Posts_Stddev_Samp_Fields = { export type Posts_Stddev_Samp_Order_By = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6655,6 +6674,7 @@ export type Posts_Stddev_Samp_Order_By = { export type Posts_Sum_Fields = { __typename?: 'posts_sum_fields', author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6662,6 +6682,7 @@ export type Posts_Sum_Fields = { export type Posts_Sum_Order_By = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6669,6 +6690,7 @@ export type Posts_Sum_Order_By = { export enum Posts_Update_Column { AuthorId = 'author_id', + BlockNumber = 'block_number', Content = 'content', CreatedAt = 'created_at', HasPoll = 'has_poll', @@ -6682,6 +6704,7 @@ export enum Posts_Update_Column { export type Posts_Var_Pop_Fields = { __typename?: 'posts_var_pop_fields', author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6689,6 +6712,7 @@ export type Posts_Var_Pop_Fields = { export type Posts_Var_Pop_Order_By = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6697,6 +6721,7 @@ export type Posts_Var_Pop_Order_By = { export type Posts_Var_Samp_Fields = { __typename?: 'posts_var_samp_fields', author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6704,6 +6729,7 @@ export type Posts_Var_Samp_Fields = { export type Posts_Var_Samp_Order_By = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6712,6 +6738,7 @@ export type Posts_Var_Samp_Order_By = { export type Posts_Variance_Fields = { __typename?: 'posts_variance_fields', author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6719,6 +6746,7 @@ export type Posts_Variance_Fields = { export type Posts_Variance_Order_By = { author_id?: Maybe, + block_number?: Maybe, id?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -8172,7 +8200,6 @@ export type PublicUser = { export type Query = { __typename?: 'Query', - notification?: Maybe, subscription?: Maybe, token?: Maybe, user?: Maybe, @@ -8227,7 +8254,6 @@ export type Query_Root = { nomination?: Maybe, nominations: Array>, nominationsConnection: NominationConnection, - notification?: Maybe, offlineValidator?: Maybe, offlineValidators: Array>, offlineValidatorsConnection: OfflineValidatorConnection, @@ -11663,6 +11689,22 @@ export type DeleteVoteMutation = ( )> } ); +export type CouncilAtBlockNumberQueryVariables = { + blockNumber: Scalars['Int'] +}; + + +export type CouncilAtBlockNumberQuery = ( + { __typename?: 'query_root' } + & { councils: Array + )>> } + )>> } +); + export type EditPostMutationVariables = { id: Scalars['Int'], content: Scalars['String'], @@ -11927,7 +11969,8 @@ export type CreatePostMutationVariables = { content: Scalars['String'], topicId: Scalars['Int'], title: Scalars['String'], - hasPoll?: Maybe + hasPoll?: Maybe, + blockNumber?: Maybe }; @@ -11959,6 +12002,17 @@ export type Post_TopicsQuery = ( )> } ); +export type Get_Current_Block_NumberQueryVariables = {}; + + +export type Get_Current_Block_NumberQuery = ( + { __typename?: 'query_root' } + & { blockNumbers: Array + )>> } +); + export type OnchainLinkDiscussionFragment = ( { __typename?: 'onchain_links' } & Pick @@ -11966,7 +12020,7 @@ export type OnchainLinkDiscussionFragment = ( export type DiscussionPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12062,7 +12116,7 @@ export type OnchainLinkMotionFragment = ( export type MotionPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12307,7 +12361,7 @@ export type OnchainLinkProposalFragment = ( export type ProposalPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12365,7 +12419,7 @@ export type OnchainLinkReferendumFragment = ( export type ReferendumPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12590,7 +12644,7 @@ export type OnchainLinkTreasuryProposalFragment = ( export type TreasuryProposalPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12729,6 +12783,7 @@ export const DiscussionPostFragmentDoc = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { @@ -12807,6 +12862,7 @@ export const MotionPostFragmentDoc = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { @@ -12863,6 +12919,7 @@ export const ProposalPostFragmentDoc = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { @@ -12924,6 +12981,7 @@ export const ReferendumPostFragmentDoc = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { @@ -12971,6 +13029,7 @@ export const TreasuryProposalPostFragmentDoc = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { @@ -13291,6 +13350,41 @@ export function useDeleteVoteMutation(baseOptions?: ApolloReactHooks.MutationHoo export type DeleteVoteMutationHookResult = ReturnType; export type DeleteVoteMutationResult = ApolloReactCommon.MutationResult; export type DeleteVoteMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const CouncilAtBlockNumberDocument = gql` + query councilAtBlockNumber($blockNumber: Int!) { + councils(where: {blockNumber: {number_lte: $blockNumber}}, orderBy: id_DESC, first: 1) { + members { + address + } + } +} + `; + +/** + * __useCouncilAtBlockNumberQuery__ + * + * To run a query within a React component, call `useCouncilAtBlockNumberQuery` and pass it any options that fit your needs. + * When your component renders, `useCouncilAtBlockNumberQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useCouncilAtBlockNumberQuery({ + * variables: { + * blockNumber: // value for 'blockNumber' + * }, + * }); + */ +export function useCouncilAtBlockNumberQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + return ApolloReactHooks.useQuery(CouncilAtBlockNumberDocument, baseOptions); + } +export function useCouncilAtBlockNumberLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + return ApolloReactHooks.useLazyQuery(CouncilAtBlockNumberDocument, baseOptions); + } +export type CouncilAtBlockNumberQueryHookResult = ReturnType; +export type CouncilAtBlockNumberLazyQueryHookResult = ReturnType; +export type CouncilAtBlockNumberQueryResult = ApolloReactCommon.QueryResult; export const EditPostDocument = gql` mutation EditPost($id: Int!, $content: String!, $title: String!) { update_posts(where: {id: {_eq: $id}}, _set: {content: $content, title: $title}) { @@ -13832,9 +13926,9 @@ export type Get_Refresh_TokenQueryHookResult = ReturnType; export type Get_Refresh_TokenQueryResult = ApolloReactCommon.QueryResult; export const CreatePostDocument = gql` - mutation createPost($userId: Int!, $content: String!, $topicId: Int!, $title: String!, $hasPoll: Boolean) { + mutation createPost($userId: Int!, $content: String!, $topicId: Int!, $title: String!, $hasPoll: Boolean, $blockNumber: Int) { __typename - insert_posts(objects: {author_id: $userId, content: $content, title: $title, topic_id: $topicId, has_poll: $hasPoll}) { + insert_posts(objects: {author_id: $userId, content: $content, title: $title, topic_id: $topicId, has_poll: $hasPoll, block_number: $blockNumber}) { affected_rows returning { id @@ -13862,6 +13956,7 @@ export type CreatePostMutationFn = ApolloReactCommon.MutationFunction; export type Post_TopicsLazyQueryHookResult = ReturnType; export type Post_TopicsQueryResult = ApolloReactCommon.QueryResult; +export const Get_Current_Block_NumberDocument = gql` + query Get_current_block_number { + blockNumbers(orderBy: number_DESC, first: 1) { + number + } +} + `; + +/** + * __useGet_Current_Block_NumberQuery__ + * + * To run a query within a React component, call `useGet_Current_Block_NumberQuery` and pass it any options that fit your needs. + * When your component renders, `useGet_Current_Block_NumberQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGet_Current_Block_NumberQuery({ + * variables: { + * }, + * }); + */ +export function useGet_Current_Block_NumberQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + return ApolloReactHooks.useQuery(Get_Current_Block_NumberDocument, baseOptions); + } +export function useGet_Current_Block_NumberLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + return ApolloReactHooks.useLazyQuery(Get_Current_Block_NumberDocument, baseOptions); + } +export type Get_Current_Block_NumberQueryHookResult = ReturnType; +export type Get_Current_Block_NumberLazyQueryHookResult = ReturnType; +export type Get_Current_Block_NumberQueryResult = ApolloReactCommon.QueryResult; export const DiscussionPostAndCommentsDocument = gql` query DiscussionPostAndComments($id: Int!) { posts(where: {id: {_eq: $id}}) { diff --git a/front-end/src/global/networkConstants.ts b/front-end/src/global/networkConstants.ts index 2b0e45306..12cd11e27 100644 --- a/front-end/src/global/networkConstants.ts +++ b/front-end/src/global/networkConstants.ts @@ -19,12 +19,14 @@ export const chainProperties: ChainPropType = { blockTime: 6000, ss58Format: 2, tokenDecimals: 12, - tokenSymbol: tokenSymbol.KSM + tokenSymbol: tokenSymbol.KSM, + twoWeeksBlocks: 201600 }, [network.POLKADOT]: { blockTime: 6000, ss58Format: 1, tokenDecimals: 18, - tokenSymbol: tokenSymbol.DOT + tokenSymbol: tokenSymbol.DOT, + twoWeeksBlocks: 201600 // TODO: change for polkadot } -}; \ No newline at end of file +}; diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index c07f0e01c..71ea42dd7 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -11,7 +11,7 @@ import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; import { NotificationContext } from '../../context/NotificationContext'; import { UserDetailsContext } from '../../context/UserDetailsContext'; -import { useCreatePostMutation, usePostSubscribeMutation } from '../../generated/graphql'; +import { useCreatePostMutation, useGet_Current_Block_NumberQuery, usePostSubscribeMutation } from '../../generated/graphql'; import { useRouter } from '../../hooks'; import { NotificationStatus } from '../../types'; import Button from '../../ui-components/Button'; @@ -32,6 +32,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const currentUser = useContext(UserDetailsContext); const { control, errors, handleSubmit } = useForm(); + const { data } = useGet_Current_Block_NumberQuery(); const [createPostMutation, { loading, error }] = useCreatePostMutation(); const [postSubscribeMutation] = usePostSubscribeMutation(); const [isSending, setIsSending] = useState(false); @@ -56,9 +57,11 @@ const CreatePost = ({ className }:Props): JSX.Element => { }; const handleSend = () => { + const blockNumber = data?.blockNumbers?.[0]?.number; if (currentUser.id && title && content && selectedTopic){ setIsSending(true); createPostMutation({ variables: { + blockNumber, content, hasPoll, title, @@ -111,7 +114,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { rules={{ required: true }} /> - + Add a poll to this discussion @@ -147,8 +150,4 @@ export default styled(CreatePost)` justify-content: center; margin-top: 3rem; } - - .hidden { - display: none; - } `; diff --git a/front-end/src/screens/CreatePost/query.ts b/front-end/src/screens/CreatePost/query.ts index c1cc4ff01..32a26ab13 100644 --- a/front-end/src/screens/CreatePost/query.ts +++ b/front-end/src/screens/CreatePost/query.ts @@ -5,14 +5,15 @@ import gql from 'graphql-tag'; export const CREATE_POST = gql` - mutation createPost($userId: Int! $content: String! $topicId: Int! $title: String!, $hasPoll: Boolean) { + mutation createPost($userId: Int! $content: String! $topicId: Int! $title: String!, $hasPoll: Boolean, $blockNumber: Int) { __typename insert_posts(objects: { author_id: $userId, content: $content, title: $title, topic_id: $topicId, - has_poll: $hasPoll + has_poll: $hasPoll, + block_number: $blockNumber }) { affected_rows returning { @@ -38,3 +39,10 @@ export const GET_POST_TOPICS = gql` ${topic_fragment} `; +export const GET_CURRENT_BLOCK_NUMBER = gql` + query Get_current_block_number { + blockNumbers(orderBy: number_DESC, first: 1) { + number + } + } +`; diff --git a/front-end/src/screens/DiscussionPost/query.ts b/front-end/src/screens/DiscussionPost/query.ts index 90b547d1c..c544d17e7 100644 --- a/front-end/src/screens/DiscussionPost/query.ts +++ b/front-end/src/screens/DiscussionPost/query.ts @@ -25,6 +25,7 @@ const discussionPost = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/MotionPost/query.ts b/front-end/src/screens/MotionPost/query.ts index ae19b487f..dfccfcb2a 100644 --- a/front-end/src/screens/MotionPost/query.ts +++ b/front-end/src/screens/MotionPost/query.ts @@ -68,6 +68,7 @@ const motionPost = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/ProposalPost/query.ts b/front-end/src/screens/ProposalPost/query.ts index ae22cdae8..1977badc8 100644 --- a/front-end/src/screens/ProposalPost/query.ts +++ b/front-end/src/screens/ProposalPost/query.ts @@ -43,6 +43,7 @@ const proposalPost = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/ReferendumPost/query.ts b/front-end/src/screens/ReferendumPost/query.ts index 98bca7b9b..425c30a50 100644 --- a/front-end/src/screens/ReferendumPost/query.ts +++ b/front-end/src/screens/ReferendumPost/query.ts @@ -48,6 +48,7 @@ const referendumPost = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/TreasuryPost/query.ts b/front-end/src/screens/TreasuryPost/query.ts index dd7784bc9..a5a0f2602 100644 --- a/front-end/src/screens/TreasuryPost/query.ts +++ b/front-end/src/screens/TreasuryPost/query.ts @@ -34,6 +34,7 @@ const treasuryProposalPost = gql` content created_at has_poll + block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/types.ts b/front-end/src/types.ts index 6ff4ef952..9cad076a9 100644 --- a/front-end/src/types.ts +++ b/front-end/src/types.ts @@ -113,7 +113,8 @@ export interface ChainProps { 'blockTime': number; 'ss58Format': number; 'tokenDecimals': number; - 'tokenSymbol': TokenSymbol; + 'tokenSymbol': TokenSymbol; + 'twoWeeksBlocks': number; } export interface LoadingStatusType { diff --git a/hasura/hasura-migrations/migrations/1590551879644_alter_table_public_posts_add_column_block_number/down.yaml b/hasura/hasura-migrations/migrations/1590551879644_alter_table_public_posts_add_column_block_number/down.yaml new file mode 100644 index 000000000..ce808a21e --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551879644_alter_table_public_posts_add_column_block_number/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" DROP COLUMN "block_number"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1590551879644_alter_table_public_posts_add_column_block_number/up.yaml b/hasura/hasura-migrations/migrations/1590551879644_alter_table_public_posts_add_column_block_number/up.yaml new file mode 100644 index 000000000..dfb39cb2c --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551879644_alter_table_public_posts_add_column_block_number/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ADD COLUMN "block_number" integer NULL; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1590551903082_update_permission_anonymous_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590551903082_update_permission_anonymous_public_table_posts/down.yaml new file mode 100644 index 000000000..387106ee8 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551903082_update_permission_anonymous_public_table_posts/down.yaml @@ -0,0 +1,26 @@ +- args: + role: anonymous + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590551903082_update_permission_anonymous_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590551903082_update_permission_anonymous_public_table_posts/up.yaml new file mode 100644 index 000000000..4c18efe66 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551903082_update_permission_anonymous_public_table_posts/up.yaml @@ -0,0 +1,27 @@ +- args: + role: anonymous + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - block_number + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590551914387_update_permission_proposal_bot_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590551914387_update_permission_proposal_bot_public_table_posts/down.yaml new file mode 100644 index 000000000..7ae6b9296 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551914387_update_permission_proposal_bot_public_table_posts/down.yaml @@ -0,0 +1,24 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + author_id: + _eq: X-Hasura-User-Id + columns: + - author_id + - content + - has_poll + - title + - topic_id + - type_id + set: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1590551914387_update_permission_proposal_bot_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590551914387_update_permission_proposal_bot_public_table_posts/up.yaml new file mode 100644 index 000000000..ecf4796cc --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551914387_update_permission_proposal_bot_public_table_posts/up.yaml @@ -0,0 +1,25 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + author_id: + _eq: X-Hasura-User-Id + columns: + - author_id + - block_number + - content + - has_poll + - title + - topic_id + - type_id + set: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1590551918775_update_permission_proposal_bot_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590551918775_update_permission_proposal_bot_public_table_posts/down.yaml new file mode 100644 index 000000000..72ebc41c9 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551918775_update_permission_proposal_bot_public_table_posts/down.yaml @@ -0,0 +1,26 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590551918775_update_permission_proposal_bot_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590551918775_update_permission_proposal_bot_public_table_posts/up.yaml new file mode 100644 index 000000000..b360bf9aa --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551918775_update_permission_proposal_bot_public_table_posts/up.yaml @@ -0,0 +1,27 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - block_number + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590551931219_update_permission_user_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590551931219_update_permission_user_public_table_posts/down.yaml new file mode 100644 index 000000000..e14efb6dc --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551931219_update_permission_user_public_table_posts/down.yaml @@ -0,0 +1,27 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + _and: + - author_id: + _eq: X-Hasura-User-Id + - type_id: + _eq: 1 + columns: + - author_id + - content + - has_poll + - title + - topic_id + - type_id + set: {} + role: user + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1590551931219_update_permission_user_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590551931219_update_permission_user_public_table_posts/up.yaml new file mode 100644 index 000000000..6aea6478b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551931219_update_permission_user_public_table_posts/up.yaml @@ -0,0 +1,28 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + _and: + - author_id: + _eq: X-Hasura-User-Id + - type_id: + _eq: 1 + columns: + - author_id + - block_number + - content + - has_poll + - title + - topic_id + - type_id + set: {} + role: user + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1590551936342_update_permission_user_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1590551936342_update_permission_user_public_table_posts/down.yaml new file mode 100644 index 000000000..2e88ff057 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551936342_update_permission_user_public_table_posts/down.yaml @@ -0,0 +1,26 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1590551936342_update_permission_user_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1590551936342_update_permission_user_public_table_posts/up.yaml new file mode 100644 index 000000000..a4fdd92c9 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1590551936342_update_permission_user_public_table_posts/up.yaml @@ -0,0 +1,27 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - block_number + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: posts + schema: public + type: create_select_permission From d6a89a80e23abad4b6c5b9432d607c2720f3f1bf Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 17:50:31 +0530 Subject: [PATCH 34/62] < 2 check --- front-end/src/ui-components/CouncilSignalBar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front-end/src/ui-components/CouncilSignalBar.tsx b/front-end/src/ui-components/CouncilSignalBar.tsx index 59a2d415c..6af5214c7 100644 --- a/front-end/src/ui-components/CouncilSignalBar.tsx +++ b/front-end/src/ui-components/CouncilSignalBar.tsx @@ -17,8 +17,8 @@ const CouncilSignalBar = ({ ayeSignals, className, councilSize, naySignals }: Pr return (
-
{ayeSignals === 1 ? '1 Aye' : `${ayeSignals} Ayes`}
-
{naySignals === 1 ? '1 Nay' : `${naySignals} Nays`}
+
{ayeSignals < 2 ? '1 Aye' : `${ayeSignals} Ayes`}
+
{naySignals < 2 ? '1 Nay' : `${naySignals} Nays`}
{[...Array(ayeSignals)].map((e, i) =>
)} From e59b226454e547c4e4bf60f712f554d701dfaa19 Mon Sep 17 00:00:00 2001 From: erler Date: Wed, 27 May 2020 14:31:40 +0200 Subject: [PATCH 35/62] Signal percentage --- .../src/ui-components/GeneralChainSignalBar.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/front-end/src/ui-components/GeneralChainSignalBar.tsx b/front-end/src/ui-components/GeneralChainSignalBar.tsx index 80e88641d..fab9e16db 100644 --- a/front-end/src/ui-components/GeneralChainSignalBar.tsx +++ b/front-end/src/ui-components/GeneralChainSignalBar.tsx @@ -13,19 +13,21 @@ interface Props { } const GeneralChainSignalBar = ({ ayeSignals, className, naySignals }: Props) => { - let percent = 0; + let percentAye = 0; + let percentNay = 0; const total = ayeSignals + naySignals; if (total > 0) { - percent = ayeSignals/total*100; + percentAye = ayeSignals/total*100; + percentNay = naySignals/total*100; } return (
-
{ayeSignals === 1 ? '1 Aye' : `${ayeSignals} Ayes`}
-
{naySignals === 1 ? '1 Nay' : `${naySignals} Nays`}
+
{ayeSignals} {ayeSignals < 2 ? 'Aye' : 'Ayes'} ({percentAye}%)
+
{naySignals} {naySignals < 2 ? 'Nay' : 'Nays'} ({percentNay}%)
); From 90cfa494a72e2a1046e18de3c7885256b5a03250 Mon Sep 17 00:00:00 2001 From: erler Date: Wed, 27 May 2020 14:45:28 +0200 Subject: [PATCH 36/62] Helpertooltip next to title --- front-end/src/components/Post/Poll/CouncilSignals.tsx | 3 ++- front-end/src/components/Post/Poll/GeneralSignals.tsx | 3 ++- front-end/src/ui-components/HelperTooltip.tsx | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 3b191f5c6..41cb251c9 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -7,6 +7,7 @@ import { ApiPromiseContext } from '@substrate/context'; import styled from '@xstyled/styled-components'; import React, { useContext, useEffect, useState } from 'react'; import { Grid, Icon } from 'semantic-ui-react'; +import HelperTooltip from 'src/ui-components/HelperTooltip'; import { PostVotesQuery } from '../../../generated/graphql'; import { OffchainVote, Vote } from '../../../types'; @@ -88,7 +89,7 @@ const CouncilSignals = ({ className, data }: Props) => { return ( -

Council Signals

+

Council Signals

+

Poll Signaling

-
Signals are off chain.
{error?.message && }
diff --git a/front-end/src/ui-components/HelperTooltip.tsx b/front-end/src/ui-components/HelperTooltip.tsx index ebc3072e4..d1fb27b14 100644 --- a/front-end/src/ui-components/HelperTooltip.tsx +++ b/front-end/src/ui-components/HelperTooltip.tsx @@ -19,6 +19,7 @@ const myIcon = ({ className }:{className?: string}) => Date: Wed, 27 May 2020 19:10:31 +0530 Subject: [PATCH 37/62] Update front-end/src/components/Post/Poll/CouncilSignals.tsx Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> --- front-end/src/components/Post/Poll/CouncilSignals.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 41cb251c9..a042a159a 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -89,7 +89,7 @@ const CouncilSignals = ({ className, data }: Props) => { return ( -

Council Signals

+

Council Signals

+

Poll Signals

Date: Wed, 27 May 2020 19:16:21 +0530 Subject: [PATCH 39/62] Added checkbox --- front-end/src/screens/CreatePost/index.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index c07f0e01c..fa7df6032 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -3,9 +3,9 @@ // of the Apache-2.0 license. See the LICENSE file for details. import styled from '@xstyled/styled-components'; -import React, { useContext,useState } from 'react'; +import React, { useContext, useState } from 'react'; import { Controller,useForm } from 'react-hook-form'; -import { Grid } from 'semantic-ui-react'; +import { /* Checkbox, CheckboxProps,*/ Grid } from 'semantic-ui-react'; import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; @@ -26,7 +26,7 @@ interface Props { const CreatePost = ({ className }:Props): JSX.Element => { const [title, setTitle] = useState(''); const [content, setContent] = useState(''); - const [hasPoll, setHasPoll] = useState(false); + // const [hasPoll, setHasPoll] = useState(false); const { queueNotification } = useContext(NotificationContext); const [selectedTopic, setSetlectedTopic] = useState(1); const currentUser = useContext(UserDetailsContext); @@ -60,7 +60,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { setIsSending(true); createPostMutation({ variables: { content, - hasPoll, + // hasPoll, title, topicId: selectedTopic, userId: currentUser.id @@ -85,7 +85,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const onTitleChange = (event: React.ChangeEvent[]) => {setTitle(event[0].currentTarget.value); return event[0].currentTarget.value;}; const onContentChange = (data: Array) => {setContent(data[0]); return data[0].length ? data[0] : null;}; - const onPollChanged = (event: React.ChangeEvent) => { setHasPoll(event.target.checked);}; + // const onPollChanged = (event: React.FormEvent, data: CheckboxProps) => { setHasPoll(data.checked || false);}; return ( @@ -111,11 +111,11 @@ const CreatePost = ({ className }:Props): JSX.Element => { rules={{ required: true }} /> - + {/* - Add a poll to this discussion + - + */} setSetlectedTopic(id)} From 3205b90e382d3d02c404b813a6b07610ae2cf634 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 27 May 2020 19:27:32 +0530 Subject: [PATCH 40/62] fix --- front-end/src/components/Post/Poll/CouncilSignals.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index a042a159a..0363f7fe8 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -89,7 +89,7 @@ const CouncilSignals = ({ className, data }: Props) => { return ( -

Council Signals

Date: Fri, 29 May 2020 18:56:39 +0530 Subject: [PATCH 41/62] Fix ayes nays --- front-end/src/ui-components/CouncilSignalBar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front-end/src/ui-components/CouncilSignalBar.tsx b/front-end/src/ui-components/CouncilSignalBar.tsx index 6af5214c7..697bd8f55 100644 --- a/front-end/src/ui-components/CouncilSignalBar.tsx +++ b/front-end/src/ui-components/CouncilSignalBar.tsx @@ -17,8 +17,8 @@ const CouncilSignalBar = ({ ayeSignals, className, councilSize, naySignals }: Pr return (
-
{ayeSignals < 2 ? '1 Aye' : `${ayeSignals} Ayes`}
-
{naySignals < 2 ? '1 Nay' : `${naySignals} Nays`}
+
{`${ayeSignals} ${ayeSignals < 2 ? 'Aye' : 'Ayes'}`}
+
{`${naySignals} ${naySignals < 2 ? 'Nay' : 'Nays'}`}
{[...Array(ayeSignals)].map((e, i) =>
)} From 36848aca5460ba3df95cf089f27a5d1c4a67b9e6 Mon Sep 17 00:00:00 2001 From: Michel Erler <7072141+erler@users.noreply.github.com> Date: Sat, 30 May 2020 12:30:17 +0200 Subject: [PATCH 42/62] Cancel poll vote interaction (#815) * Cancel poll vote interaction * remove apiReady and revert AyeNayButtons * ownVote css styling * space * Use ButtonLink * fix percentage decimal display * api check --- .../components/Post/Poll/GeneralSignals.tsx | 59 ++++++++++--------- front-end/src/ui-components/AyeNayButtons.tsx | 8 +-- front-end/src/ui-components/Form.tsx | 1 + .../ui-components/GeneralChainSignalBar.tsx | 4 +- 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/front-end/src/components/Post/Poll/GeneralSignals.tsx b/front-end/src/components/Post/Poll/GeneralSignals.tsx index d9ea09aca..a9ded17a4 100644 --- a/front-end/src/components/Post/Poll/GeneralSignals.tsx +++ b/front-end/src/components/Post/Poll/GeneralSignals.tsx @@ -5,13 +5,13 @@ import styled from '@xstyled/styled-components'; import { ApolloQueryResult } from 'apollo-client'; import React, { useCallback, useContext, useState } from 'react'; +import ButtonLink from 'src/ui-components/ButtonLink'; import HelperTooltip from 'src/ui-components/HelperTooltip'; import { UserDetailsContext } from '../../../context/UserDetailsContext'; import { PostVotesQuery, PostVotesQueryVariables, useAddPostVoteMutation, useDeleteVoteMutation } from '../../../generated/graphql'; import { Vote } from '../../../types'; import AyeNayButtons from '../../../ui-components/AyeNayButtons'; -import Button from '../../../ui-components/Button'; import Card from '../../../ui-components/Card'; import FilteredError from '../../../ui-components/FilteredError'; import { Form } from '../../../ui-components/Form'; @@ -81,32 +81,17 @@ const CouncilSignals = ({ className, ayes, ownVote, nays, postId, refetch }: Pro
{error?.message && }
- {id && (ownVote - ? <> -
You voted {ownVote}.
-
- - - - - -
- - :
- castVote(Vote.AYE)} - onClickNay={() => castVote(Vote.NAY)} - /> - - )} +
+ castVote(Vote.AYE)} + onClickNay={() => castVote(Vote.NAY)} + /> + {ownVote && + Cancel {ownVote.toLowerCase()} vote + } + ); }; @@ -119,4 +104,22 @@ export default styled(CouncilSignals)` .errorText { color: red_secondary; } -`; + + .signal-btns { + margin-top: 2rem !important; + } + + .AYE { + .ui.button.ui.primary.positive.button { + background-color: green_secondary !important; + opacity: 1 !important; + } + } + + .NAY { + .ui.button.ui.primary.negative.button{ + background-color: red_secondary !important; + opacity: 1 !important; + } + } +`; \ No newline at end of file diff --git a/front-end/src/ui-components/AyeNayButtons.tsx b/front-end/src/ui-components/AyeNayButtons.tsx index d16615096..ce4b1bc51 100644 --- a/front-end/src/ui-components/AyeNayButtons.tsx +++ b/front-end/src/ui-components/AyeNayButtons.tsx @@ -10,10 +10,10 @@ import Button from './Button'; import { Form } from './Form'; interface Props{ - className?: string; - disabled: boolean; - onClickAye: () => void; - onClickNay: () => void; + className?: string; + disabled?: boolean; + onClickAye: () => void; + onClickNay: () => void; } const AyeNayButton = ({ className, disabled, onClickAye, onClickNay } : Props) => diff --git a/front-end/src/ui-components/Form.tsx b/front-end/src/ui-components/Form.tsx index 424fdd8a9..34dfae428 100644 --- a/front-end/src/ui-components/Form.tsx +++ b/front-end/src/ui-components/Form.tsx @@ -51,6 +51,7 @@ const StyledForm = styled(SUIForm)` a { color: grey_primary; + cursor: pointer; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: grey_primary; diff --git a/front-end/src/ui-components/GeneralChainSignalBar.tsx b/front-end/src/ui-components/GeneralChainSignalBar.tsx index fab9e16db..a22c9f40b 100644 --- a/front-end/src/ui-components/GeneralChainSignalBar.tsx +++ b/front-end/src/ui-components/GeneralChainSignalBar.tsx @@ -23,8 +23,8 @@ const GeneralChainSignalBar = ({ ayeSignals, className, naySignals }: Props) => return (
-
{ayeSignals} {ayeSignals < 2 ? 'Aye' : 'Ayes'} ({percentAye}%)
-
{naySignals} {naySignals < 2 ? 'Nay' : 'Nays'} ({percentNay}%)
+
{ayeSignals} {ayeSignals < 2 ? 'Aye' : 'Ayes'} ({percentAye.toFixed(1)}%)
+
{naySignals} {naySignals < 2 ? 'Nay' : 'Nays'} ({percentNay.toFixed(1)}%)
Date: Tue, 2 Jun 2020 11:06:47 +0200 Subject: [PATCH 43/62] use type guard and avoid over fetching --- front-end/src/components/Post/Post.tsx | 16 +- front-end/src/generated/graphql.tsx | 203 +----------------- front-end/src/screens/MotionPost/query.ts | 1 - front-end/src/screens/ProposalPost/query.ts | 1 - front-end/src/screens/ReferendumPost/query.ts | 1 - front-end/src/screens/TreasuryPost/query.ts | 1 - 6 files changed, 23 insertions(+), 200 deletions(-) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index 134e2567e..ab9c78675 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -12,7 +12,7 @@ import { DiscussionPostAndCommentsQuery, DiscussionPostAndCommentsQueryHookResult, DiscussionPostAndCommentsQueryVariables, - MotionPostAndCommentsQuery, + DiscussionPostFragment, MotionPostAndCommentsQuery, MotionPostAndCommentsQueryHookResult, MotionPostAndCommentsQueryVariables, MotionPostFragment, @@ -40,7 +40,7 @@ import PostReactionBar from '../Reactionbar/PostReactionBar'; import ReportButton from '../ReportButton'; import SubscriptionButton from '../SubscriptionButton/SubscriptionButton'; import GovenanceSideBar from './GovernanceSideBar'; -// import Poll from './Poll'; +import Poll from './Poll'; import CreatePostComment from './PostCommentForm'; import PostMotionInfo from './PostGovernanceInfo/PostMotionInfo'; import PostProposalInfo from './PostGovernanceInfo/PostProposalInfo'; @@ -84,6 +84,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere let treasuryPost: TreasuryProposalPostFragment | undefined; let definedOnchainLink : OnchainLinkMotionFragment | OnchainLinkReferendumFragment | OnchainLinkProposalFragment | OnchainLinkTreasuryProposalFragment | undefined; let postStatus: string | undefined; + let hasPoll = false; if (isReferendum){ referendumPost = post as ReferendumPostFragment; @@ -113,6 +114,15 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere postStatus = treasuryPost?.onchain_link?.onchain_treasury_spend_proposal?.[0]?.treasuryStatus?.[0].status; } + const isDiscussion = (post: TreasuryProposalPostFragment | MotionPostFragment | ProposalPostFragment | DiscussionPostFragment | ReferendumPostFragment): post is DiscussionPostFragment => { + if (!isProposal && !isMotion && !isTreasuryProposal) { + // eslint-disable-next-line no-extra-parens + return (post as DiscussionPostFragment) !== undefined; + } + + return false; + }; + const isProposalProposer = isProposal && proposalPost?.onchain_link?.proposer_address && addresses?.includes(proposalPost.onchain_link.proposer_address); const isReferendumProposer = isReferendum && referendumPost?.onchain_link?.proposer_address && addresses?.includes(referendumPost.onchain_link.proposer_address); const isMotionProposer = isMotion && motionPost?.onchain_link?.proposer_address && addresses?.includes(motionPost.onchain_link.proposer_address); @@ -183,7 +193,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {/* post.has_poll && */} + {isDiscussion(post) && post.has_poll && } ); diff --git a/front-end/src/generated/graphql.tsx b/front-end/src/generated/graphql.tsx index 1b23f9962..6a67fa47a 100644 --- a/front-end/src/generated/graphql.tsx +++ b/front-end/src/generated/graphql.tsx @@ -627,34 +627,26 @@ export type Comment_Reactions_Insert_Input = { export type Comment_Reactions_Max_Fields = { __typename?: 'comment_reactions_max_fields', comment_id?: Maybe, - created_at?: Maybe, id?: Maybe, - updated_at?: Maybe, user_id?: Maybe, }; export type Comment_Reactions_Max_Order_By = { comment_id?: Maybe, - created_at?: Maybe, id?: Maybe, - updated_at?: Maybe, user_id?: Maybe, }; export type Comment_Reactions_Min_Fields = { __typename?: 'comment_reactions_min_fields', comment_id?: Maybe, - created_at?: Maybe, id?: Maybe, - updated_at?: Maybe, user_id?: Maybe, }; export type Comment_Reactions_Min_Order_By = { comment_id?: Maybe, - created_at?: Maybe, id?: Maybe, - updated_at?: Maybe, user_id?: Maybe, }; @@ -5378,35 +5370,27 @@ export type Post_Reactions_Insert_Input = { export type Post_Reactions_Max_Fields = { __typename?: 'post_reactions_max_fields', - created_at?: Maybe, id?: Maybe, post_id?: Maybe, - updated_at?: Maybe, user_id?: Maybe, }; export type Post_Reactions_Max_Order_By = { - created_at?: Maybe, id?: Maybe, post_id?: Maybe, - updated_at?: Maybe, user_id?: Maybe, }; export type Post_Reactions_Min_Fields = { __typename?: 'post_reactions_min_fields', - created_at?: Maybe, id?: Maybe, post_id?: Maybe, - updated_at?: Maybe, user_id?: Maybe, }; export type Post_Reactions_Min_Order_By = { - created_at?: Maybe, id?: Maybe, post_id?: Maybe, - updated_at?: Maybe, user_id?: Maybe, }; @@ -6029,7 +6013,7 @@ export type Post_Votes = { id: Scalars['Int'], post: Posts, post_id: Scalars['Int'], - updated_at: Scalars['timestamp'], + updated_at?: Maybe, user_id: Scalars['Int'], vote: Scalars['bpchar'], voter?: Maybe, @@ -6102,7 +6086,7 @@ export type Post_Votes_Bool_Exp = { id?: Maybe, post?: Maybe, post_id?: Maybe, - updated_at?: Maybe, + updated_at?: Maybe, user_id?: Maybe, vote?: Maybe, }; @@ -6122,22 +6106,20 @@ export type Post_Votes_Insert_Input = { id?: Maybe, post?: Maybe, post_id?: Maybe, - updated_at?: Maybe, + updated_at?: Maybe, user_id?: Maybe, vote?: Maybe, }; export type Post_Votes_Max_Fields = { __typename?: 'post_votes_max_fields', - created_at?: Maybe, id?: Maybe, post_id?: Maybe, - updated_at?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; export type Post_Votes_Max_Order_By = { - created_at?: Maybe, id?: Maybe, post_id?: Maybe, updated_at?: Maybe, @@ -6146,15 +6128,13 @@ export type Post_Votes_Max_Order_By = { export type Post_Votes_Min_Fields = { __typename?: 'post_votes_min_fields', - created_at?: Maybe, id?: Maybe, post_id?: Maybe, - updated_at?: Maybe, + updated_at?: Maybe, user_id?: Maybe, }; export type Post_Votes_Min_Order_By = { - created_at?: Maybe, id?: Maybe, post_id?: Maybe, updated_at?: Maybe, @@ -6205,7 +6185,7 @@ export type Post_Votes_Set_Input = { created_at?: Maybe, id?: Maybe, post_id?: Maybe, - updated_at?: Maybe, + updated_at?: Maybe, user_id?: Maybe, vote?: Maybe, }; @@ -8172,7 +8152,6 @@ export type PublicUser = { export type Query = { __typename?: 'Query', - notification?: Maybe, subscription?: Maybe, token?: Maybe, user?: Maybe, @@ -8227,7 +8206,6 @@ export type Query_Root = { nomination?: Maybe, nominations: Array>, nominationsConnection: NominationConnection, - notification?: Maybe, offlineValidator?: Maybe, offlineValidators: Array>, offlineValidatorsConnection: OfflineValidatorConnection, @@ -10268,23 +10246,12 @@ export type Subscription = { export type Subscription_Root = { __typename?: 'subscription_root', - blockIndex?: Maybe, - blockNumber?: Maybe, comment_reactions: Array, comment_reactions_aggregate: Comment_Reactions_Aggregate, comment_reactions_by_pk?: Maybe, comments: Array, comments_aggregate: Comments_Aggregate, comments_by_pk?: Maybe, - council?: Maybe, - councilMember?: Maybe, - era?: Maybe, - heartBeat?: Maybe, - motion?: Maybe, - motionProposalArgument?: Maybe, - motionStatus?: Maybe, - nomination?: Maybe, - offlineValidator?: Maybe, onchain_links: Array, onchain_links_aggregate: Onchain_Links_Aggregate, onchain_links_by_pk?: Maybe, @@ -10303,32 +10270,6 @@ export type Subscription_Root = { posts: Array, posts_aggregate: Posts_Aggregate, posts_by_pk?: Maybe, - preimage?: Maybe, - preimageArgument?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - proposalStatus?: Maybe, - referendum?: Maybe, - referendumStatus?: Maybe, - reward?: Maybe, - session?: Maybe, - slashing?: Maybe, - stake?: Maybe, - subscribed?: Maybe, - totalIssuance?: Maybe, - treasurySpendProposal?: Maybe, - treasuryStatus?: Maybe, - validator?: Maybe, -}; - - -export type Subscription_RootBlockIndexArgs = { - where?: Maybe -}; - - -export type Subscription_RootBlockNumberArgs = { - where?: Maybe }; @@ -10378,51 +10319,6 @@ export type Subscription_RootComments_By_PkArgs = { }; -export type Subscription_RootCouncilArgs = { - where?: Maybe -}; - - -export type Subscription_RootCouncilMemberArgs = { - where?: Maybe -}; - - -export type Subscription_RootEraArgs = { - where?: Maybe -}; - - -export type Subscription_RootHeartBeatArgs = { - where?: Maybe -}; - - -export type Subscription_RootMotionArgs = { - where?: Maybe -}; - - -export type Subscription_RootMotionProposalArgumentArgs = { - where?: Maybe -}; - - -export type Subscription_RootMotionStatusArgs = { - where?: Maybe -}; - - -export type Subscription_RootNominationArgs = { - where?: Maybe -}; - - -export type Subscription_RootOfflineValidatorArgs = { - where?: Maybe -}; - - export type Subscription_RootOnchain_LinksArgs = { distinct_on?: Maybe>, limit?: Maybe, @@ -10561,81 +10457,6 @@ export type Subscription_RootPosts_By_PkArgs = { }; -export type Subscription_RootPreimageArgs = { - where?: Maybe -}; - - -export type Subscription_RootPreimageArgumentArgs = { - where?: Maybe -}; - - -export type Subscription_RootPreimageStatusArgs = { - where?: Maybe -}; - - -export type Subscription_RootProposalArgs = { - where?: Maybe -}; - - -export type Subscription_RootProposalStatusArgs = { - where?: Maybe -}; - - -export type Subscription_RootReferendumArgs = { - where?: Maybe -}; - - -export type Subscription_RootReferendumStatusArgs = { - where?: Maybe -}; - - -export type Subscription_RootRewardArgs = { - where?: Maybe -}; - - -export type Subscription_RootSessionArgs = { - where?: Maybe -}; - - -export type Subscription_RootSlashingArgs = { - where?: Maybe -}; - - -export type Subscription_RootStakeArgs = { - where?: Maybe -}; - - -export type Subscription_RootTotalIssuanceArgs = { - where?: Maybe -}; - - -export type Subscription_RootTreasurySpendProposalArgs = { - where?: Maybe -}; - - -export type Subscription_RootTreasuryStatusArgs = { - where?: Maybe -}; - - -export type Subscription_RootValidatorArgs = { - where?: Maybe -}; - - export type Timestamp_Comparison_Exp = { _eq?: Maybe, _gt?: Maybe, @@ -12062,7 +11883,7 @@ export type OnchainLinkMotionFragment = ( export type MotionPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12307,7 +12128,7 @@ export type OnchainLinkProposalFragment = ( export type ProposalPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12365,7 +12186,7 @@ export type OnchainLinkReferendumFragment = ( export type ReferendumPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12590,7 +12411,7 @@ export type OnchainLinkTreasuryProposalFragment = ( export type TreasuryProposalPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12806,7 +12627,6 @@ export const MotionPostFragmentDoc = gql` } content created_at - has_poll id updated_at comments(order_by: {created_at: asc}) { @@ -12862,7 +12682,6 @@ export const ProposalPostFragmentDoc = gql` } content created_at - has_poll id updated_at comments(order_by: {created_at: asc}) { @@ -12923,7 +12742,6 @@ export const ReferendumPostFragmentDoc = gql` } content created_at - has_poll id updated_at comments(order_by: {created_at: asc}) { @@ -12970,7 +12788,6 @@ export const TreasuryProposalPostFragmentDoc = gql` } content created_at - has_poll id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/MotionPost/query.ts b/front-end/src/screens/MotionPost/query.ts index ae19b487f..b1866d747 100644 --- a/front-end/src/screens/MotionPost/query.ts +++ b/front-end/src/screens/MotionPost/query.ts @@ -67,7 +67,6 @@ const motionPost = gql` } content created_at - has_poll id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/ProposalPost/query.ts b/front-end/src/screens/ProposalPost/query.ts index ae22cdae8..985a8237c 100644 --- a/front-end/src/screens/ProposalPost/query.ts +++ b/front-end/src/screens/ProposalPost/query.ts @@ -42,7 +42,6 @@ const proposalPost = gql` } content created_at - has_poll id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/ReferendumPost/query.ts b/front-end/src/screens/ReferendumPost/query.ts index 98bca7b9b..6f3bf46f0 100644 --- a/front-end/src/screens/ReferendumPost/query.ts +++ b/front-end/src/screens/ReferendumPost/query.ts @@ -47,7 +47,6 @@ const referendumPost = gql` } content created_at - has_poll id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/TreasuryPost/query.ts b/front-end/src/screens/TreasuryPost/query.ts index dd7784bc9..c301995b9 100644 --- a/front-end/src/screens/TreasuryPost/query.ts +++ b/front-end/src/screens/TreasuryPost/query.ts @@ -33,7 +33,6 @@ const treasuryProposalPost = gql` } content created_at - has_poll id updated_at comments(order_by: {created_at: asc}) { From a5f1c2c981d50f209a0c55d823c14a0e76a3adb0 Mon Sep 17 00:00:00 2001 From: thib Date: Tue, 2 Jun 2020 11:08:38 +0200 Subject: [PATCH 44/62] comment out Poll --- front-end/src/components/Post/Post.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index ab9c78675..afd8764e5 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -12,7 +12,8 @@ import { DiscussionPostAndCommentsQuery, DiscussionPostAndCommentsQueryHookResult, DiscussionPostAndCommentsQueryVariables, - DiscussionPostFragment, MotionPostAndCommentsQuery, + DiscussionPostFragment, + MotionPostAndCommentsQuery, MotionPostAndCommentsQueryHookResult, MotionPostAndCommentsQueryVariables, MotionPostFragment, @@ -40,7 +41,7 @@ import PostReactionBar from '../Reactionbar/PostReactionBar'; import ReportButton from '../ReportButton'; import SubscriptionButton from '../SubscriptionButton/SubscriptionButton'; import GovenanceSideBar from './GovernanceSideBar'; -import Poll from './Poll'; +// import Poll from './Poll'; import CreatePostComment from './PostCommentForm'; import PostMotionInfo from './PostGovernanceInfo/PostMotionInfo'; import PostProposalInfo from './PostGovernanceInfo/PostProposalInfo'; @@ -193,7 +194,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {isDiscussion(post) && post.has_poll && } + {/* {isDiscussion(post) && post.has_poll && } */} ); From b21bf8a890cf3c71d7748b594f619438d958e423 Mon Sep 17 00:00:00 2001 From: thib Date: Tue, 2 Jun 2020 11:22:11 +0200 Subject: [PATCH 45/62] lint --- front-end/src/components/Post/Post.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index afd8764e5..eef52bfbe 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -12,7 +12,7 @@ import { DiscussionPostAndCommentsQuery, DiscussionPostAndCommentsQueryHookResult, DiscussionPostAndCommentsQueryVariables, - DiscussionPostFragment, + // DiscussionPostFragment, MotionPostAndCommentsQuery, MotionPostAndCommentsQueryHookResult, MotionPostAndCommentsQueryVariables, @@ -85,7 +85,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere let treasuryPost: TreasuryProposalPostFragment | undefined; let definedOnchainLink : OnchainLinkMotionFragment | OnchainLinkReferendumFragment | OnchainLinkProposalFragment | OnchainLinkTreasuryProposalFragment | undefined; let postStatus: string | undefined; - let hasPoll = false; + // let hasPoll = false; if (isReferendum){ referendumPost = post as ReferendumPostFragment; @@ -115,14 +115,14 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere postStatus = treasuryPost?.onchain_link?.onchain_treasury_spend_proposal?.[0]?.treasuryStatus?.[0].status; } - const isDiscussion = (post: TreasuryProposalPostFragment | MotionPostFragment | ProposalPostFragment | DiscussionPostFragment | ReferendumPostFragment): post is DiscussionPostFragment => { - if (!isProposal && !isMotion && !isTreasuryProposal) { - // eslint-disable-next-line no-extra-parens - return (post as DiscussionPostFragment) !== undefined; - } + // const isDiscussion = (post: TreasuryProposalPostFragment | MotionPostFragment | ProposalPostFragment | DiscussionPostFragment | ReferendumPostFragment): post is DiscussionPostFragment => { + // if (!isProposal && !isMotion && !isTreasuryProposal) { + // // eslint-disable-next-line no-extra-parens + // return (post as DiscussionPostFragment) !== undefined; + // } - return false; - }; + // return false; + // }; const isProposalProposer = isProposal && proposalPost?.onchain_link?.proposer_address && addresses?.includes(proposalPost.onchain_link.proposer_address); const isReferendumProposer = isReferendum && referendumPost?.onchain_link?.proposer_address && addresses?.includes(referendumPost.onchain_link.proposer_address); From 678f788374cac95cc9165d458d2e629488992c8c Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 09:41:32 +0530 Subject: [PATCH 46/62] changed block_number to poll_block_number_end --- .../components/Post/Poll/CouncilSignals.tsx | 4 +- front-end/src/generated/graphql.tsx | 110 +++++++++--------- front-end/src/screens/CreatePost/index.tsx | 7 +- front-end/src/screens/CreatePost/query.ts | 6 +- front-end/src/screens/DiscussionPost/query.ts | 2 +- front-end/src/screens/MotionPost/query.ts | 1 - front-end/src/screens/ProposalPost/query.ts | 1 - front-end/src/screens/ReferendumPost/query.ts | 1 - front-end/src/screens/TreasuryPost/query.ts | 1 - .../down.yaml | 5 + .../up.yaml | 5 + 11 files changed, 73 insertions(+), 70 deletions(-) create mode 100644 hasura/hasura-migrations/migrations/1591588689454_alter_table_public_posts_alter_column_block_number/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591588689454_alter_table_public_posts_alter_column_block_number/up.yaml diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index df04fdcec..062e91811 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -9,7 +9,7 @@ import { chainProperties } from 'src/global/networkConstants'; import HelperTooltip from 'src/ui-components/HelperTooltip'; import getNetwork from 'src/util/getNetwork'; -import { PostVotesQuery, useCouncilAtBlockNumberQuery, useGet_Current_Block_NumberQuery } from '../../../generated/graphql'; +import { PostVotesQuery, useCouncilAtBlockNumberQuery, useGetCurrentBlockNumberQuery } from '../../../generated/graphql'; import { OffchainVote, Vote } from '../../../types'; import Address from '../../../ui-components/Address'; import Card from '../../../ui-components/Card'; @@ -29,7 +29,7 @@ const CouncilSignals = ({ className, blockNumber, data }: Props) => { const [nays, setNays] = useState(0); const [memberSet, setMemberSet] = useState>(new Set()); const [councilVotes, setCouncilVotes] = useState([]); - const currentBlockNumber = useGet_Current_Block_NumberQuery(); + const currentBlockNumber = useGetCurrentBlockNumberQuery(); const councilAtPostBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: blockNumber || 0 } }); const councilAtCurrentBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0 } }); const TWO_WEEKS = chainProperties?.[network]?.twoWeeksBlocks; diff --git a/front-end/src/generated/graphql.tsx b/front-end/src/generated/graphql.tsx index 3edfe026e..03c7a936e 100644 --- a/front-end/src/generated/graphql.tsx +++ b/front-end/src/generated/graphql.tsx @@ -6314,7 +6314,6 @@ export type Posts = { __typename?: 'posts', author?: Maybe, author_id: Scalars['Int'], - block_number?: Maybe, comments: Array, comments_aggregate: Comments_Aggregate, content?: Maybe, @@ -6322,6 +6321,7 @@ export type Posts = { has_poll: Scalars['Boolean'], id: Scalars['Int'], onchain_link?: Maybe, + poll_block_number_end?: Maybe, post_reactions: Array, post_reactions_aggregate: Post_Reactions_Aggregate, post_votes: Array, @@ -6437,16 +6437,16 @@ export type Posts_Arr_Rel_Insert_Input = { export type Posts_Avg_Fields = { __typename?: 'posts_avg_fields', author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Avg_Order_By = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6456,13 +6456,13 @@ export type Posts_Bool_Exp = { _not?: Maybe, _or?: Maybe>>, author_id?: Maybe, - block_number?: Maybe, comments?: Maybe, content?: Maybe, created_at?: Maybe, has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, + poll_block_number_end?: Maybe, post_reactions?: Maybe, post_votes?: Maybe, title?: Maybe, @@ -6479,21 +6479,21 @@ export enum Posts_Constraint { export type Posts_Inc_Input = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Insert_Input = { author_id?: Maybe, - block_number?: Maybe, comments?: Maybe, content?: Maybe, created_at?: Maybe, has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, + poll_block_number_end?: Maybe, post_reactions?: Maybe, post_votes?: Maybe, title?: Maybe, @@ -6507,10 +6507,10 @@ export type Posts_Insert_Input = { export type Posts_Max_Fields = { __typename?: 'posts_max_fields', author_id?: Maybe, - block_number?: Maybe, content?: Maybe, created_at?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6519,10 +6519,10 @@ export type Posts_Max_Fields = { export type Posts_Max_Order_By = { author_id?: Maybe, - block_number?: Maybe, content?: Maybe, created_at?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6532,10 +6532,10 @@ export type Posts_Max_Order_By = { export type Posts_Min_Fields = { __typename?: 'posts_min_fields', author_id?: Maybe, - block_number?: Maybe, content?: Maybe, created_at?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6544,10 +6544,10 @@ export type Posts_Min_Fields = { export type Posts_Min_Order_By = { author_id?: Maybe, - block_number?: Maybe, content?: Maybe, created_at?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6573,13 +6573,13 @@ export type Posts_On_Conflict = { export type Posts_Order_By = { author_id?: Maybe, - block_number?: Maybe, comments_aggregate?: Maybe, content?: Maybe, created_at?: Maybe, has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, + poll_block_number_end?: Maybe, post_reactions_aggregate?: Maybe, post_votes_aggregate?: Maybe, title?: Maybe, @@ -6596,11 +6596,11 @@ export type Posts_Pk_Columns_Input = { export enum Posts_Select_Column { AuthorId = 'author_id', - BlockNumber = 'block_number', Content = 'content', CreatedAt = 'created_at', HasPoll = 'has_poll', Id = 'id', + PollBlockNumberEnd = 'poll_block_number_end', Title = 'title', TopicId = 'topic_id', TypeId = 'type_id', @@ -6609,11 +6609,11 @@ export enum Posts_Select_Column { export type Posts_Set_Input = { author_id?: Maybe, - block_number?: Maybe, content?: Maybe, created_at?: Maybe, has_poll?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6623,16 +6623,16 @@ export type Posts_Set_Input = { export type Posts_Stddev_Fields = { __typename?: 'posts_stddev_fields', author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Stddev_Order_By = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6640,16 +6640,16 @@ export type Posts_Stddev_Order_By = { export type Posts_Stddev_Pop_Fields = { __typename?: 'posts_stddev_pop_fields', author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Stddev_Pop_Order_By = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6657,16 +6657,16 @@ export type Posts_Stddev_Pop_Order_By = { export type Posts_Stddev_Samp_Fields = { __typename?: 'posts_stddev_samp_fields', author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Stddev_Samp_Order_By = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6674,27 +6674,27 @@ export type Posts_Stddev_Samp_Order_By = { export type Posts_Sum_Fields = { __typename?: 'posts_sum_fields', author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Sum_Order_By = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export enum Posts_Update_Column { AuthorId = 'author_id', - BlockNumber = 'block_number', Content = 'content', CreatedAt = 'created_at', HasPoll = 'has_poll', Id = 'id', + PollBlockNumberEnd = 'poll_block_number_end', Title = 'title', TopicId = 'topic_id', TypeId = 'type_id', @@ -6704,16 +6704,16 @@ export enum Posts_Update_Column { export type Posts_Var_Pop_Fields = { __typename?: 'posts_var_pop_fields', author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Var_Pop_Order_By = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6721,16 +6721,16 @@ export type Posts_Var_Pop_Order_By = { export type Posts_Var_Samp_Fields = { __typename?: 'posts_var_samp_fields', author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Var_Samp_Order_By = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6738,16 +6738,16 @@ export type Posts_Var_Samp_Order_By = { export type Posts_Variance_Fields = { __typename?: 'posts_variance_fields', author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; export type Posts_Variance_Order_By = { author_id?: Maybe, - block_number?: Maybe, id?: Maybe, + poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -11970,7 +11970,7 @@ export type CreatePostMutationVariables = { topicId: Scalars['Int'], title: Scalars['String'], hasPoll?: Maybe, - blockNumber?: Maybe + pollBlockNumberEnd?: Maybe }; @@ -12002,10 +12002,10 @@ export type Post_TopicsQuery = ( )> } ); -export type Get_Current_Block_NumberQueryVariables = {}; +export type GetCurrentBlockNumberQueryVariables = {}; -export type Get_Current_Block_NumberQuery = ( +export type GetCurrentBlockNumberQuery = ( { __typename?: 'query_root' } & { blockNumbers: Array + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12116,7 +12116,7 @@ export type OnchainLinkMotionFragment = ( export type MotionPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12361,7 +12361,7 @@ export type OnchainLinkProposalFragment = ( export type ProposalPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12419,7 +12419,7 @@ export type OnchainLinkReferendumFragment = ( export type ReferendumPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12644,7 +12644,7 @@ export type OnchainLinkTreasuryProposalFragment = ( export type TreasuryProposalPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12783,7 +12783,7 @@ export const DiscussionPostFragmentDoc = gql` content created_at has_poll - block_number + poll_block_number_end id updated_at comments(order_by: {created_at: asc}) { @@ -12861,7 +12861,6 @@ export const MotionPostFragmentDoc = gql` } content created_at - block_number id updated_at comments(order_by: {created_at: asc}) { @@ -12917,7 +12916,6 @@ export const ProposalPostFragmentDoc = gql` } content created_at - block_number id updated_at comments(order_by: {created_at: asc}) { @@ -12978,7 +12976,6 @@ export const ReferendumPostFragmentDoc = gql` } content created_at - block_number id updated_at comments(order_by: {created_at: asc}) { @@ -13025,7 +13022,6 @@ export const TreasuryProposalPostFragmentDoc = gql` } content created_at - block_number id updated_at comments(order_by: {created_at: asc}) { @@ -13922,9 +13918,9 @@ export type Get_Refresh_TokenQueryHookResult = ReturnType; export type Get_Refresh_TokenQueryResult = ApolloReactCommon.QueryResult; export const CreatePostDocument = gql` - mutation createPost($userId: Int!, $content: String!, $topicId: Int!, $title: String!, $hasPoll: Boolean, $blockNumber: Int) { + mutation createPost($userId: Int!, $content: String!, $topicId: Int!, $title: String!, $hasPoll: Boolean, $pollBlockNumberEnd: Int) { __typename - insert_posts(objects: {author_id: $userId, content: $content, title: $title, topic_id: $topicId, has_poll: $hasPoll, block_number: $blockNumber}) { + insert_posts(objects: {author_id: $userId, content: $content, title: $title, topic_id: $topicId, has_poll: $hasPoll, poll_block_number_end: $pollBlockNumberEnd}) { affected_rows returning { id @@ -13952,7 +13948,7 @@ export type CreatePostMutationFn = ApolloReactCommon.MutationFunction; export type Post_TopicsLazyQueryHookResult = ReturnType; export type Post_TopicsQueryResult = ApolloReactCommon.QueryResult; -export const Get_Current_Block_NumberDocument = gql` - query Get_current_block_number { +export const GetCurrentBlockNumberDocument = gql` + query getCurrentBlockNumber { blockNumbers(orderBy: number_DESC, first: 1) { number } @@ -14003,29 +13999,29 @@ export const Get_Current_Block_NumberDocument = gql` `; /** - * __useGet_Current_Block_NumberQuery__ + * __useGetCurrentBlockNumberQuery__ * - * To run a query within a React component, call `useGet_Current_Block_NumberQuery` and pass it any options that fit your needs. - * When your component renders, `useGet_Current_Block_NumberQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `useGetCurrentBlockNumberQuery` and pass it any options that fit your needs. + * When your component renders, `useGetCurrentBlockNumberQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = useGet_Current_Block_NumberQuery({ + * const { data, loading, error } = useGetCurrentBlockNumberQuery({ * variables: { * }, * }); */ -export function useGet_Current_Block_NumberQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { - return ApolloReactHooks.useQuery(Get_Current_Block_NumberDocument, baseOptions); +export function useGetCurrentBlockNumberQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + return ApolloReactHooks.useQuery(GetCurrentBlockNumberDocument, baseOptions); } -export function useGet_Current_Block_NumberLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { - return ApolloReactHooks.useLazyQuery(Get_Current_Block_NumberDocument, baseOptions); +export function useGetCurrentBlockNumberLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + return ApolloReactHooks.useLazyQuery(GetCurrentBlockNumberDocument, baseOptions); } -export type Get_Current_Block_NumberQueryHookResult = ReturnType; -export type Get_Current_Block_NumberLazyQueryHookResult = ReturnType; -export type Get_Current_Block_NumberQueryResult = ApolloReactCommon.QueryResult; +export type GetCurrentBlockNumberQueryHookResult = ReturnType; +export type GetCurrentBlockNumberLazyQueryHookResult = ReturnType; +export type GetCurrentBlockNumberQueryResult = ApolloReactCommon.QueryResult; export const DiscussionPostAndCommentsDocument = gql` query DiscussionPostAndComments($id: Int!) { posts(where: {id: {_eq: $id}}) { diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index e21555299..70317de8e 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -11,7 +11,7 @@ import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; import { NotificationContext } from '../../context/NotificationContext'; import { UserDetailsContext } from '../../context/UserDetailsContext'; -import { useCreatePostMutation, useGet_Current_Block_NumberQuery, usePostSubscribeMutation } from '../../generated/graphql'; +import { useCreatePostMutation, useGetCurrentBlockNumberQuery, usePostSubscribeMutation } from '../../generated/graphql'; import { useRouter } from '../../hooks'; import { NotificationStatus } from '../../types'; import Button from '../../ui-components/Button'; @@ -32,7 +32,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const currentUser = useContext(UserDetailsContext); const { control, errors, handleSubmit } = useForm(); - const { data } = useGet_Current_Block_NumberQuery(); + const { data } = useGetCurrentBlockNumberQuery(); const [createPostMutation, { loading, error }] = useCreatePostMutation(); const [postSubscribeMutation] = usePostSubscribeMutation(); const [isSending, setIsSending] = useState(false); @@ -58,12 +58,13 @@ const CreatePost = ({ className }:Props): JSX.Element => { const handleSend = () => { const blockNumber = data?.blockNumbers?.[0]?.number; + const pollBlockNumberEnd = blockNumber; if (currentUser.id && title && content && selectedTopic){ setIsSending(true); createPostMutation({ variables: { - blockNumber, content, hasPoll: false, + pollBlockNumberEnd, title, topicId: selectedTopic, userId: currentUser.id diff --git a/front-end/src/screens/CreatePost/query.ts b/front-end/src/screens/CreatePost/query.ts index 32a26ab13..8913a6cd1 100644 --- a/front-end/src/screens/CreatePost/query.ts +++ b/front-end/src/screens/CreatePost/query.ts @@ -5,7 +5,7 @@ import gql from 'graphql-tag'; export const CREATE_POST = gql` - mutation createPost($userId: Int! $content: String! $topicId: Int! $title: String!, $hasPoll: Boolean, $blockNumber: Int) { + mutation createPost($userId: Int! $content: String! $topicId: Int! $title: String!, $hasPoll: Boolean, $pollBlockNumberEnd: Int) { __typename insert_posts(objects: { author_id: $userId, @@ -13,7 +13,7 @@ export const CREATE_POST = gql` title: $title, topic_id: $topicId, has_poll: $hasPoll, - block_number: $blockNumber + poll_block_number_end: $pollBlockNumberEnd }) { affected_rows returning { @@ -40,7 +40,7 @@ export const GET_POST_TOPICS = gql` `; export const GET_CURRENT_BLOCK_NUMBER = gql` - query Get_current_block_number { + query getCurrentBlockNumber { blockNumbers(orderBy: number_DESC, first: 1) { number } diff --git a/front-end/src/screens/DiscussionPost/query.ts b/front-end/src/screens/DiscussionPost/query.ts index c544d17e7..62342f145 100644 --- a/front-end/src/screens/DiscussionPost/query.ts +++ b/front-end/src/screens/DiscussionPost/query.ts @@ -25,7 +25,7 @@ const discussionPost = gql` content created_at has_poll - block_number + poll_block_number_end id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/MotionPost/query.ts b/front-end/src/screens/MotionPost/query.ts index 9a927ad78..b1866d747 100644 --- a/front-end/src/screens/MotionPost/query.ts +++ b/front-end/src/screens/MotionPost/query.ts @@ -67,7 +67,6 @@ const motionPost = gql` } content created_at - block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/ProposalPost/query.ts b/front-end/src/screens/ProposalPost/query.ts index 75451db08..985a8237c 100644 --- a/front-end/src/screens/ProposalPost/query.ts +++ b/front-end/src/screens/ProposalPost/query.ts @@ -42,7 +42,6 @@ const proposalPost = gql` } content created_at - block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/ReferendumPost/query.ts b/front-end/src/screens/ReferendumPost/query.ts index a19b26066..6f3bf46f0 100644 --- a/front-end/src/screens/ReferendumPost/query.ts +++ b/front-end/src/screens/ReferendumPost/query.ts @@ -47,7 +47,6 @@ const referendumPost = gql` } content created_at - block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/front-end/src/screens/TreasuryPost/query.ts b/front-end/src/screens/TreasuryPost/query.ts index efb759287..c301995b9 100644 --- a/front-end/src/screens/TreasuryPost/query.ts +++ b/front-end/src/screens/TreasuryPost/query.ts @@ -33,7 +33,6 @@ const treasuryProposalPost = gql` } content created_at - block_number id updated_at comments(order_by: {created_at: asc}) { diff --git a/hasura/hasura-migrations/migrations/1591588689454_alter_table_public_posts_alter_column_block_number/down.yaml b/hasura/hasura-migrations/migrations/1591588689454_alter_table_public_posts_alter_column_block_number/down.yaml new file mode 100644 index 000000000..b8aa46c81 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591588689454_alter_table_public_posts_alter_column_block_number/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."posts" rename column "poll_block_number_end" to "block_number"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591588689454_alter_table_public_posts_alter_column_block_number/up.yaml b/hasura/hasura-migrations/migrations/1591588689454_alter_table_public_posts_alter_column_block_number/up.yaml new file mode 100644 index 000000000..c128065ba --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591588689454_alter_table_public_posts_alter_column_block_number/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."posts" rename column "block_number" to "poll_block_number_end"; + type: run_sql From 696f700021294087c538e3e1219496ed7fc9d4f7 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 09:54:33 +0530 Subject: [PATCH 47/62] extracted reused code in function --- .../components/Post/Poll/CouncilSignals.tsx | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 062e91811..5e36739c3 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -2,6 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { QueryResult } from '@apollo/react-common'; import styled from '@xstyled/styled-components'; import React, { useEffect, useState } from 'react'; import { Grid, Icon } from 'semantic-ui-react'; @@ -9,7 +10,7 @@ import { chainProperties } from 'src/global/networkConstants'; import HelperTooltip from 'src/ui-components/HelperTooltip'; import getNetwork from 'src/util/getNetwork'; -import { PostVotesQuery, useCouncilAtBlockNumberQuery, useGetCurrentBlockNumberQuery } from '../../../generated/graphql'; +import { CouncilAtBlockNumberQuery, CouncilAtBlockNumberQueryVariables,PostVotesQuery, useCouncilAtBlockNumberQuery, useGetCurrentBlockNumberQuery } from '../../../generated/graphql'; import { OffchainVote, Vote } from '../../../types'; import Address from '../../../ui-components/Address'; import Card from '../../../ui-components/Card'; @@ -34,27 +35,26 @@ const CouncilSignals = ({ className, blockNumber, data }: Props) => { const councilAtCurrentBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0 } }); const TWO_WEEKS = chainProperties?.[network]?.twoWeeksBlocks; + const getCouncilMembers = (councilAtBlockNumber: QueryResult): Set => { + const memberSet = new Set(); + councilAtBlockNumber?.data?.councils?.[0]?.members?.forEach((member) => { + const address = getEncodedAddress(member.address); + if (address) { + memberSet.add(address); + } + }); + return memberSet; + }; + useEffect(() => { const currentBlock = currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0; const pollClosingBlockNumber = (blockNumber || 0) + TWO_WEEKS; - - const memberSet = new Set(); + let memberSet = new Set(); if (pollClosingBlockNumber > currentBlock) { - councilAtCurrentBlockNumber?.data?.councils?.[0]?.members?.forEach((member) => { - const address = getEncodedAddress(member.address); - if (address) { - memberSet.add(address); - } - }); + memberSet = getCouncilMembers(councilAtCurrentBlockNumber); } else { - councilAtPostBlockNumber?.data?.councils?.[0]?.members?.forEach((member) => { - const address = getEncodedAddress(member.address); - - if (address) { - memberSet.add(address); - } - }); + memberSet = getCouncilMembers(councilAtPostBlockNumber); } setMemberSet(memberSet); From ef206d8447ac5d2a267d83ca390384345791d7c5 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 10:15:30 +0530 Subject: [PATCH 48/62] Uncommented poll --- .../components/Post/Poll/CouncilSignals.tsx | 16 ++++++-------- front-end/src/components/Post/Poll/index.tsx | 6 +++--- front-end/src/components/Post/Post.tsx | 21 +++++++++---------- front-end/src/screens/CreatePost/index.tsx | 12 +++++------ 4 files changed, 25 insertions(+), 30 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index 5e36739c3..fe0338d9e 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -6,9 +6,7 @@ import { QueryResult } from '@apollo/react-common'; import styled from '@xstyled/styled-components'; import React, { useEffect, useState } from 'react'; import { Grid, Icon } from 'semantic-ui-react'; -import { chainProperties } from 'src/global/networkConstants'; import HelperTooltip from 'src/ui-components/HelperTooltip'; -import getNetwork from 'src/util/getNetwork'; import { CouncilAtBlockNumberQuery, CouncilAtBlockNumberQueryVariables,PostVotesQuery, useCouncilAtBlockNumberQuery, useGetCurrentBlockNumberQuery } from '../../../generated/graphql'; import { OffchainVote, Vote } from '../../../types'; @@ -21,19 +19,17 @@ import getEncodedAddress from '../../../util/getEncodedAddress'; interface Props { className?: string data?: PostVotesQuery | undefined - blockNumber?: number + pollBlockNumberEnd?: number | null | undefined } -const CouncilSignals = ({ className, blockNumber, data }: Props) => { - const network = getNetwork(); +const CouncilSignals = ({ className, pollBlockNumberEnd, data }: Props) => { const [ayes, setAyes] = useState(0); const [nays, setNays] = useState(0); const [memberSet, setMemberSet] = useState>(new Set()); const [councilVotes, setCouncilVotes] = useState([]); const currentBlockNumber = useGetCurrentBlockNumberQuery(); - const councilAtPostBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: blockNumber || 0 } }); + const councilAtPollEndBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: pollBlockNumberEnd || 0 } }); const councilAtCurrentBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0 } }); - const TWO_WEEKS = chainProperties?.[network]?.twoWeeksBlocks; const getCouncilMembers = (councilAtBlockNumber: QueryResult): Set => { const memberSet = new Set(); @@ -48,17 +44,17 @@ const CouncilSignals = ({ className, blockNumber, data }: Props) => { useEffect(() => { const currentBlock = currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0; - const pollClosingBlockNumber = (blockNumber || 0) + TWO_WEEKS; + const pollClosingBlockNumber = pollBlockNumberEnd || 0; let memberSet = new Set(); if (pollClosingBlockNumber > currentBlock) { memberSet = getCouncilMembers(councilAtCurrentBlockNumber); } else { - memberSet = getCouncilMembers(councilAtPostBlockNumber); + memberSet = getCouncilMembers(councilAtPollEndBlockNumber); } setMemberSet(memberSet); - }, [blockNumber, currentBlockNumber, councilAtPostBlockNumber, councilAtCurrentBlockNumber, TWO_WEEKS]); + }, [pollBlockNumberEnd, currentBlockNumber, councilAtPollEndBlockNumber, councilAtCurrentBlockNumber]); useEffect(() => { let ayes = 0; diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index 59bfadabd..12ecedff9 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -14,10 +14,10 @@ import GeneralSignals from './GeneralSignals'; interface Props { postId: number - blockNumber?: number + pollBlockNumberEnd?: number | null | undefined } -const Poll = ({ postId, blockNumber }: Props) => { +const Poll = ({ postId, pollBlockNumberEnd }: Props) => { const { id } = useContext(UserDetailsContext); const { data, error, refetch } = usePostVotesQuery({ variables: { postId } }); let ayes = 0; @@ -47,7 +47,7 @@ const Poll = ({ postId, blockNumber }: Props) => { postId={postId} refetch={refetch} /> - + ); }; diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index 647f9329f..d1eda43f0 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -12,7 +12,7 @@ import { DiscussionPostAndCommentsQuery, DiscussionPostAndCommentsQueryHookResult, DiscussionPostAndCommentsQueryVariables, - // DiscussionPostFragment, + DiscussionPostFragment, MotionPostAndCommentsQuery, MotionPostAndCommentsQueryHookResult, MotionPostAndCommentsQueryVariables, @@ -41,7 +41,7 @@ import PostReactionBar from '../Reactionbar/PostReactionBar'; import ReportButton from '../ReportButton'; import SubscriptionButton from '../SubscriptionButton/SubscriptionButton'; import GovenanceSideBar from './GovernanceSideBar'; -// import Poll from './Poll'; +import Poll from './Poll'; import CreatePostComment from './PostCommentForm'; import PostMotionInfo from './PostGovernanceInfo/PostMotionInfo'; import PostProposalInfo from './PostGovernanceInfo/PostProposalInfo'; @@ -85,7 +85,6 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere let treasuryPost: TreasuryProposalPostFragment | undefined; let definedOnchainLink : OnchainLinkMotionFragment | OnchainLinkReferendumFragment | OnchainLinkProposalFragment | OnchainLinkTreasuryProposalFragment | undefined; let postStatus: string | undefined; - // let hasPoll = false; if (isReferendum){ referendumPost = post as ReferendumPostFragment; @@ -115,14 +114,14 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere postStatus = treasuryPost?.onchain_link?.onchain_treasury_spend_proposal?.[0]?.treasuryStatus?.[0].status; } - // const isDiscussion = (post: TreasuryProposalPostFragment | MotionPostFragment | ProposalPostFragment | DiscussionPostFragment | ReferendumPostFragment): post is DiscussionPostFragment => { - // if (!isReferendum && !isProposal && !isMotion && !isTreasuryProposal) { - // // eslint-disable-next-line no-extra-parens - // return (post as DiscussionPostFragment) !== undefined; - // } + const isDiscussion = (post: TreasuryProposalPostFragment | MotionPostFragment | ProposalPostFragment | DiscussionPostFragment | ReferendumPostFragment): post is DiscussionPostFragment => { + if (!isReferendum && !isProposal && !isMotion && !isTreasuryProposal) { + // eslint-disable-next-line no-extra-parens + return (post as DiscussionPostFragment) !== undefined; + } - // return false; - // }; + return false; + }; const isProposalProposer = isProposal && proposalPost?.onchain_link?.proposer_address && addresses?.includes(proposalPost.onchain_link.proposer_address); const isReferendumProposer = isReferendum && referendumPost?.onchain_link?.proposer_address && addresses?.includes(referendumPost.onchain_link.proposer_address); @@ -195,7 +194,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {/* {isDiscussion(post) && post.has_poll && } */} + {isDiscussion(post) && post.has_poll && } ); diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index 70317de8e..9f253d3ed 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -5,7 +5,7 @@ import styled from '@xstyled/styled-components'; import React, { useContext, useState } from 'react'; import { Controller,useForm } from 'react-hook-form'; -import { /* Checkbox, CheckboxProps,*/ Grid } from 'semantic-ui-react'; +import { Checkbox, CheckboxProps, Grid } from 'semantic-ui-react'; import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; @@ -26,7 +26,7 @@ interface Props { const CreatePost = ({ className }:Props): JSX.Element => { const [title, setTitle] = useState(''); const [content, setContent] = useState(''); - // const [hasPoll, setHasPoll] = useState(false); + const [hasPoll, setHasPoll] = useState(false); const { queueNotification } = useContext(NotificationContext); const [selectedTopic, setSetlectedTopic] = useState(1); const currentUser = useContext(UserDetailsContext); @@ -63,7 +63,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { setIsSending(true); createPostMutation({ variables: { content, - hasPoll: false, + hasPoll, pollBlockNumberEnd, title, topicId: selectedTopic, @@ -89,7 +89,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const onTitleChange = (event: React.ChangeEvent[]) => {setTitle(event[0].currentTarget.value); return event[0].currentTarget.value;}; const onContentChange = (data: Array) => {setContent(data[0]); return data[0].length ? data[0] : null;}; - // const onPollChanged = (event: React.FormEvent, data: CheckboxProps) => { setHasPoll(data.checked || false);}; + const onPollChanged = (event: React.FormEvent, data: CheckboxProps) => { setHasPoll(data.checked || false);}; return ( @@ -115,11 +115,11 @@ const CreatePost = ({ className }:Props): JSX.Element => { rules={{ required: true }} /> - {/* + - */} + setSetlectedTopic(id)} From 76c54961fa544928e506503f81827592a91674ec Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 10:17:54 +0530 Subject: [PATCH 49/62] removed twoWeekBlocks --- front-end/src/global/networkConstants.ts | 6 ++---- front-end/src/types.ts | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/front-end/src/global/networkConstants.ts b/front-end/src/global/networkConstants.ts index 12cd11e27..1edb8cad0 100644 --- a/front-end/src/global/networkConstants.ts +++ b/front-end/src/global/networkConstants.ts @@ -19,14 +19,12 @@ export const chainProperties: ChainPropType = { blockTime: 6000, ss58Format: 2, tokenDecimals: 12, - tokenSymbol: tokenSymbol.KSM, - twoWeeksBlocks: 201600 + tokenSymbol: tokenSymbol.KSM }, [network.POLKADOT]: { blockTime: 6000, ss58Format: 1, tokenDecimals: 18, - tokenSymbol: tokenSymbol.DOT, - twoWeeksBlocks: 201600 // TODO: change for polkadot + tokenSymbol: tokenSymbol.DOT } }; diff --git a/front-end/src/types.ts b/front-end/src/types.ts index 31cb5a558..a3ebba461 100644 --- a/front-end/src/types.ts +++ b/front-end/src/types.ts @@ -114,7 +114,6 @@ export interface ChainProps { 'ss58Format': number; 'tokenDecimals': number; 'tokenSymbol': TokenSymbol; - 'twoWeeksBlocks': number; } export interface LoadingStatusType { From 5e03e88fc8c8bf9199e76850ddadb91f38de5cb7 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 10:32:54 +0530 Subject: [PATCH 50/62] Calculating end block --- front-end/src/screens/CreatePost/index.tsx | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index 9f253d3ed..366d7acdd 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -2,10 +2,13 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { ApiPromiseContext } from '@substrate/context'; import styled from '@xstyled/styled-components'; -import React, { useContext, useState } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import { Controller,useForm } from 'react-hook-form'; import { Checkbox, CheckboxProps, Grid } from 'semantic-ui-react'; +import { chainProperties } from 'src/global/networkConstants'; +import getNetwork from 'src/util/getNetwork'; import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; @@ -23,6 +26,8 @@ interface Props { className?: string } +const TWO_WEEKS = 2 * 7 * 24 * 60 * 60 * 1000; + const CreatePost = ({ className }:Props): JSX.Element => { const [title, setTitle] = useState(''); const [content, setContent] = useState(''); @@ -31,6 +36,10 @@ const CreatePost = ({ className }:Props): JSX.Element => { const [selectedTopic, setSetlectedTopic] = useState(1); const currentUser = useContext(UserDetailsContext); const { control, errors, handleSubmit } = useForm(); + const network = getNetwork(); + const { api, isApiReady } = useContext(ApiPromiseContext); + const DEFAULT_TIME = chainProperties?.[network]?.blockTime; + const [blocktime, setBlocktime] = useState(DEFAULT_TIME); const { data } = useGetCurrentBlockNumberQuery(); const [createPostMutation, { loading, error }] = useCreatePostMutation(); @@ -38,6 +47,15 @@ const CreatePost = ({ className }:Props): JSX.Element => { const [isSending, setIsSending] = useState(false); const { history } = useRouter(); + useEffect(() => { + + if (!isApiReady) { + return; + } + + setBlocktime(api.consts.babe?.expectedBlockTime.toNumber()); + }, [api, isApiReady]); + const createSubscription = (postId: number) => { if (!currentUser?.notification?.postCreated) { return; @@ -56,9 +74,15 @@ const CreatePost = ({ className }:Props): JSX.Element => { .catch((e) => console.error('Error subscribing to post',e)); }; + const getEndBlockNumber = (currentBlock: number | undefined): number => { + const endBlock = Math.floor(TWO_WEEKS/blocktime); + + return (currentBlock || 0) + endBlock; + }; + const handleSend = () => { const blockNumber = data?.blockNumbers?.[0]?.number; - const pollBlockNumberEnd = blockNumber; + const pollBlockNumberEnd = getEndBlockNumber(blockNumber); if (currentUser.id && title && content && selectedTopic){ setIsSending(true); createPostMutation({ variables: { From ddda1645f63e46062310aa1c9673a77631fccaf3 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 10:37:57 +0530 Subject: [PATCH 51/62] fix --- front-end/src/screens/CreatePost/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index 366d7acdd..1eda069eb 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -141,7 +141,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { - + From 6bce7d4d65f0bf4527c74905102f6f0016ad6e9c Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 18:40:51 +0530 Subject: [PATCH 52/62] Added blocktime context --- front-end/src/App.tsx | 159 ++++++++++---------- front-end/src/components/BlockCountdown.tsx | 11 +- front-end/src/components/BlocksToTime.tsx | 26 +--- front-end/src/context/BlockTimeContext.tsx | 38 +++++ front-end/src/screens/CreatePost/index.tsx | 20 +-- front-end/src/types.ts | 3 + 6 files changed, 134 insertions(+), 123 deletions(-) create mode 100644 front-end/src/context/BlockTimeContext.tsx diff --git a/front-end/src/App.tsx b/front-end/src/App.tsx index c7f98fd74..0e2504e75 100644 --- a/front-end/src/App.tsx +++ b/front-end/src/App.tsx @@ -14,6 +14,7 @@ import Footer from './components/Footer'; import MenuBar from './components/MenuBar'; import Modal from './components/Modal'; import Notifications from './components/Notifications'; +import { BlockTimeProvider } from './context/BlockTimeContext'; import { ModalProvider } from './context/ModalContext'; import { NotificationProvider } from './context/NotificationContext'; import { UserDetailsProvider } from './context/UserDetailsContext'; @@ -57,84 +58,86 @@ const App = () => { - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/front-end/src/components/BlockCountdown.tsx b/front-end/src/components/BlockCountdown.tsx index 8d415fed6..68964682d 100644 --- a/front-end/src/components/BlockCountdown.tsx +++ b/front-end/src/components/BlockCountdown.tsx @@ -7,9 +7,8 @@ import styled from '@xstyled/styled-components'; import BN from 'bn.js'; import React, { useContext, useEffect, useState } from 'react'; import { Popup } from 'semantic-ui-react'; -import { chainProperties } from 'src/global/networkConstants'; +import { BlockTimeContext } from 'src/context/BlockTimeContext'; import blockToTime from 'src/util/blockToTime'; -import getNetwork from 'src/util/getNetwork'; interface Props { className?: string @@ -22,13 +21,11 @@ const DivContent = styled.div` `; const BlockCountdown = ({ className, endBlock }:Props ) => { - const network = getNetwork(); const ZERO = new BN(0); const { api, isApiReady } = useContext(ApiPromiseContext); const [currentBlock, setCurrentBlock] = useState(ZERO); const blocksRemaining = endBlock - currentBlock.toNumber(); - const DEFAULT_TIME = chainProperties?.[network]?.blockTime; - const [blocktime, setBlocktime] = useState(DEFAULT_TIME); + const { blocktime } = useContext(BlockTimeContext); useEffect(() => { if (!isApiReady) { @@ -37,8 +34,6 @@ const BlockCountdown = ({ className, endBlock }:Props ) => { let unsubscribe: () => void; - setBlocktime(api.consts.babe?.expectedBlockTime.toNumber()); - api.derive.chain.bestNumber((number) => { setCurrentBlock(number); }) @@ -59,4 +54,4 @@ const BlockCountdown = ({ className, endBlock }:Props ) => { ); }; -export default BlockCountdown; \ No newline at end of file +export default BlockCountdown; diff --git a/front-end/src/components/BlocksToTime.tsx b/front-end/src/components/BlocksToTime.tsx index 5ce74dab6..b42560edc 100644 --- a/front-end/src/components/BlocksToTime.tsx +++ b/front-end/src/components/BlocksToTime.tsx @@ -1,15 +1,13 @@ // Copyright 2019-2020 @paritytech/polkassembly authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { ApiPromiseContext } from '@substrate/context'; + import styled from '@xstyled/styled-components'; import BN from 'bn.js'; -import React, { useContext, useState } from 'react'; -import { useEffect } from 'react'; +import React, { useContext } from 'react'; import { Popup } from 'semantic-ui-react'; -import { chainProperties } from 'src/global/networkConstants'; +import { BlockTimeContext } from 'src/context/BlockTimeContext'; import blockToTime from 'src/util/blockToTime'; -import getNetwork from 'src/util/getNetwork'; interface Props { blocks: number | BN; @@ -22,24 +20,12 @@ const DivContent = styled.div` `; const BlocksToTime = ({ blocks, className }:Props ) => { - const network = getNetwork(); - const { api, isApiReady } = useContext(ApiPromiseContext); - const DEFAULT_TIME = chainProperties?.[network]?.blockTime; - const [blocktime, setBlocktime] = useState(DEFAULT_TIME); - - useEffect(() => { - - if (!isApiReady) { - return; - } - - setBlocktime(api.consts.babe?.expectedBlockTime.toNumber()); - }, [ api, isApiReady]); + const { blocktime } = useContext(BlockTimeContext); return ( {blockToTime(blocks , blocktime)}
} + trigger={
{blockToTime(blocks, blocktime)}
} content={{`${blocks} blocks`}} hoverable={true} position='top left' @@ -47,4 +33,4 @@ const BlocksToTime = ({ blocks, className }:Props ) => { ); }; -export default BlocksToTime; \ No newline at end of file +export default BlocksToTime; diff --git a/front-end/src/context/BlockTimeContext.tsx b/front-end/src/context/BlockTimeContext.tsx new file mode 100644 index 000000000..2f328040c --- /dev/null +++ b/front-end/src/context/BlockTimeContext.tsx @@ -0,0 +1,38 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { ApiPromiseContext } from '@substrate/context'; +import React, { createContext, useContext, useEffect, useState } from 'react'; +import { chainProperties } from 'src/global/networkConstants'; +import getNetwork from 'src/util/getNetwork'; + +import { BlockTimeContextType } from '../types'; + +const network = getNetwork(); +const DEFAULT_TIME = chainProperties?.[network]?.blockTime; + +const initialBlockTimeContext: BlockTimeContextType = { + blocktime: DEFAULT_TIME +}; + +export const BlockTimeContext = createContext(initialBlockTimeContext); + +export const BlockTimeProvider = ({ children }: React.PropsWithChildren<{}>) => { + const { api, isApiReady } = useContext(ApiPromiseContext); + const [blocktime, setBlocktime] = useState(DEFAULT_TIME); + + useEffect(() => { + if (!isApiReady) { + return; + } + + setBlocktime(api.consts.babe?.expectedBlockTime.toNumber()); + }, [api, isApiReady]); + + return ( + + {children} + + ); +}; diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index 1eda069eb..b4ff3aa3b 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -2,16 +2,14 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { ApiPromiseContext } from '@substrate/context'; import styled from '@xstyled/styled-components'; -import React, { useContext, useEffect, useState } from 'react'; +import React, { useContext, useState } from 'react'; import { Controller,useForm } from 'react-hook-form'; import { Checkbox, CheckboxProps, Grid } from 'semantic-ui-react'; -import { chainProperties } from 'src/global/networkConstants'; -import getNetwork from 'src/util/getNetwork'; import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; +import { BlockTimeContext } from '../../context/BlockTimeContext'; import { NotificationContext } from '../../context/NotificationContext'; import { UserDetailsContext } from '../../context/UserDetailsContext'; import { useCreatePostMutation, useGetCurrentBlockNumberQuery, usePostSubscribeMutation } from '../../generated/graphql'; @@ -36,10 +34,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const [selectedTopic, setSetlectedTopic] = useState(1); const currentUser = useContext(UserDetailsContext); const { control, errors, handleSubmit } = useForm(); - const network = getNetwork(); - const { api, isApiReady } = useContext(ApiPromiseContext); - const DEFAULT_TIME = chainProperties?.[network]?.blockTime; - const [blocktime, setBlocktime] = useState(DEFAULT_TIME); + const { blocktime } = useContext(BlockTimeContext); const { data } = useGetCurrentBlockNumberQuery(); const [createPostMutation, { loading, error }] = useCreatePostMutation(); @@ -47,15 +42,6 @@ const CreatePost = ({ className }:Props): JSX.Element => { const [isSending, setIsSending] = useState(false); const { history } = useRouter(); - useEffect(() => { - - if (!isApiReady) { - return; - } - - setBlocktime(api.consts.babe?.expectedBlockTime.toNumber()); - }, [api, isApiReady]); - const createSubscription = (postId: number) => { if (!currentUser?.notification?.postCreated) { return; diff --git a/front-end/src/types.ts b/front-end/src/types.ts index a3ebba461..f1f94c4ea 100644 --- a/front-end/src/types.ts +++ b/front-end/src/types.ts @@ -149,3 +149,6 @@ export interface ReactionMapFields { userNames: string[] } +export interface BlockTimeContextType { + blocktime: number +} From 03bc0b219ef954236311f44b4d7a57bf034d5d17 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 19:45:57 +0530 Subject: [PATCH 53/62] using hook instead of context for getting block time --- front-end/src/App.tsx | 159 ++++++++++---------- front-end/src/components/BlockCountdown.tsx | 4 +- front-end/src/components/BlocksToTime.tsx | 6 +- front-end/src/context/BlockTimeContext.tsx | 38 ----- front-end/src/hooks/index.ts | 1 + front-end/src/hooks/useBlockTime.ts | 27 ++++ front-end/src/screens/CreatePost/index.tsx | 7 +- front-end/src/types.ts | 4 - 8 files changed, 114 insertions(+), 132 deletions(-) delete mode 100644 front-end/src/context/BlockTimeContext.tsx create mode 100644 front-end/src/hooks/useBlockTime.ts diff --git a/front-end/src/App.tsx b/front-end/src/App.tsx index 0e2504e75..c7f98fd74 100644 --- a/front-end/src/App.tsx +++ b/front-end/src/App.tsx @@ -14,7 +14,6 @@ import Footer from './components/Footer'; import MenuBar from './components/MenuBar'; import Modal from './components/Modal'; import Notifications from './components/Notifications'; -import { BlockTimeProvider } from './context/BlockTimeContext'; import { ModalProvider } from './context/ModalContext'; import { NotificationProvider } from './context/NotificationContext'; import { UserDetailsProvider } from './context/UserDetailsContext'; @@ -58,86 +57,84 @@ const App = () => { - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
diff --git a/front-end/src/components/BlockCountdown.tsx b/front-end/src/components/BlockCountdown.tsx index 68964682d..69f540e38 100644 --- a/front-end/src/components/BlockCountdown.tsx +++ b/front-end/src/components/BlockCountdown.tsx @@ -7,7 +7,7 @@ import styled from '@xstyled/styled-components'; import BN from 'bn.js'; import React, { useContext, useEffect, useState } from 'react'; import { Popup } from 'semantic-ui-react'; -import { BlockTimeContext } from 'src/context/BlockTimeContext'; +import { useBlockTime } from 'src/hooks'; import blockToTime from 'src/util/blockToTime'; interface Props { @@ -25,7 +25,7 @@ const BlockCountdown = ({ className, endBlock }:Props ) => { const { api, isApiReady } = useContext(ApiPromiseContext); const [currentBlock, setCurrentBlock] = useState(ZERO); const blocksRemaining = endBlock - currentBlock.toNumber(); - const { blocktime } = useContext(BlockTimeContext); + const { blocktime } = useBlockTime(); useEffect(() => { if (!isApiReady) { diff --git a/front-end/src/components/BlocksToTime.tsx b/front-end/src/components/BlocksToTime.tsx index b42560edc..5feccbc93 100644 --- a/front-end/src/components/BlocksToTime.tsx +++ b/front-end/src/components/BlocksToTime.tsx @@ -4,9 +4,9 @@ import styled from '@xstyled/styled-components'; import BN from 'bn.js'; -import React, { useContext } from 'react'; +import React from 'react'; import { Popup } from 'semantic-ui-react'; -import { BlockTimeContext } from 'src/context/BlockTimeContext'; +import { useBlockTime } from 'src/hooks'; import blockToTime from 'src/util/blockToTime'; interface Props { @@ -20,7 +20,7 @@ const DivContent = styled.div` `; const BlocksToTime = ({ blocks, className }:Props ) => { - const { blocktime } = useContext(BlockTimeContext); + const { blocktime } = useBlockTime(); return ( ) => { - const { api, isApiReady } = useContext(ApiPromiseContext); - const [blocktime, setBlocktime] = useState(DEFAULT_TIME); - - useEffect(() => { - if (!isApiReady) { - return; - } - - setBlocktime(api.consts.babe?.expectedBlockTime.toNumber()); - }, [api, isApiReady]); - - return ( - - {children} - - ); -}; diff --git a/front-end/src/hooks/index.ts b/front-end/src/hooks/index.ts index 8067a5a77..32da1e746 100644 --- a/front-end/src/hooks/index.ts +++ b/front-end/src/hooks/index.ts @@ -4,3 +4,4 @@ export { default as useRouter } from './useRouter'; export { default as useRedirectGovernancePost } from './useRedirectGovernancePost'; +export { default as useBlockTime } from './useBlockTime'; diff --git a/front-end/src/hooks/useBlockTime.ts b/front-end/src/hooks/useBlockTime.ts new file mode 100644 index 000000000..55a831cc3 --- /dev/null +++ b/front-end/src/hooks/useBlockTime.ts @@ -0,0 +1,27 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { ApiPromiseContext } from '@substrate/context'; +import { useContext, useMemo } from 'react'; +import { chainProperties } from 'src/global/networkConstants'; +import getNetwork from 'src/util/getNetwork'; + +const network = getNetwork(); +const DEFAULT_TIME = chainProperties?.[network]?.blockTime; + +export default function () { + const { api, isApiReady } = useContext(ApiPromiseContext); + + return useMemo(() => { + if (!isApiReady) { + return { + blocktime: DEFAULT_TIME + }; + } + + return { + blocktime: api.consts.babe?.expectedBlockTime.toNumber() + }; + }, [api, isApiReady]); +} diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index b4ff3aa3b..698e1d76c 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -9,11 +9,10 @@ import { Checkbox, CheckboxProps, Grid } from 'semantic-ui-react'; import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; -import { BlockTimeContext } from '../../context/BlockTimeContext'; import { NotificationContext } from '../../context/NotificationContext'; import { UserDetailsContext } from '../../context/UserDetailsContext'; import { useCreatePostMutation, useGetCurrentBlockNumberQuery, usePostSubscribeMutation } from '../../generated/graphql'; -import { useRouter } from '../../hooks'; +import { useBlockTime, useRouter } from '../../hooks'; import { NotificationStatus } from '../../types'; import Button from '../../ui-components/Button'; import FilteredError from '../../ui-components/FilteredError'; @@ -34,7 +33,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const [selectedTopic, setSetlectedTopic] = useState(1); const currentUser = useContext(UserDetailsContext); const { control, errors, handleSubmit } = useForm(); - const { blocktime } = useContext(BlockTimeContext); + const { blocktime } = useBlockTime(); const { data } = useGetCurrentBlockNumberQuery(); const [createPostMutation, { loading, error }] = useCreatePostMutation(); @@ -61,7 +60,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { }; const getEndBlockNumber = (currentBlock: number | undefined): number => { - const endBlock = Math.floor(TWO_WEEKS/blocktime); + const endBlock = Math.floor(TWO_WEEKS / blocktime); return (currentBlock || 0) + endBlock; }; diff --git a/front-end/src/types.ts b/front-end/src/types.ts index f1f94c4ea..9b7ebb459 100644 --- a/front-end/src/types.ts +++ b/front-end/src/types.ts @@ -148,7 +148,3 @@ export interface ReactionMapFields { count: number userNames: string[] } - -export interface BlockTimeContextType { - blocktime: number -} From d49b4828b79655742bbe9841e097a95f9252cf4d Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 20:24:21 +0530 Subject: [PATCH 54/62] not using default 0 --- .../src/components/Post/Poll/CouncilSignals.tsx | 15 ++++++++------- front-end/src/components/Post/Poll/index.tsx | 2 +- front-end/src/components/Post/Post.tsx | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index fe0338d9e..b9d5ae407 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -19,7 +19,7 @@ import getEncodedAddress from '../../../util/getEncodedAddress'; interface Props { className?: string data?: PostVotesQuery | undefined - pollBlockNumberEnd?: number | null | undefined + pollBlockNumberEnd: number } const CouncilSignals = ({ className, pollBlockNumberEnd, data }: Props) => { @@ -27,9 +27,11 @@ const CouncilSignals = ({ className, pollBlockNumberEnd, data }: Props) => { const [nays, setNays] = useState(0); const [memberSet, setMemberSet] = useState>(new Set()); const [councilVotes, setCouncilVotes] = useState([]); - const currentBlockNumber = useGetCurrentBlockNumberQuery(); - const councilAtPollEndBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: pollBlockNumberEnd || 0 } }); - const councilAtCurrentBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0 } }); + const currentBlockNumberResult = useGetCurrentBlockNumberQuery(); + const currentBlockNumber = currentBlockNumberResult?.data?.blockNumbers?.[0]?.number || pollBlockNumberEnd; + + const councilAtPollEndBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: pollBlockNumberEnd } }); + const councilAtCurrentBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: currentBlockNumber } }); const getCouncilMembers = (councilAtBlockNumber: QueryResult): Set => { const memberSet = new Set(); @@ -43,11 +45,10 @@ const CouncilSignals = ({ className, pollBlockNumberEnd, data }: Props) => { }; useEffect(() => { - const currentBlock = currentBlockNumber?.data?.blockNumbers?.[0]?.number || 0; - const pollClosingBlockNumber = pollBlockNumberEnd || 0; + const pollClosingBlockNumber = pollBlockNumberEnd; let memberSet = new Set(); - if (pollClosingBlockNumber > currentBlock) { + if (pollClosingBlockNumber > currentBlockNumber) { memberSet = getCouncilMembers(councilAtCurrentBlockNumber); } else { memberSet = getCouncilMembers(councilAtPollEndBlockNumber); diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index 12ecedff9..1926d2d43 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -14,7 +14,7 @@ import GeneralSignals from './GeneralSignals'; interface Props { postId: number - pollBlockNumberEnd?: number | null | undefined + pollBlockNumberEnd: number } const Poll = ({ postId, pollBlockNumberEnd }: Props) => { diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index feb0295db..13a47797f 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -194,7 +194,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {isDiscussion(post) && post.has_poll && } + {isDiscussion(post) && post.has_poll && post.poll_block_number_end && } From 20c6df928a9ed8ade4bce2307322f6b37fa3b97c Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Mon, 8 Jun 2020 20:33:50 +0530 Subject: [PATCH 55/62] showing error on no block number --- front-end/src/screens/CreatePost/index.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index 698e1d76c..7224bbbfb 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -59,15 +59,19 @@ const CreatePost = ({ className }:Props): JSX.Element => { .catch((e) => console.error('Error subscribing to post',e)); }; - const getEndBlockNumber = (currentBlock: number | undefined): number => { - const endBlock = Math.floor(TWO_WEEKS / blocktime); - - return (currentBlock || 0) + endBlock; - }; - const handleSend = () => { const blockNumber = data?.blockNumbers?.[0]?.number; - const pollBlockNumberEnd = getEndBlockNumber(blockNumber); + + if (!blockNumber) { + return queueNotification({ + header: 'Failed to get current block number!', + message: 'Failed', + status: NotificationStatus.ERROR + }); + } + + const pollBlockNumberEnd = blockNumber + Math.floor(TWO_WEEKS / blocktime); + if (currentUser.id && title && content && selectedTopic){ setIsSending(true); createPostMutation({ variables: { From 9ed3947a43c794b6eb3d64b4d002688c4296dc23 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Tue, 9 Jun 2020 20:34:50 +0530 Subject: [PATCH 56/62] Moved poll table --- .../components/Post/Poll/CouncilSignals.tsx | 18 +- .../components/Post/Poll/GeneralSignals.tsx | 22 +- front-end/src/components/Post/Poll/Poll.tsx | 55 + front-end/src/components/Post/Poll/index.tsx | 45 +- front-end/src/components/Post/Poll/query.ts | 44 +- front-end/src/components/Post/Post.tsx | 2 +- front-end/src/generated/graphql.tsx | 1887 ++++++++++------- front-end/src/screens/CreatePost/index.tsx | 35 +- front-end/src/screens/CreatePost/query.ts | 13 +- front-end/src/screens/DiscussionPost/query.ts | 2 - .../down.yaml | 5 + .../up.yaml | 10 + .../down.yaml | 5 + .../up.yaml | 5 + .../down.yaml | 5 + .../up.yaml | 10 + .../down.yaml | 6 + .../up.yaml | 8 + .../down.yaml | 5 + .../up.yaml | 13 + .../down.yaml | 6 + .../up.yaml | 8 + .../down.yaml | 6 + .../up.yaml | 13 + .../down.yaml | 6 + .../up.yaml | 12 + .../down.yaml | 6 + .../up.yaml | 12 + .../down.yaml | 12 + .../up.yaml | 6 + .../down.yaml | 5 + .../up.yaml | 6 + .../down.yaml | 5 + .../up.yaml | 6 + .../down.yaml | 6 + .../up.yaml | 17 + .../down.yaml | 12 + .../up.yaml | 36 + .../down.yaml | 6 + .../up.yaml | 17 + .../down.yaml | 6 + .../up.yaml | 19 + .../down.yaml | 6 + .../up.yaml | 19 + .../down.yaml | 6 + .../up.yaml | 17 + .../down.yaml | 12 + .../up.yaml | 38 + .../down.yaml | 6 + .../up.yaml | 19 + .../down.yaml | 27 + .../up.yaml | 25 + .../down.yaml | 28 + .../up.yaml | 26 + .../down.yaml | 25 + .../up.yaml | 23 + .../down.yaml | 27 + .../up.yaml | 25 + .../down.yaml | 27 + .../up.yaml | 25 + .../down.yaml | 15 + .../up.yaml | 5 + .../down.yaml | 11 + .../up.yaml | 5 + .../down.yaml | 1 + .../up.yaml | 5 + .../down.yaml | 5 + .../up.yaml | 5 + .../down.yaml | 5 + .../up.yaml | 10 + .../down.yaml | 6 + .../up.yaml | 8 + .../down.yaml | 8 + .../up.yaml | 6 + .../down.yaml | 6 + .../up.yaml | 8 + .../down.yaml | 15 + .../up.yaml | 6 + .../down.yaml | 15 + .../up.yaml | 6 + .../down.yaml | 18 + .../up.yaml | 6 + .../down.yaml | 11 + .../up.yaml | 6 + .../down.yaml | 12 + .../up.yaml | 6 + .../down.yaml | 6 + .../up.yaml | 17 + .../down.yaml | 6 + .../up.yaml | 18 + .../down.yaml | 6 + .../up.yaml | 16 + .../down.yaml | 6 + .../up.yaml | 12 + .../down.yaml | 8 + .../up.yaml | 6 + .../down.yaml | 16 + .../up.yaml | 5 + .../down.yaml | 21 + .../up.yaml | 22 + 100 files changed, 2367 insertions(+), 812 deletions(-) create mode 100644 front-end/src/components/Post/Poll/Poll.tsx create mode 100644 hasura/hasura-migrations/migrations/1591691644022_create_table_public_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591691644022_create_table_public_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591691691193_alter_table_public_posts_add_column_poll_id/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591691691193_alter_table_public_posts_add_column_poll_id/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591691714640_set_fk_public_posts_poll_id/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591691714640_set_fk_public_posts_poll_id/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591691750165_add_relationship__table_public_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591691750165_add_relationship__table_public_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692079949_create_table_public_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692079949_create_table_public_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692108483_add_relationship__table_public_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692108483_add_relationship__table_public_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692145733_table_poll_votes_create_remote_relationship_voter/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692145733_table_poll_votes_create_remote_relationship_voter/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692234831_add_relationship__table_public_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692234831_add_relationship__table_public_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692243735_add_relationship__table_public_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692243735_add_relationship__table_public_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692261923_drop_relationship_post_votes_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692261923_drop_relationship_post_votes_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692369110_alter_table_public_poll_add_column_created_at/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692369110_alter_table_public_poll_add_column_created_at/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692383595_alter_table_public_poll_add_column_updated_at/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692383595_alter_table_public_poll_add_column_updated_at/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692413798_update_permission_anonymous_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692413798_update_permission_anonymous_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692844048_apply_same_permissions_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692844048_apply_same_permissions_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692878220_update_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692878220_update_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692915618_apply_same_permissions_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692915618_apply_same_permissions_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692960440_update_permission_anonymous_public_table_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692960440_update_permission_anonymous_public_table_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692994943_update_permission_user_public_table_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591692994943_update_permission_user_public_table_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693013352_apply_same_permissions_public_table_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693013352_apply_same_permissions_public_table_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693032342_update_permission_user_public_table_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693032342_update_permission_user_public_table_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693127056_update_permission_user_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693127056_update_permission_user_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693135655_update_permission_user_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693135655_update_permission_user_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693143030_update_permission_proposal_bot_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693143030_update_permission_proposal_bot_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693151518_update_permission_proposal_bot_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693151518_update_permission_proposal_bot_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693193633_update_permission_anonymous_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693193633_update_permission_anonymous_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693205543_alter_table_public_posts_drop_column_has_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693205543_alter_table_public_posts_drop_column_has_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693227470_alter_table_public_posts_drop_column_poll_block_number_end/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591693227470_alter_table_public_posts_drop_column_poll_block_number_end/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591694916750_drop_table_public_post_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591694916750_drop_table_public_post_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591710822941_alter_table_public_poll_add_column_post_id/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591710822941_alter_table_public_poll_add_column_post_id/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591710846626_set_fk_public_poll_post_id/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591710846626_set_fk_public_poll_post_id/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591710865995_add_relationship__table_public_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591710865995_add_relationship__table_public_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591710875868_drop_relationship_poll_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591710875868_drop_relationship_poll_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711198482_add_relationship__table_public_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711198482_add_relationship__table_public_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711295651_delete_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711295651_delete_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711298802_delete_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711298802_delete_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711301778_delete_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711301778_delete_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711304546_delete_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711304546_delete_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711349916_drop_relationship_posts_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711349916_drop_relationship_posts_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711415750_update_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711415750_update_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711424931_update_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711424931_update_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711440804_update_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711440804_update_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711449429_update_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711449429_update_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711486018_drop_relationship_poll_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711486018_drop_relationship_poll_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711496030_alter_table_public_posts_drop_column_poll_id/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591711496030_alter_table_public_posts_drop_column_poll_id/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591714881453_update_permission_anonymous_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591714881453_update_permission_anonymous_public_table_poll/up.yaml diff --git a/front-end/src/components/Post/Poll/CouncilSignals.tsx b/front-end/src/components/Post/Poll/CouncilSignals.tsx index b9d5ae407..c71fe2365 100644 --- a/front-end/src/components/Post/Poll/CouncilSignals.tsx +++ b/front-end/src/components/Post/Poll/CouncilSignals.tsx @@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react'; import { Grid, Icon } from 'semantic-ui-react'; import HelperTooltip from 'src/ui-components/HelperTooltip'; -import { CouncilAtBlockNumberQuery, CouncilAtBlockNumberQueryVariables,PostVotesQuery, useCouncilAtBlockNumberQuery, useGetCurrentBlockNumberQuery } from '../../../generated/graphql'; +import { CouncilAtBlockNumberQuery, CouncilAtBlockNumberQueryVariables, PollVotesQuery, useCouncilAtBlockNumberQuery, useGetCurrentBlockNumberQuery } from '../../../generated/graphql'; import { OffchainVote, Vote } from '../../../types'; import Address from '../../../ui-components/Address'; import Card from '../../../ui-components/Card'; @@ -18,19 +18,19 @@ import getEncodedAddress from '../../../util/getEncodedAddress'; interface Props { className?: string - data?: PostVotesQuery | undefined - pollBlockNumberEnd: number + data?: PollVotesQuery | undefined + endBlock: number } -const CouncilSignals = ({ className, pollBlockNumberEnd, data }: Props) => { +const CouncilSignals = ({ className, endBlock, data }: Props) => { const [ayes, setAyes] = useState(0); const [nays, setNays] = useState(0); const [memberSet, setMemberSet] = useState>(new Set()); const [councilVotes, setCouncilVotes] = useState([]); const currentBlockNumberResult = useGetCurrentBlockNumberQuery(); - const currentBlockNumber = currentBlockNumberResult?.data?.blockNumbers?.[0]?.number || pollBlockNumberEnd; + const currentBlockNumber = currentBlockNumberResult?.data?.blockNumbers?.[0]?.number || endBlock; - const councilAtPollEndBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: pollBlockNumberEnd } }); + const councilAtPollEndBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: endBlock } }); const councilAtCurrentBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: currentBlockNumber } }); const getCouncilMembers = (councilAtBlockNumber: QueryResult): Set => { @@ -45,7 +45,7 @@ const CouncilSignals = ({ className, pollBlockNumberEnd, data }: Props) => { }; useEffect(() => { - const pollClosingBlockNumber = pollBlockNumberEnd; + const pollClosingBlockNumber = endBlock; let memberSet = new Set(); if (pollClosingBlockNumber > currentBlockNumber) { @@ -55,7 +55,7 @@ const CouncilSignals = ({ className, pollBlockNumberEnd, data }: Props) => { } setMemberSet(memberSet); - }, [pollBlockNumberEnd, currentBlockNumber, councilAtPollEndBlockNumber, councilAtCurrentBlockNumber]); + }, [endBlock, currentBlockNumber, councilAtPollEndBlockNumber, councilAtCurrentBlockNumber]); useEffect(() => { let ayes = 0; @@ -63,7 +63,7 @@ const CouncilSignals = ({ className, pollBlockNumberEnd, data }: Props) => { const defaultAddressField = getDefaultAddressField(); const councilVotes: OffchainVote[] = []; - data?.post_votes?.forEach(({ vote, voter }) => { + data?.poll_votes?.forEach(({ vote, voter }) => { const defaultAddress = voter?.[defaultAddressField]; if (defaultAddress && memberSet.has(defaultAddress)) { diff --git a/front-end/src/components/Post/Poll/GeneralSignals.tsx b/front-end/src/components/Post/Poll/GeneralSignals.tsx index a9ded17a4..62464478b 100644 --- a/front-end/src/components/Post/Poll/GeneralSignals.tsx +++ b/front-end/src/components/Post/Poll/GeneralSignals.tsx @@ -9,7 +9,7 @@ import ButtonLink from 'src/ui-components/ButtonLink'; import HelperTooltip from 'src/ui-components/HelperTooltip'; import { UserDetailsContext } from '../../../context/UserDetailsContext'; -import { PostVotesQuery, PostVotesQueryVariables, useAddPostVoteMutation, useDeleteVoteMutation } from '../../../generated/graphql'; +import { PollVotesQuery, PollVotesQueryVariables, useAddPollVoteMutation, useDeleteVoteMutation } from '../../../generated/graphql'; import { Vote } from '../../../types'; import AyeNayButtons from '../../../ui-components/AyeNayButtons'; import Card from '../../../ui-components/Card'; @@ -22,14 +22,14 @@ interface Props { className?: string, ownVote?: Vote | null, nays: number, - postId: number - refetch: (variables?: PostVotesQueryVariables | undefined) => Promise> + pollId: number + refetch: (variables?: PollVotesQueryVariables | undefined) => Promise> } -const CouncilSignals = ({ className, ayes, ownVote, nays, postId, refetch }: Props) => { +const CouncilSignals = ({ className, ayes, ownVote, nays, pollId, refetch }: Props) => { const { id } = useContext(UserDetailsContext); const [error, setErr] = useState(null); - const [addPostVoteMutation] = useAddPostVoteMutation(); + const [addPollVoteMutation] = useAddPollVoteMutation(); const [deleteVoteMutation] = useDeleteVoteMutation(); const cancelVote = useCallback(async () => { @@ -40,7 +40,7 @@ const CouncilSignals = ({ className, ayes, ownVote, nays, postId, refetch }: Pro try { await deleteVoteMutation({ variables: { - postId, + pollId, userId: id } }); @@ -49,7 +49,7 @@ const CouncilSignals = ({ className, ayes, ownVote, nays, postId, refetch }: Pro } catch (error) { setErr(error); } - }, [id, deleteVoteMutation, postId, refetch]); + }, [id, deleteVoteMutation, pollId, refetch]); const castVote = useCallback(async (vote: Vote) => { if (!id) { @@ -57,9 +57,9 @@ const CouncilSignals = ({ className, ayes, ownVote, nays, postId, refetch }: Pro } try { - await addPostVoteMutation({ + await addPollVoteMutation({ variables: { - postId, + pollId, userId: id, vote } @@ -69,7 +69,7 @@ const CouncilSignals = ({ className, ayes, ownVote, nays, postId, refetch }: Pro } catch (error) { setErr(error); } - }, [id, addPostVoteMutation, postId, refetch]); + }, [id, addPollVoteMutation, pollId, refetch]); return ( @@ -122,4 +122,4 @@ export default styled(CouncilSignals)` opacity: 1 !important; } } -`; \ No newline at end of file +`; diff --git a/front-end/src/components/Post/Poll/Poll.tsx b/front-end/src/components/Post/Poll/Poll.tsx new file mode 100644 index 000000000..663272ce9 --- /dev/null +++ b/front-end/src/components/Post/Poll/Poll.tsx @@ -0,0 +1,55 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import React, { useContext } from 'react'; + +import { UserDetailsContext } from '../../../context/UserDetailsContext'; +import { usePollVotesQuery } from '../../../generated/graphql'; +import { Vote } from '../../../types'; +import Card from '../../../ui-components/Card'; +import FilteredError from '../../../ui-components/FilteredError'; +import CouncilSignals from './CouncilSignals'; +import GeneralSignals from './GeneralSignals'; + +interface Props { + pollId: number + endBlock: number +} + +const Poll = ({ pollId, endBlock }: Props) => { + const { id } = useContext(UserDetailsContext); + const { data, error, refetch } = usePollVotesQuery({ variables: { pollId } }); + let ayes = 0; + let nays = 0; + let ownVote: Vote | null = null; + + data?.poll_votes?.forEach(({ vote, voter }) => { + if (voter?.id === id) { + ownVote = vote; + } + if (vote === Vote.AYE) { + ayes++; + } + if (vote === Vote.NAY) { + nays++; + } + }); + + if (error?.message) return ; + + return ( + <> + + + + ); +}; + +export default Poll; diff --git a/front-end/src/components/Post/Poll/index.tsx b/front-end/src/components/Post/Poll/index.tsx index 1926d2d43..583823b59 100644 --- a/front-end/src/components/Post/Poll/index.tsx +++ b/front-end/src/components/Post/Poll/index.tsx @@ -2,54 +2,29 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import React, { useContext } from 'react'; +import React from 'react'; -import { UserDetailsContext } from '../../../context/UserDetailsContext'; -import { usePostVotesQuery } from '../../../generated/graphql'; -import { Vote } from '../../../types'; +import { usePollQuery } from '../../../generated/graphql'; import Card from '../../../ui-components/Card'; import FilteredError from '../../../ui-components/FilteredError'; -import CouncilSignals from './CouncilSignals'; -import GeneralSignals from './GeneralSignals'; +import Poll from './Poll'; interface Props { postId: number - pollBlockNumberEnd: number } -const Poll = ({ postId, pollBlockNumberEnd }: Props) => { - const { id } = useContext(UserDetailsContext); - const { data, error, refetch } = usePostVotesQuery({ variables: { postId } }); - let ayes = 0; - let nays = 0; - let ownVote: Vote | null = null; - - data?.post_votes?.forEach(({ vote, voter }) => { - if (voter?.id === id) { - ownVote = vote; - } - if (vote === Vote.AYE) { - ayes++; - } - if (vote === Vote.NAY) { - nays++; - } - }); +export default ({ postId }: Props) => { + const { data, error } = usePollQuery({ variables: { postId } }); if (error?.message) return ; + if (!data?.poll?.[0]?.id || !data?.poll?.[0]?.block_end) { + return null; + } + return ( <> - - + ); }; - -export default Poll; diff --git a/front-end/src/components/Post/Poll/query.ts b/front-end/src/components/Post/Poll/query.ts index 422ed7466..31794f10e 100644 --- a/front-end/src/components/Post/Poll/query.ts +++ b/front-end/src/components/Post/Poll/query.ts @@ -4,8 +4,26 @@ import gql from 'graphql-tag'; -export const postVotesFields = gql` - fragment postVotesFields on post_votes { +export const pollFields = gql` + fragment pollFields on poll { + id + block_end + created_at + updated_at + } +`; + +export const POLL_QUERY = gql` + query Poll ($postId: Int!) { + poll(where: {post_id: {_eq: $postId}}) { + ...pollFields + } + } + ${pollFields} +`; + +export const pollVotesFields = gql` + fragment pollVotesFields on poll_votes { id voter { id @@ -19,30 +37,30 @@ export const postVotesFields = gql` } `; -export const QUERY_POST_VOTES = gql` - query PostVotes ($postId: Int!) { - post_votes(where: {post_id: {_eq: $postId}}) { - ...postVotesFields +export const QUERY_POLL_VOTES = gql` + query PollVotes ($pollId: Int!) { + poll_votes(where: {poll_id: {_eq: $pollId}}) { + ...pollVotesFields } } - ${postVotesFields} + ${pollVotesFields} `; -export const ADD_POST_VOTE = gql` - mutation AddPostVote ($postId: Int!, $userId: Int!, $vote: bpchar!) { +export const ADD_POLL_VOTE = gql` + mutation AddPollVote ($pollId: Int!, $userId: Int!, $vote: bpchar!) { __typename - insert_post_votes_one(object: {post_id: $postId, user_id: $userId, vote: $vote}) { + insert_poll_votes_one(object: {poll_id: $pollId, user_id: $userId, vote: $vote}) { id } } `; export const DELETE_VOTE = gql` - mutation DeleteVote ($postId: Int!, $userId: Int!) { - delete_post_votes( + mutation DeleteVote ($pollId: Int!, $userId: Int!) { + delete_poll_votes( where: { _and: [ - {post_id: {_eq: $postId}}, + {poll_id: {_eq: $pollId}}, {user_id: {_eq: $userId}} ] } diff --git a/front-end/src/components/Post/Post.tsx b/front-end/src/components/Post/Post.tsx index b5b8e9344..b40ea5a94 100644 --- a/front-end/src/components/Post/Post.tsx +++ b/front-end/src/components/Post/Post.tsx @@ -194,7 +194,7 @@ const Post = ( { className, data, isMotion = false, isProposal = false, isRefere onchainLink={definedOnchainLink} status={postStatus} /> - {isDiscussion(post) && post.has_poll && post.poll_block_number_end && } + {isDiscussion(post) && } diff --git a/front-end/src/generated/graphql.tsx b/front-end/src/generated/graphql.tsx index 03c7a936e..c1ed55140 100644 --- a/front-end/src/generated/graphql.tsx +++ b/front-end/src/generated/graphql.tsx @@ -487,18 +487,6 @@ export type BlockNumberWhereUniqueInput = { number?: Maybe, }; -export type Boolean_Comparison_Exp = { - _eq?: Maybe, - _gt?: Maybe, - _gte?: Maybe, - _in?: Maybe>, - _is_null?: Maybe, - _lt?: Maybe, - _lte?: Maybe, - _neq?: Maybe, - _nin?: Maybe>, -}; - export type Bpchar_Comparison_Exp = { _eq?: Maybe, @@ -3014,14 +3002,16 @@ export type Mutation_Root = { delete_comments_by_pk?: Maybe, delete_onchain_links?: Maybe, delete_onchain_links_by_pk?: Maybe, + delete_poll?: Maybe, + delete_poll_by_pk?: Maybe, + delete_poll_votes?: Maybe, + delete_poll_votes_by_pk?: Maybe, delete_post_reactions?: Maybe, delete_post_reactions_by_pk?: Maybe, delete_post_topics?: Maybe, delete_post_topics_by_pk?: Maybe, delete_post_types?: Maybe, delete_post_types_by_pk?: Maybe, - delete_post_votes?: Maybe, - delete_post_votes_by_pk?: Maybe, delete_posts?: Maybe, delete_posts_by_pk?: Maybe, executeRaw: Scalars['Json'], @@ -3031,14 +3021,16 @@ export type Mutation_Root = { insert_comments_one?: Maybe, insert_onchain_links?: Maybe, insert_onchain_links_one?: Maybe, + insert_poll?: Maybe, + insert_poll_one?: Maybe, + insert_poll_votes?: Maybe, + insert_poll_votes_one?: Maybe, insert_post_reactions?: Maybe, insert_post_reactions_one?: Maybe, insert_post_topics?: Maybe, insert_post_topics_one?: Maybe, insert_post_types?: Maybe, insert_post_types_one?: Maybe, - insert_post_votes?: Maybe, - insert_post_votes_one?: Maybe, insert_posts?: Maybe, insert_posts_one?: Maybe, login?: Maybe, @@ -3111,14 +3103,16 @@ export type Mutation_Root = { update_comments_by_pk?: Maybe, update_onchain_links?: Maybe, update_onchain_links_by_pk?: Maybe, + update_poll?: Maybe, + update_poll_by_pk?: Maybe, + update_poll_votes?: Maybe, + update_poll_votes_by_pk?: Maybe, update_post_reactions?: Maybe, update_post_reactions_by_pk?: Maybe, update_post_topics?: Maybe, update_post_topics_by_pk?: Maybe, update_post_types?: Maybe, update_post_types_by_pk?: Maybe, - update_post_votes?: Maybe, - update_post_votes_by_pk?: Maybe, update_posts?: Maybe, update_posts_by_pk?: Maybe, upsertBlockIndex: BlockIndex, @@ -3639,6 +3633,26 @@ export type Mutation_RootDelete_Onchain_Links_By_PkArgs = { }; +export type Mutation_RootDelete_PollArgs = { + where: Poll_Bool_Exp +}; + + +export type Mutation_RootDelete_Poll_By_PkArgs = { + id: Scalars['Int'] +}; + + +export type Mutation_RootDelete_Poll_VotesArgs = { + where: Poll_Votes_Bool_Exp +}; + + +export type Mutation_RootDelete_Poll_Votes_By_PkArgs = { + id: Scalars['Int'] +}; + + export type Mutation_RootDelete_Post_ReactionsArgs = { where: Post_Reactions_Bool_Exp }; @@ -3669,16 +3683,6 @@ export type Mutation_RootDelete_Post_Types_By_PkArgs = { }; -export type Mutation_RootDelete_Post_VotesArgs = { - where: Post_Votes_Bool_Exp -}; - - -export type Mutation_RootDelete_Post_Votes_By_PkArgs = { - id: Scalars['Int'] -}; - - export type Mutation_RootDelete_PostsArgs = { where: Posts_Bool_Exp }; @@ -3731,6 +3735,30 @@ export type Mutation_RootInsert_Onchain_Links_OneArgs = { }; +export type Mutation_RootInsert_PollArgs = { + objects: Array, + on_conflict?: Maybe +}; + + +export type Mutation_RootInsert_Poll_OneArgs = { + object: Poll_Insert_Input, + on_conflict?: Maybe +}; + + +export type Mutation_RootInsert_Poll_VotesArgs = { + objects: Array, + on_conflict?: Maybe +}; + + +export type Mutation_RootInsert_Poll_Votes_OneArgs = { + object: Poll_Votes_Insert_Input, + on_conflict?: Maybe +}; + + export type Mutation_RootInsert_Post_ReactionsArgs = { objects: Array, on_conflict?: Maybe @@ -3767,18 +3795,6 @@ export type Mutation_RootInsert_Post_Types_OneArgs = { }; -export type Mutation_RootInsert_Post_VotesArgs = { - objects: Array, - on_conflict?: Maybe -}; - - -export type Mutation_RootInsert_Post_Votes_OneArgs = { - object: Post_Votes_Insert_Input, - on_conflict?: Maybe -}; - - export type Mutation_RootInsert_PostsArgs = { objects: Array, on_conflict?: Maybe @@ -4208,6 +4224,34 @@ export type Mutation_RootUpdate_Onchain_Links_By_PkArgs = { }; +export type Mutation_RootUpdate_PollArgs = { + _inc?: Maybe, + _set?: Maybe, + where: Poll_Bool_Exp +}; + + +export type Mutation_RootUpdate_Poll_By_PkArgs = { + _inc?: Maybe, + _set?: Maybe, + pk_columns: Poll_Pk_Columns_Input +}; + + +export type Mutation_RootUpdate_Poll_VotesArgs = { + _inc?: Maybe, + _set?: Maybe, + where: Poll_Votes_Bool_Exp +}; + + +export type Mutation_RootUpdate_Poll_Votes_By_PkArgs = { + _inc?: Maybe, + _set?: Maybe, + pk_columns: Poll_Votes_Pk_Columns_Input +}; + + export type Mutation_RootUpdate_Post_ReactionsArgs = { _inc?: Maybe, _set?: Maybe, @@ -4250,20 +4294,6 @@ export type Mutation_RootUpdate_Post_Types_By_PkArgs = { }; -export type Mutation_RootUpdate_Post_VotesArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Post_Votes_Bool_Exp -}; - - -export type Mutation_RootUpdate_Post_Votes_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Post_Votes_Pk_Columns_Input -}; - - export type Mutation_RootUpdate_PostsArgs = { _inc?: Maybe, _set?: Maybe, @@ -5272,354 +5302,943 @@ export type PageInfo = { startCursor?: Maybe, }; -export type Post_Reactions = { - __typename?: 'post_reactions', +export type Poll = { + __typename?: 'poll', + block_end: Scalars['Int'], created_at: Scalars['timestamp'], id: Scalars['Int'], + poll_votes: Array, + poll_votes_aggregate: Poll_Votes_Aggregate, post: Posts, post_id: Scalars['Int'], - reacting_user?: Maybe, - reaction: Scalars['bpchar'], updated_at: Scalars['timestamp'], - user_id: Scalars['Int'], }; -export type Post_Reactions_Aggregate = { - __typename?: 'post_reactions_aggregate', - aggregate?: Maybe, - nodes: Array, + +export type PollPoll_VotesArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe }; -export type Post_Reactions_Aggregate_Fields = { - __typename?: 'post_reactions_aggregate_fields', - avg?: Maybe, + +export type PollPoll_Votes_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + +export type Poll_Aggregate = { + __typename?: 'poll_aggregate', + aggregate?: Maybe, + nodes: Array, +}; + +export type Poll_Aggregate_Fields = { + __typename?: 'poll_aggregate_fields', + avg?: Maybe, count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, }; -export type Post_Reactions_Aggregate_FieldsCountArgs = { - columns?: Maybe>, +export type Poll_Aggregate_FieldsCountArgs = { + columns?: Maybe>, distinct?: Maybe }; -export type Post_Reactions_Aggregate_Order_By = { - avg?: Maybe, +export type Poll_Aggregate_Order_By = { + avg?: Maybe, count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, }; -export type Post_Reactions_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, +export type Poll_Arr_Rel_Insert_Input = { + data: Array, + on_conflict?: Maybe, }; -export type Post_Reactions_Avg_Fields = { - __typename?: 'post_reactions_avg_fields', +export type Poll_Avg_Fields = { + __typename?: 'poll_avg_fields', + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Avg_Order_By = { +export type Poll_Avg_Order_By = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, +export type Poll_Bool_Exp = { + _and?: Maybe>>, + _not?: Maybe, + _or?: Maybe>>, + block_end?: Maybe, created_at?: Maybe, id?: Maybe, + poll_votes?: Maybe, post?: Maybe, post_id?: Maybe, - reaction?: Maybe, updated_at?: Maybe, - user_id?: Maybe, }; -export enum Post_Reactions_Constraint { - PostReactionsPkey = 'post_reactions_pkey' +export enum Poll_Constraint { + PollPkey = 'poll_pkey' } -export type Post_Reactions_Inc_Input = { +export type Poll_Inc_Input = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Insert_Input = { +export type Poll_Insert_Input = { + block_end?: Maybe, created_at?: Maybe, id?: Maybe, + poll_votes?: Maybe, post?: Maybe, post_id?: Maybe, - reaction?: Maybe, updated_at?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Max_Fields = { - __typename?: 'post_reactions_max_fields', +export type Poll_Max_Fields = { + __typename?: 'poll_max_fields', + block_end?: Maybe, created_at?: Maybe, id?: Maybe, post_id?: Maybe, updated_at?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Max_Order_By = { +export type Poll_Max_Order_By = { + block_end?: Maybe, created_at?: Maybe, id?: Maybe, post_id?: Maybe, updated_at?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Min_Fields = { - __typename?: 'post_reactions_min_fields', +export type Poll_Min_Fields = { + __typename?: 'poll_min_fields', + block_end?: Maybe, created_at?: Maybe, id?: Maybe, post_id?: Maybe, updated_at?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Min_Order_By = { +export type Poll_Min_Order_By = { + block_end?: Maybe, created_at?: Maybe, id?: Maybe, post_id?: Maybe, updated_at?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Mutation_Response = { - __typename?: 'post_reactions_mutation_response', +export type Poll_Mutation_Response = { + __typename?: 'poll_mutation_response', affected_rows: Scalars['Int'], - returning: Array, + returning: Array, }; -export type Post_Reactions_Obj_Rel_Insert_Input = { - data: Post_Reactions_Insert_Input, - on_conflict?: Maybe, +export type Poll_Obj_Rel_Insert_Input = { + data: Poll_Insert_Input, + on_conflict?: Maybe, }; -export type Post_Reactions_On_Conflict = { - constraint: Post_Reactions_Constraint, - update_columns: Array, - where?: Maybe, +export type Poll_On_Conflict = { + constraint: Poll_Constraint, + update_columns: Array, + where?: Maybe, }; -export type Post_Reactions_Order_By = { +export type Poll_Order_By = { + block_end?: Maybe, created_at?: Maybe, id?: Maybe, + poll_votes_aggregate?: Maybe, post?: Maybe, post_id?: Maybe, - reaction?: Maybe, updated_at?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Pk_Columns_Input = { +export type Poll_Pk_Columns_Input = { id: Scalars['Int'], }; -export enum Post_Reactions_Select_Column { +export enum Poll_Select_Column { + BlockEnd = 'block_end', CreatedAt = 'created_at', Id = 'id', PostId = 'post_id', - Reaction = 'reaction', - UpdatedAt = 'updated_at', - UserId = 'user_id' + UpdatedAt = 'updated_at' } -export type Post_Reactions_Set_Input = { +export type Poll_Set_Input = { + block_end?: Maybe, created_at?: Maybe, id?: Maybe, post_id?: Maybe, - reaction?: Maybe, updated_at?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Stddev_Fields = { - __typename?: 'post_reactions_stddev_fields', +export type Poll_Stddev_Fields = { + __typename?: 'poll_stddev_fields', + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Stddev_Order_By = { +export type Poll_Stddev_Order_By = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Stddev_Pop_Fields = { - __typename?: 'post_reactions_stddev_pop_fields', +export type Poll_Stddev_Pop_Fields = { + __typename?: 'poll_stddev_pop_fields', + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Stddev_Pop_Order_By = { +export type Poll_Stddev_Pop_Order_By = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Stddev_Samp_Fields = { - __typename?: 'post_reactions_stddev_samp_fields', +export type Poll_Stddev_Samp_Fields = { + __typename?: 'poll_stddev_samp_fields', + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Stddev_Samp_Order_By = { +export type Poll_Stddev_Samp_Order_By = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Sum_Fields = { - __typename?: 'post_reactions_sum_fields', +export type Poll_Sum_Fields = { + __typename?: 'poll_sum_fields', + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Sum_Order_By = { +export type Poll_Sum_Order_By = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export enum Post_Reactions_Update_Column { +export enum Poll_Update_Column { + BlockEnd = 'block_end', CreatedAt = 'created_at', Id = 'id', PostId = 'post_id', - Reaction = 'reaction', - UpdatedAt = 'updated_at', - UserId = 'user_id' + UpdatedAt = 'updated_at' } -export type Post_Reactions_Var_Pop_Fields = { - __typename?: 'post_reactions_var_pop_fields', +export type Poll_Var_Pop_Fields = { + __typename?: 'poll_var_pop_fields', + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Var_Pop_Order_By = { +export type Poll_Var_Pop_Order_By = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Var_Samp_Fields = { - __typename?: 'post_reactions_var_samp_fields', +export type Poll_Var_Samp_Fields = { + __typename?: 'poll_var_samp_fields', + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Var_Samp_Order_By = { +export type Poll_Var_Samp_Order_By = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Variance_Fields = { - __typename?: 'post_reactions_variance_fields', +export type Poll_Variance_Fields = { + __typename?: 'poll_variance_fields', + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Reactions_Variance_Order_By = { +export type Poll_Variance_Order_By = { + block_end?: Maybe, id?: Maybe, post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Topics = { - __typename?: 'post_topics', +export type Poll_Votes = { + __typename?: 'poll_votes', + created_at: Scalars['timestamp'], id: Scalars['Int'], - name: Scalars['String'], - posts: Array, - posts_aggregate: Posts_Aggregate, + poll: Poll, + poll_id: Scalars['Int'], + updated_at: Scalars['timestamp'], + user_id: Scalars['Int'], + vote: Scalars['bpchar'], + voter?: Maybe, }; +export type Poll_Votes_Aggregate = { + __typename?: 'poll_votes_aggregate', + aggregate?: Maybe, + nodes: Array, +}; -export type Post_TopicsPostsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +export type Poll_Votes_Aggregate_Fields = { + __typename?: 'poll_votes_aggregate_fields', + avg?: Maybe, + count?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, }; -export type Post_TopicsPosts_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +export type Poll_Votes_Aggregate_FieldsCountArgs = { + columns?: Maybe>, + distinct?: Maybe }; -export type Post_Topics_Aggregate = { - __typename?: 'post_topics_aggregate', - aggregate?: Maybe, - nodes: Array, +export type Poll_Votes_Aggregate_Order_By = { + avg?: Maybe, + count?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, }; -export type Post_Topics_Aggregate_Fields = { - __typename?: 'post_topics_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, +export type Poll_Votes_Arr_Rel_Insert_Input = { + data: Array, + on_conflict?: Maybe, }; +export type Poll_Votes_Avg_Fields = { + __typename?: 'poll_votes_avg_fields', + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; -export type Post_Topics_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe +export type Poll_Votes_Avg_Order_By = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, }; -export type Post_Topics_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, +export type Poll_Votes_Bool_Exp = { + _and?: Maybe>>, + _not?: Maybe, + _or?: Maybe>>, + created_at?: Maybe, + id?: Maybe, + poll?: Maybe, + poll_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, + vote?: Maybe, +}; + +export enum Poll_Votes_Constraint { + PollVotesPkey = 'poll_votes_pkey' +} + +export type Poll_Votes_Inc_Input = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Insert_Input = { + created_at?: Maybe, + id?: Maybe, + poll?: Maybe, + poll_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, + vote?: Maybe, +}; + +export type Poll_Votes_Max_Fields = { + __typename?: 'poll_votes_max_fields', + created_at?: Maybe, + id?: Maybe, + poll_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Max_Order_By = { + created_at?: Maybe, + id?: Maybe, + poll_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Min_Fields = { + __typename?: 'poll_votes_min_fields', + created_at?: Maybe, + id?: Maybe, + poll_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Min_Order_By = { + created_at?: Maybe, + id?: Maybe, + poll_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Mutation_Response = { + __typename?: 'poll_votes_mutation_response', + affected_rows: Scalars['Int'], + returning: Array, +}; + +export type Poll_Votes_Obj_Rel_Insert_Input = { + data: Poll_Votes_Insert_Input, + on_conflict?: Maybe, +}; + +export type Poll_Votes_On_Conflict = { + constraint: Poll_Votes_Constraint, + update_columns: Array, + where?: Maybe, +}; + +export type Poll_Votes_Order_By = { + created_at?: Maybe, + id?: Maybe, + poll?: Maybe, + poll_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, + vote?: Maybe, +}; + +export type Poll_Votes_Pk_Columns_Input = { + id: Scalars['Int'], +}; + +export enum Poll_Votes_Select_Column { + CreatedAt = 'created_at', + Id = 'id', + PollId = 'poll_id', + UpdatedAt = 'updated_at', + UserId = 'user_id', + Vote = 'vote' +} + +export type Poll_Votes_Set_Input = { + created_at?: Maybe, + id?: Maybe, + poll_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, + vote?: Maybe, +}; + +export type Poll_Votes_Stddev_Fields = { + __typename?: 'poll_votes_stddev_fields', + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Stddev_Order_By = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Stddev_Pop_Fields = { + __typename?: 'poll_votes_stddev_pop_fields', + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Stddev_Pop_Order_By = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Stddev_Samp_Fields = { + __typename?: 'poll_votes_stddev_samp_fields', + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Stddev_Samp_Order_By = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Sum_Fields = { + __typename?: 'poll_votes_sum_fields', + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Sum_Order_By = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export enum Poll_Votes_Update_Column { + CreatedAt = 'created_at', + Id = 'id', + PollId = 'poll_id', + UpdatedAt = 'updated_at', + UserId = 'user_id', + Vote = 'vote' +} + +export type Poll_Votes_Var_Pop_Fields = { + __typename?: 'poll_votes_var_pop_fields', + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Var_Pop_Order_By = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Var_Samp_Fields = { + __typename?: 'poll_votes_var_samp_fields', + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Var_Samp_Order_By = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Variance_Fields = { + __typename?: 'poll_votes_variance_fields', + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Poll_Votes_Variance_Order_By = { + id?: Maybe, + poll_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions = { + __typename?: 'post_reactions', + created_at: Scalars['timestamp'], + id: Scalars['Int'], + post: Posts, + post_id: Scalars['Int'], + reacting_user?: Maybe, + reaction: Scalars['bpchar'], + updated_at: Scalars['timestamp'], + user_id: Scalars['Int'], +}; + +export type Post_Reactions_Aggregate = { + __typename?: 'post_reactions_aggregate', + aggregate?: Maybe, + nodes: Array, +}; + +export type Post_Reactions_Aggregate_Fields = { + __typename?: 'post_reactions_aggregate_fields', + avg?: Maybe, + count?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, +}; + + +export type Post_Reactions_Aggregate_FieldsCountArgs = { + columns?: Maybe>, + distinct?: Maybe +}; + +export type Post_Reactions_Aggregate_Order_By = { + avg?: Maybe, + count?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, +}; + +export type Post_Reactions_Arr_Rel_Insert_Input = { + data: Array, + on_conflict?: Maybe, +}; + +export type Post_Reactions_Avg_Fields = { + __typename?: 'post_reactions_avg_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Avg_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Bool_Exp = { + _and?: Maybe>>, + _not?: Maybe, + _or?: Maybe>>, + created_at?: Maybe, + id?: Maybe, + post?: Maybe, + post_id?: Maybe, + reaction?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export enum Post_Reactions_Constraint { + PostReactionsPkey = 'post_reactions_pkey' +} + +export type Post_Reactions_Inc_Input = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Insert_Input = { + created_at?: Maybe, + id?: Maybe, + post?: Maybe, + post_id?: Maybe, + reaction?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Max_Fields = { + __typename?: 'post_reactions_max_fields', + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Max_Order_By = { + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Min_Fields = { + __typename?: 'post_reactions_min_fields', + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Min_Order_By = { + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Mutation_Response = { + __typename?: 'post_reactions_mutation_response', + affected_rows: Scalars['Int'], + returning: Array, +}; + +export type Post_Reactions_Obj_Rel_Insert_Input = { + data: Post_Reactions_Insert_Input, + on_conflict?: Maybe, +}; + +export type Post_Reactions_On_Conflict = { + constraint: Post_Reactions_Constraint, + update_columns: Array, + where?: Maybe, +}; + +export type Post_Reactions_Order_By = { + created_at?: Maybe, + id?: Maybe, + post?: Maybe, + post_id?: Maybe, + reaction?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Pk_Columns_Input = { + id: Scalars['Int'], +}; + +export enum Post_Reactions_Select_Column { + CreatedAt = 'created_at', + Id = 'id', + PostId = 'post_id', + Reaction = 'reaction', + UpdatedAt = 'updated_at', + UserId = 'user_id' +} + +export type Post_Reactions_Set_Input = { + created_at?: Maybe, + id?: Maybe, + post_id?: Maybe, + reaction?: Maybe, + updated_at?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Stddev_Fields = { + __typename?: 'post_reactions_stddev_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Stddev_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Stddev_Pop_Fields = { + __typename?: 'post_reactions_stddev_pop_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Stddev_Pop_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Stddev_Samp_Fields = { + __typename?: 'post_reactions_stddev_samp_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Stddev_Samp_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Sum_Fields = { + __typename?: 'post_reactions_sum_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Sum_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export enum Post_Reactions_Update_Column { + CreatedAt = 'created_at', + Id = 'id', + PostId = 'post_id', + Reaction = 'reaction', + UpdatedAt = 'updated_at', + UserId = 'user_id' +} + +export type Post_Reactions_Var_Pop_Fields = { + __typename?: 'post_reactions_var_pop_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Var_Pop_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Var_Samp_Fields = { + __typename?: 'post_reactions_var_samp_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Var_Samp_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Variance_Fields = { + __typename?: 'post_reactions_variance_fields', + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Reactions_Variance_Order_By = { + id?: Maybe, + post_id?: Maybe, + user_id?: Maybe, +}; + +export type Post_Topics = { + __typename?: 'post_topics', + id: Scalars['Int'], + name: Scalars['String'], + posts: Array, + posts_aggregate: Posts_Aggregate, +}; + + +export type Post_TopicsPostsArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Post_TopicsPosts_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + +export type Post_Topics_Aggregate = { + __typename?: 'post_topics_aggregate', + aggregate?: Maybe, + nodes: Array, +}; + +export type Post_Topics_Aggregate_Fields = { + __typename?: 'post_topics_aggregate_fields', + avg?: Maybe, + count?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, + sum?: Maybe, + var_pop?: Maybe, + var_samp?: Maybe, + variance?: Maybe, +}; + + +export type Post_Topics_Aggregate_FieldsCountArgs = { + columns?: Maybe>, + distinct?: Maybe +}; + +export type Post_Topics_Aggregate_Order_By = { + avg?: Maybe, + count?: Maybe, + max?: Maybe, + min?: Maybe, + stddev?: Maybe, + stddev_pop?: Maybe, + stddev_samp?: Maybe, sum?: Maybe, var_pop?: Maybe, var_samp?: Maybe, @@ -5913,401 +6532,114 @@ export type Post_Types_Min_Fields = { name?: Maybe, }; -export type Post_Types_Min_Order_By = { - id?: Maybe, - name?: Maybe, -}; - -export type Post_Types_Mutation_Response = { - __typename?: 'post_types_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, -}; - -export type Post_Types_Obj_Rel_Insert_Input = { - data: Post_Types_Insert_Input, - on_conflict?: Maybe, -}; - -export type Post_Types_On_Conflict = { - constraint: Post_Types_Constraint, - update_columns: Array, - where?: Maybe, -}; - -export type Post_Types_Order_By = { - id?: Maybe, - name?: Maybe, - posts_aggregate?: Maybe, -}; - -export type Post_Types_Pk_Columns_Input = { - id: Scalars['Int'], -}; - -export enum Post_Types_Select_Column { - Id = 'id', - Name = 'name' -} - -export type Post_Types_Set_Input = { - id?: Maybe, - name?: Maybe, -}; - -export type Post_Types_Stddev_Fields = { - __typename?: 'post_types_stddev_fields', - id?: Maybe, -}; - -export type Post_Types_Stddev_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Stddev_Pop_Fields = { - __typename?: 'post_types_stddev_pop_fields', - id?: Maybe, -}; - -export type Post_Types_Stddev_Pop_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Stddev_Samp_Fields = { - __typename?: 'post_types_stddev_samp_fields', - id?: Maybe, -}; - -export type Post_Types_Stddev_Samp_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Sum_Fields = { - __typename?: 'post_types_sum_fields', - id?: Maybe, -}; - -export type Post_Types_Sum_Order_By = { - id?: Maybe, -}; - -export enum Post_Types_Update_Column { - Id = 'id', - Name = 'name' -} - -export type Post_Types_Var_Pop_Fields = { - __typename?: 'post_types_var_pop_fields', - id?: Maybe, -}; - -export type Post_Types_Var_Pop_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Var_Samp_Fields = { - __typename?: 'post_types_var_samp_fields', - id?: Maybe, -}; - -export type Post_Types_Var_Samp_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Variance_Fields = { - __typename?: 'post_types_variance_fields', - id?: Maybe, -}; - -export type Post_Types_Variance_Order_By = { - id?: Maybe, -}; - -export type Post_Votes = { - __typename?: 'post_votes', - created_at: Scalars['timestamp'], - id: Scalars['Int'], - post: Posts, - post_id: Scalars['Int'], - updated_at: Scalars['timestamp'], - user_id: Scalars['Int'], - vote: Scalars['bpchar'], - voter?: Maybe, -}; - -export type Post_Votes_Aggregate = { - __typename?: 'post_votes_aggregate', - aggregate?: Maybe, - nodes: Array, -}; - -export type Post_Votes_Aggregate_Fields = { - __typename?: 'post_votes_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - - -export type Post_Votes_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe -}; - -export type Post_Votes_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - -export type Post_Votes_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, -}; - -export type Post_Votes_Avg_Fields = { - __typename?: 'post_votes_avg_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Votes_Avg_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Votes_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - created_at?: Maybe, - id?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, - vote?: Maybe, -}; - -export enum Post_Votes_Constraint { - PostVotesPkey = 'post_votes_pkey' -} - -export type Post_Votes_Inc_Input = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Votes_Insert_Input = { - created_at?: Maybe, - id?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, - vote?: Maybe, -}; - -export type Post_Votes_Max_Fields = { - __typename?: 'post_votes_max_fields', - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Votes_Max_Order_By = { - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Votes_Min_Fields = { - __typename?: 'post_votes_min_fields', - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Votes_Min_Order_By = { - created_at?: Maybe, +export type Post_Types_Min_Order_By = { id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, + name?: Maybe, }; -export type Post_Votes_Mutation_Response = { - __typename?: 'post_votes_mutation_response', +export type Post_Types_Mutation_Response = { + __typename?: 'post_types_mutation_response', affected_rows: Scalars['Int'], - returning: Array, + returning: Array, }; -export type Post_Votes_Obj_Rel_Insert_Input = { - data: Post_Votes_Insert_Input, - on_conflict?: Maybe, +export type Post_Types_Obj_Rel_Insert_Input = { + data: Post_Types_Insert_Input, + on_conflict?: Maybe, }; -export type Post_Votes_On_Conflict = { - constraint: Post_Votes_Constraint, - update_columns: Array, - where?: Maybe, +export type Post_Types_On_Conflict = { + constraint: Post_Types_Constraint, + update_columns: Array, + where?: Maybe, }; -export type Post_Votes_Order_By = { - created_at?: Maybe, +export type Post_Types_Order_By = { id?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, - vote?: Maybe, + name?: Maybe, + posts_aggregate?: Maybe, }; -export type Post_Votes_Pk_Columns_Input = { +export type Post_Types_Pk_Columns_Input = { id: Scalars['Int'], }; -export enum Post_Votes_Select_Column { - CreatedAt = 'created_at', +export enum Post_Types_Select_Column { Id = 'id', - PostId = 'post_id', - UpdatedAt = 'updated_at', - UserId = 'user_id', - Vote = 'vote' + Name = 'name' } -export type Post_Votes_Set_Input = { - created_at?: Maybe, +export type Post_Types_Set_Input = { id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, - vote?: Maybe, + name?: Maybe, }; -export type Post_Votes_Stddev_Fields = { - __typename?: 'post_votes_stddev_fields', +export type Post_Types_Stddev_Fields = { + __typename?: 'post_types_stddev_fields', id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Stddev_Order_By = { +export type Post_Types_Stddev_Order_By = { id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Stddev_Pop_Fields = { - __typename?: 'post_votes_stddev_pop_fields', +export type Post_Types_Stddev_Pop_Fields = { + __typename?: 'post_types_stddev_pop_fields', id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Stddev_Pop_Order_By = { +export type Post_Types_Stddev_Pop_Order_By = { id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Stddev_Samp_Fields = { - __typename?: 'post_votes_stddev_samp_fields', +export type Post_Types_Stddev_Samp_Fields = { + __typename?: 'post_types_stddev_samp_fields', id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Stddev_Samp_Order_By = { +export type Post_Types_Stddev_Samp_Order_By = { id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Sum_Fields = { - __typename?: 'post_votes_sum_fields', +export type Post_Types_Sum_Fields = { + __typename?: 'post_types_sum_fields', id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Sum_Order_By = { +export type Post_Types_Sum_Order_By = { id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export enum Post_Votes_Update_Column { - CreatedAt = 'created_at', +export enum Post_Types_Update_Column { Id = 'id', - PostId = 'post_id', - UpdatedAt = 'updated_at', - UserId = 'user_id', - Vote = 'vote' + Name = 'name' } -export type Post_Votes_Var_Pop_Fields = { - __typename?: 'post_votes_var_pop_fields', +export type Post_Types_Var_Pop_Fields = { + __typename?: 'post_types_var_pop_fields', id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Var_Pop_Order_By = { +export type Post_Types_Var_Pop_Order_By = { id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Var_Samp_Fields = { - __typename?: 'post_votes_var_samp_fields', +export type Post_Types_Var_Samp_Fields = { + __typename?: 'post_types_var_samp_fields', id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Var_Samp_Order_By = { +export type Post_Types_Var_Samp_Order_By = { id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Variance_Fields = { - __typename?: 'post_votes_variance_fields', +export type Post_Types_Variance_Fields = { + __typename?: 'post_types_variance_fields', id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; -export type Post_Votes_Variance_Order_By = { +export type Post_Types_Variance_Order_By = { id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, }; export type Posts = { @@ -6318,14 +6650,11 @@ export type Posts = { comments_aggregate: Comments_Aggregate, content?: Maybe, created_at: Scalars['timestamptz'], - has_poll: Scalars['Boolean'], id: Scalars['Int'], onchain_link?: Maybe, - poll_block_number_end?: Maybe, + poll?: Maybe, post_reactions: Array, post_reactions_aggregate: Post_Reactions_Aggregate, - post_votes: Array, - post_votes_aggregate: Post_Votes_Aggregate, title?: Maybe, topic: Post_Topics, topic_id: Scalars['Int'], @@ -6370,24 +6699,6 @@ export type PostsPost_Reactions_AggregateArgs = { where?: Maybe }; - -export type PostsPost_VotesArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type PostsPost_Votes_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - export type Posts_Aggregate = { __typename?: 'posts_aggregate', aggregate?: Maybe, @@ -6438,7 +6749,6 @@ export type Posts_Avg_Fields = { __typename?: 'posts_avg_fields', author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6446,7 +6756,6 @@ export type Posts_Avg_Fields = { export type Posts_Avg_Order_By = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6459,12 +6768,10 @@ export type Posts_Bool_Exp = { comments?: Maybe, content?: Maybe, created_at?: Maybe, - has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, - poll_block_number_end?: Maybe, + poll?: Maybe, post_reactions?: Maybe, - post_votes?: Maybe, title?: Maybe, topic?: Maybe, topic_id?: Maybe, @@ -6480,7 +6787,6 @@ export enum Posts_Constraint { export type Posts_Inc_Input = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6490,12 +6796,10 @@ export type Posts_Insert_Input = { comments?: Maybe, content?: Maybe, created_at?: Maybe, - has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, - poll_block_number_end?: Maybe, + poll?: Maybe, post_reactions?: Maybe, - post_votes?: Maybe, title?: Maybe, topic?: Maybe, topic_id?: Maybe, @@ -6510,7 +6814,6 @@ export type Posts_Max_Fields = { content?: Maybe, created_at?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6522,7 +6825,6 @@ export type Posts_Max_Order_By = { content?: Maybe, created_at?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6535,7 +6837,6 @@ export type Posts_Min_Fields = { content?: Maybe, created_at?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6547,7 +6848,6 @@ export type Posts_Min_Order_By = { content?: Maybe, created_at?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6576,12 +6876,10 @@ export type Posts_Order_By = { comments_aggregate?: Maybe, content?: Maybe, created_at?: Maybe, - has_poll?: Maybe, id?: Maybe, onchain_link?: Maybe, - poll_block_number_end?: Maybe, + poll?: Maybe, post_reactions_aggregate?: Maybe, - post_votes_aggregate?: Maybe, title?: Maybe, topic?: Maybe, topic_id?: Maybe, @@ -6598,9 +6896,7 @@ export enum Posts_Select_Column { AuthorId = 'author_id', Content = 'content', CreatedAt = 'created_at', - HasPoll = 'has_poll', Id = 'id', - PollBlockNumberEnd = 'poll_block_number_end', Title = 'title', TopicId = 'topic_id', TypeId = 'type_id', @@ -6611,9 +6907,7 @@ export type Posts_Set_Input = { author_id?: Maybe, content?: Maybe, created_at?: Maybe, - has_poll?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, title?: Maybe, topic_id?: Maybe, type_id?: Maybe, @@ -6624,7 +6918,6 @@ export type Posts_Stddev_Fields = { __typename?: 'posts_stddev_fields', author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6632,7 +6925,6 @@ export type Posts_Stddev_Fields = { export type Posts_Stddev_Order_By = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6641,7 +6933,6 @@ export type Posts_Stddev_Pop_Fields = { __typename?: 'posts_stddev_pop_fields', author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6649,7 +6940,6 @@ export type Posts_Stddev_Pop_Fields = { export type Posts_Stddev_Pop_Order_By = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6658,7 +6948,6 @@ export type Posts_Stddev_Samp_Fields = { __typename?: 'posts_stddev_samp_fields', author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6666,7 +6955,6 @@ export type Posts_Stddev_Samp_Fields = { export type Posts_Stddev_Samp_Order_By = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6675,7 +6963,6 @@ export type Posts_Sum_Fields = { __typename?: 'posts_sum_fields', author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6683,7 +6970,6 @@ export type Posts_Sum_Fields = { export type Posts_Sum_Order_By = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6692,9 +6978,7 @@ export enum Posts_Update_Column { AuthorId = 'author_id', Content = 'content', CreatedAt = 'created_at', - HasPoll = 'has_poll', Id = 'id', - PollBlockNumberEnd = 'poll_block_number_end', Title = 'title', TopicId = 'topic_id', TypeId = 'type_id', @@ -6705,7 +6989,6 @@ export type Posts_Var_Pop_Fields = { __typename?: 'posts_var_pop_fields', author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6713,7 +6996,6 @@ export type Posts_Var_Pop_Fields = { export type Posts_Var_Pop_Order_By = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6722,7 +7004,6 @@ export type Posts_Var_Samp_Fields = { __typename?: 'posts_var_samp_fields', author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6730,7 +7011,6 @@ export type Posts_Var_Samp_Fields = { export type Posts_Var_Samp_Order_By = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6739,7 +7019,6 @@ export type Posts_Variance_Fields = { __typename?: 'posts_variance_fields', author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -6747,7 +7026,6 @@ export type Posts_Variance_Fields = { export type Posts_Variance_Order_By = { author_id?: Maybe, id?: Maybe, - poll_block_number_end?: Maybe, topic_id?: Maybe, type_id?: Maybe, }; @@ -8260,6 +8538,12 @@ export type Query_Root = { onchain_links: Array, onchain_links_aggregate: Onchain_Links_Aggregate, onchain_links_by_pk?: Maybe, + poll: Array, + poll_aggregate: Poll_Aggregate, + poll_by_pk?: Maybe, + poll_votes: Array, + poll_votes_aggregate: Poll_Votes_Aggregate, + poll_votes_by_pk?: Maybe, post_reactions: Array, post_reactions_aggregate: Post_Reactions_Aggregate, post_reactions_by_pk?: Maybe, @@ -8269,9 +8553,6 @@ export type Query_Root = { post_types: Array, post_types_aggregate: Post_Types_Aggregate, post_types_by_pk?: Maybe, - post_votes: Array, - post_votes_aggregate: Post_Votes_Aggregate, - post_votes_by_pk?: Maybe, posts: Array, posts_aggregate: Posts_Aggregate, posts_by_pk?: Maybe, @@ -8697,6 +8978,52 @@ export type Query_RootOnchain_Links_By_PkArgs = { }; +export type Query_RootPollArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Query_RootPoll_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Query_RootPoll_By_PkArgs = { + id: Scalars['Int'] +}; + + +export type Query_RootPoll_VotesArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Query_RootPoll_Votes_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Query_RootPoll_Votes_By_PkArgs = { + id: Scalars['Int'] +}; + + export type Query_RootPost_ReactionsArgs = { distinct_on?: Maybe>, limit?: Maybe, @@ -8766,29 +9093,6 @@ export type Query_RootPost_Types_By_PkArgs = { }; -export type Query_RootPost_VotesArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Query_RootPost_Votes_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Query_RootPost_Votes_By_PkArgs = { - id: Scalars['Int'] -}; - - export type Query_RootPostsArgs = { distinct_on?: Maybe>, limit?: Maybe, @@ -10314,6 +10618,12 @@ export type Subscription_Root = { onchain_links: Array, onchain_links_aggregate: Onchain_Links_Aggregate, onchain_links_by_pk?: Maybe, + poll: Array, + poll_aggregate: Poll_Aggregate, + poll_by_pk?: Maybe, + poll_votes: Array, + poll_votes_aggregate: Poll_Votes_Aggregate, + poll_votes_by_pk?: Maybe, post_reactions: Array, post_reactions_aggregate: Post_Reactions_Aggregate, post_reactions_by_pk?: Maybe, @@ -10323,9 +10633,6 @@ export type Subscription_Root = { post_types: Array, post_types_aggregate: Post_Types_Aggregate, post_types_by_pk?: Maybe, - post_votes: Array, - post_votes_aggregate: Post_Votes_Aggregate, - post_votes_by_pk?: Maybe, posts: Array, posts_aggregate: Posts_Aggregate, posts_by_pk?: Maybe, @@ -10472,6 +10779,52 @@ export type Subscription_RootOnchain_Links_By_PkArgs = { }; +export type Subscription_RootPollArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Subscription_RootPoll_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Subscription_RootPoll_By_PkArgs = { + id: Scalars['Int'] +}; + + +export type Subscription_RootPoll_VotesArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Subscription_RootPoll_Votes_AggregateArgs = { + distinct_on?: Maybe>, + limit?: Maybe, + offset?: Maybe, + order_by?: Maybe>, + where?: Maybe +}; + + +export type Subscription_RootPoll_Votes_By_PkArgs = { + id: Scalars['Int'] +}; + + export type Subscription_RootPost_ReactionsArgs = { distinct_on?: Maybe>, limit?: Maybe, @@ -10541,29 +10894,6 @@ export type Subscription_RootPost_Types_By_PkArgs = { }; -export type Subscription_RootPost_VotesArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Subscription_RootPost_Votes_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Subscription_RootPost_Votes_By_PkArgs = { - id: Scalars['Int'] -}; - - export type Subscription_RootPostsArgs = { distinct_on?: Maybe>, limit?: Maybe, @@ -11638,54 +11968,72 @@ export type GetCouncilMembersQuery = ( )>> } ); -export type PostVotesFieldsFragment = ( - { __typename?: 'post_votes' } - & Pick +export type PollFieldsFragment = ( + { __typename?: 'poll' } + & Pick +); + +export type PollQueryVariables = { + postId: Scalars['Int'] +}; + + +export type PollQuery = ( + { __typename?: 'query_root' } + & { poll: Array<( + { __typename?: 'poll' } + & PollFieldsFragment + )> } +); + +export type PollVotesFieldsFragment = ( + { __typename?: 'poll_votes' } + & Pick & { voter: Maybe<( { __typename?: 'User' } & Pick )> } ); -export type PostVotesQueryVariables = { - postId: Scalars['Int'] +export type PollVotesQueryVariables = { + pollId: Scalars['Int'] }; -export type PostVotesQuery = ( +export type PollVotesQuery = ( { __typename?: 'query_root' } - & { post_votes: Array<( - { __typename?: 'post_votes' } - & PostVotesFieldsFragment + & { poll_votes: Array<( + { __typename?: 'poll_votes' } + & PollVotesFieldsFragment )> } ); -export type AddPostVoteMutationVariables = { - postId: Scalars['Int'], +export type AddPollVoteMutationVariables = { + pollId: Scalars['Int'], userId: Scalars['Int'], vote: Scalars['bpchar'] }; -export type AddPostVoteMutation = ( +export type AddPollVoteMutation = ( { __typename: 'mutation_root' } - & { insert_post_votes_one: Maybe<( - { __typename?: 'post_votes' } - & Pick + & { insert_poll_votes_one: Maybe<( + { __typename?: 'poll_votes' } + & Pick )> } ); export type DeleteVoteMutationVariables = { - postId: Scalars['Int'], + pollId: Scalars['Int'], userId: Scalars['Int'] }; export type DeleteVoteMutation = ( { __typename?: 'mutation_root' } - & { delete_post_votes: Maybe<( - { __typename?: 'post_votes_mutation_response' } - & Pick + & { delete_poll_votes: Maybe<( + { __typename?: 'poll_votes_mutation_response' } + & Pick )> } ); @@ -11968,9 +12316,7 @@ export type CreatePostMutationVariables = { userId: Scalars['Int'], content: Scalars['String'], topicId: Scalars['Int'], - title: Scalars['String'], - hasPoll?: Maybe, - pollBlockNumberEnd?: Maybe + title: Scalars['String'] }; @@ -11986,6 +12332,20 @@ export type CreatePostMutation = ( )> } ); +export type CreatePollMutationVariables = { + postId: Scalars['Int'], + blockEnd: Scalars['Int'] +}; + + +export type CreatePollMutation = ( + { __typename: 'mutation_root' } + & { insert_poll: Maybe<( + { __typename?: 'poll_mutation_response' } + & Pick + )> } +); + export type TopicFragment = ( { __typename?: 'post_topics' } & Pick @@ -12020,7 +12380,7 @@ export type OnchainLinkDiscussionFragment = ( export type DiscussionPostFragment = ( { __typename?: 'posts' } - & Pick + & Pick & { author: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment @@ -12702,8 +13062,16 @@ export type VerifyEmailMutation = ( )> } ); -export const PostVotesFieldsFragmentDoc = gql` - fragment postVotesFields on post_votes { +export const PollFieldsFragmentDoc = gql` + fragment pollFields on poll { + id + block_end + created_at + updated_at +} + `; +export const PollVotesFieldsFragmentDoc = gql` + fragment pollVotesFields on poll_votes { id voter { id @@ -12782,8 +13150,6 @@ export const DiscussionPostFragmentDoc = gql` } content created_at - has_poll - poll_block_number_end id updated_at comments(order_by: {created_at: asc}) { @@ -13241,77 +13607,110 @@ export function useGetCouncilMembersLazyQuery(baseOptions?: ApolloReactHooks.Laz export type GetCouncilMembersQueryHookResult = ReturnType; export type GetCouncilMembersLazyQueryHookResult = ReturnType; export type GetCouncilMembersQueryResult = ApolloReactCommon.QueryResult; -export const PostVotesDocument = gql` - query PostVotes($postId: Int!) { - post_votes(where: {post_id: {_eq: $postId}}) { - ...postVotesFields +export const PollDocument = gql` + query Poll($postId: Int!) { + poll(where: {post_id: {_eq: $postId}}) { + ...pollFields } } - ${PostVotesFieldsFragmentDoc}`; + ${PollFieldsFragmentDoc}`; /** - * __usePostVotesQuery__ + * __usePollQuery__ * - * To run a query within a React component, call `usePostVotesQuery` and pass it any options that fit your needs. - * When your component renders, `usePostVotesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `usePollQuery` and pass it any options that fit your needs. + * When your component renders, `usePollQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = usePostVotesQuery({ + * const { data, loading, error } = usePollQuery({ * variables: { * postId: // value for 'postId' * }, * }); */ -export function usePostVotesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { - return ApolloReactHooks.useQuery(PostVotesDocument, baseOptions); +export function usePollQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + return ApolloReactHooks.useQuery(PollDocument, baseOptions); + } +export function usePollLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + return ApolloReactHooks.useLazyQuery(PollDocument, baseOptions); + } +export type PollQueryHookResult = ReturnType; +export type PollLazyQueryHookResult = ReturnType; +export type PollQueryResult = ApolloReactCommon.QueryResult; +export const PollVotesDocument = gql` + query PollVotes($pollId: Int!) { + poll_votes(where: {poll_id: {_eq: $pollId}}) { + ...pollVotesFields + } +} + ${PollVotesFieldsFragmentDoc}`; + +/** + * __usePollVotesQuery__ + * + * To run a query within a React component, call `usePollVotesQuery` and pass it any options that fit your needs. + * When your component renders, `usePollVotesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = usePollVotesQuery({ + * variables: { + * pollId: // value for 'pollId' + * }, + * }); + */ +export function usePollVotesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { + return ApolloReactHooks.useQuery(PollVotesDocument, baseOptions); } -export function usePostVotesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { - return ApolloReactHooks.useLazyQuery(PostVotesDocument, baseOptions); +export function usePollVotesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { + return ApolloReactHooks.useLazyQuery(PollVotesDocument, baseOptions); } -export type PostVotesQueryHookResult = ReturnType; -export type PostVotesLazyQueryHookResult = ReturnType; -export type PostVotesQueryResult = ApolloReactCommon.QueryResult; -export const AddPostVoteDocument = gql` - mutation AddPostVote($postId: Int!, $userId: Int!, $vote: bpchar!) { +export type PollVotesQueryHookResult = ReturnType; +export type PollVotesLazyQueryHookResult = ReturnType; +export type PollVotesQueryResult = ApolloReactCommon.QueryResult; +export const AddPollVoteDocument = gql` + mutation AddPollVote($pollId: Int!, $userId: Int!, $vote: bpchar!) { __typename - insert_post_votes_one(object: {post_id: $postId, user_id: $userId, vote: $vote}) { + insert_poll_votes_one(object: {poll_id: $pollId, user_id: $userId, vote: $vote}) { id } } `; -export type AddPostVoteMutationFn = ApolloReactCommon.MutationFunction; +export type AddPollVoteMutationFn = ApolloReactCommon.MutationFunction; /** - * __useAddPostVoteMutation__ + * __useAddPollVoteMutation__ * - * To run a mutation, you first call `useAddPostVoteMutation` within a React component and pass it any options that fit your needs. - * When your component renders, `useAddPostVoteMutation` returns a tuple that includes: + * To run a mutation, you first call `useAddPollVoteMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useAddPollVoteMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example - * const [addPostVoteMutation, { data, loading, error }] = useAddPostVoteMutation({ + * const [addPollVoteMutation, { data, loading, error }] = useAddPollVoteMutation({ * variables: { - * postId: // value for 'postId' + * pollId: // value for 'pollId' * userId: // value for 'userId' * vote: // value for 'vote' * }, * }); */ -export function useAddPostVoteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { - return ApolloReactHooks.useMutation(AddPostVoteDocument, baseOptions); +export function useAddPollVoteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(AddPollVoteDocument, baseOptions); } -export type AddPostVoteMutationHookResult = ReturnType; -export type AddPostVoteMutationResult = ApolloReactCommon.MutationResult; -export type AddPostVoteMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type AddPollVoteMutationHookResult = ReturnType; +export type AddPollVoteMutationResult = ApolloReactCommon.MutationResult; +export type AddPollVoteMutationOptions = ApolloReactCommon.BaseMutationOptions; export const DeleteVoteDocument = gql` - mutation DeleteVote($postId: Int!, $userId: Int!) { - delete_post_votes(where: {_and: [{post_id: {_eq: $postId}}, {user_id: {_eq: $userId}}]}) { + mutation DeleteVote($pollId: Int!, $userId: Int!) { + delete_poll_votes(where: {_and: [{poll_id: {_eq: $pollId}}, {user_id: {_eq: $userId}}]}) { affected_rows } } @@ -13331,7 +13730,7 @@ export type DeleteVoteMutationFn = ApolloReactCommon.MutationFunction; export type Get_Refresh_TokenQueryResult = ApolloReactCommon.QueryResult; export const CreatePostDocument = gql` - mutation createPost($userId: Int!, $content: String!, $topicId: Int!, $title: String!, $hasPoll: Boolean, $pollBlockNumberEnd: Int) { + mutation createPost($userId: Int!, $content: String!, $topicId: Int!, $title: String!) { __typename - insert_posts(objects: {author_id: $userId, content: $content, title: $title, topic_id: $topicId, has_poll: $hasPoll, poll_block_number_end: $pollBlockNumberEnd}) { + insert_posts(objects: {author_id: $userId, content: $content, title: $title, topic_id: $topicId}) { affected_rows returning { id @@ -13947,8 +14346,6 @@ export type CreatePostMutationFn = ApolloReactCommon.MutationFunction; export type CreatePostMutationResult = ApolloReactCommon.MutationResult; export type CreatePostMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const CreatePollDocument = gql` + mutation createPoll($postId: Int!, $blockEnd: Int!) { + __typename + insert_poll(objects: {post_id: $postId, block_end: $blockEnd}) { + affected_rows + } +} + `; +export type CreatePollMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useCreatePollMutation__ + * + * To run a mutation, you first call `useCreatePollMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCreatePollMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [createPollMutation, { data, loading, error }] = useCreatePollMutation({ + * variables: { + * postId: // value for 'postId' + * blockEnd: // value for 'blockEnd' + * }, + * }); + */ +export function useCreatePollMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(CreatePollDocument, baseOptions); + } +export type CreatePollMutationHookResult = ReturnType; +export type CreatePollMutationResult = ApolloReactCommon.MutationResult; +export type CreatePollMutationOptions = ApolloReactCommon.BaseMutationOptions; export const Post_TopicsDocument = gql` query Post_topics { post_topics { diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index 7224bbbfb..f1ef538a9 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -11,7 +11,7 @@ import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; import { NotificationContext } from '../../context/NotificationContext'; import { UserDetailsContext } from '../../context/UserDetailsContext'; -import { useCreatePostMutation, useGetCurrentBlockNumberQuery, usePostSubscribeMutation } from '../../generated/graphql'; +import { useCreatePollMutation, useCreatePostMutation, useGetCurrentBlockNumberQuery, usePostSubscribeMutation } from '../../generated/graphql'; import { useBlockTime, useRouter } from '../../hooks'; import { NotificationStatus } from '../../types'; import Button from '../../ui-components/Button'; @@ -37,6 +37,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const { data } = useGetCurrentBlockNumberQuery(); const [createPostMutation, { loading, error }] = useCreatePostMutation(); + const [createPollMutation] = useCreatePollMutation(); const [postSubscribeMutation] = usePostSubscribeMutation(); const [isSending, setIsSending] = useState(false); const { history } = useRouter(); @@ -59,31 +60,44 @@ const CreatePost = ({ className }:Props): JSX.Element => { .catch((e) => console.error('Error subscribing to post',e)); }; - const handleSend = () => { + const createPoll = (postId: number) => { + if (!hasPoll) { + return; + } + const blockNumber = data?.blockNumbers?.[0]?.number; if (!blockNumber) { - return queueNotification({ - header: 'Failed to get current block number!', + queueNotification({ + header: 'Failed to get current block number. Poll creation failed!', message: 'Failed', status: NotificationStatus.ERROR }); + return; } - const pollBlockNumberEnd = blockNumber + Math.floor(TWO_WEEKS / blocktime); + const blockEnd = blockNumber + Math.floor(TWO_WEEKS / blocktime); + createPollMutation({ + variables: { + blockEnd, + postId + } + }) + .catch((e) => console.error('Error subscribing to post',e)); + }; + + const handleSend = () => { if (currentUser.id && title && content && selectedTopic){ setIsSending(true); createPostMutation({ variables: { content, - hasPoll, - pollBlockNumberEnd, title, topicId: selectedTopic, userId: currentUser.id } }).then(({ data }) => { - if (data && data.insert_posts && data.insert_posts.affected_rows > 0 && data.insert_posts.returning.length && data.insert_posts.returning[0].id) { - const postId = data.insert_posts.returning.length && data.insert_posts.returning[0].id; + if (data?.insert_posts?.affected_rows && data?.insert_posts?.affected_rows > 0 && data?.insert_posts?.returning?.length && data?.insert_posts?.returning?.[0]?.id) { + const postId = data?.insert_posts?.returning?.[0]?.id; history.push(`/post/${postId}`); queueNotification({ header: 'Thanks for sharing!', @@ -91,12 +105,13 @@ const CreatePost = ({ className }:Props): JSX.Element => { status: NotificationStatus.SUCCESS }); createSubscription(postId); + createPoll(postId); } else { throw Error('Error in post creation'); } }).catch( e => console.error(e)); } else { - console.error('Current userid, title, content or selected topic missing',currentUser.id,title, content, selectedTopic); + console.error('Current userid, title, content or selected topic missing',currentUser.id, title, content, selectedTopic); } }; diff --git a/front-end/src/screens/CreatePost/query.ts b/front-end/src/screens/CreatePost/query.ts index 8913a6cd1..319d11283 100644 --- a/front-end/src/screens/CreatePost/query.ts +++ b/front-end/src/screens/CreatePost/query.ts @@ -5,15 +5,13 @@ import gql from 'graphql-tag'; export const CREATE_POST = gql` - mutation createPost($userId: Int! $content: String! $topicId: Int! $title: String!, $hasPoll: Boolean, $pollBlockNumberEnd: Int) { + mutation createPost($userId: Int! $content: String! $topicId: Int! $title: String!) { __typename insert_posts(objects: { author_id: $userId, content: $content, title: $title, topic_id: $topicId, - has_poll: $hasPoll, - poll_block_number_end: $pollBlockNumberEnd }) { affected_rows returning { @@ -23,6 +21,15 @@ export const CREATE_POST = gql` } `; +export const CREATE_POLL = gql` + mutation createPoll($postId: Int! $blockEnd: Int!) { + __typename + insert_poll(objects: {post_id: $postId, block_end: $blockEnd}) { + affected_rows + } + } +`; + const topic_fragment = gql` fragment topic on post_topics { id diff --git a/front-end/src/screens/DiscussionPost/query.ts b/front-end/src/screens/DiscussionPost/query.ts index 62342f145..230cd6097 100644 --- a/front-end/src/screens/DiscussionPost/query.ts +++ b/front-end/src/screens/DiscussionPost/query.ts @@ -24,8 +24,6 @@ const discussionPost = gql` } content created_at - has_poll - poll_block_number_end id updated_at comments(order_by: {created_at: asc}) { diff --git a/hasura/hasura-migrations/migrations/1591691644022_create_table_public_poll/down.yaml b/hasura/hasura-migrations/migrations/1591691644022_create_table_public_poll/down.yaml new file mode 100644 index 000000000..5c2dced07 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591691644022_create_table_public_poll/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: DROP TABLE "public"."poll"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591691644022_create_table_public_poll/up.yaml b/hasura/hasura-migrations/migrations/1591691644022_create_table_public_poll/up.yaml new file mode 100644 index 000000000..73b15004f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591691644022_create_table_public_poll/up.yaml @@ -0,0 +1,10 @@ +- args: + cascade: false + read_only: false + sql: CREATE TABLE "public"."poll"("id" serial NOT NULL, "block_end" integer NOT + NULL, PRIMARY KEY ("id") , UNIQUE ("id")); + type: run_sql +- args: + name: poll + schema: public + type: add_existing_table_or_view diff --git a/hasura/hasura-migrations/migrations/1591691691193_alter_table_public_posts_add_column_poll_id/down.yaml b/hasura/hasura-migrations/migrations/1591691691193_alter_table_public_posts_add_column_poll_id/down.yaml new file mode 100644 index 000000000..7c7dc2f32 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591691691193_alter_table_public_posts_add_column_poll_id/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" DROP COLUMN "poll_id"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591691691193_alter_table_public_posts_add_column_poll_id/up.yaml b/hasura/hasura-migrations/migrations/1591691691193_alter_table_public_posts_add_column_poll_id/up.yaml new file mode 100644 index 000000000..8eddb22ea --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591691691193_alter_table_public_posts_add_column_poll_id/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ADD COLUMN "poll_id" integer NULL; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591691714640_set_fk_public_posts_poll_id/down.yaml b/hasura/hasura-migrations/migrations/1591691714640_set_fk_public_posts_poll_id/down.yaml new file mode 100644 index 000000000..c01dc0811 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591691714640_set_fk_public_posts_poll_id/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."posts" drop constraint "posts_poll_id_fkey"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591691714640_set_fk_public_posts_poll_id/up.yaml b/hasura/hasura-migrations/migrations/1591691714640_set_fk_public_posts_poll_id/up.yaml new file mode 100644 index 000000000..8b5f0ce4b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591691714640_set_fk_public_posts_poll_id/up.yaml @@ -0,0 +1,10 @@ +- args: + cascade: false + read_only: false + sql: |- + alter table "public"."posts" + add constraint "posts_poll_id_fkey" + foreign key ("poll_id") + references "public"."poll" + ("id") on update restrict on delete restrict; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591691750165_add_relationship__table_public_posts/down.yaml b/hasura/hasura-migrations/migrations/1591691750165_add_relationship__table_public_posts/down.yaml new file mode 100644 index 000000000..46e357054 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591691750165_add_relationship__table_public_posts/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: poll + table: + name: posts + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591691750165_add_relationship__table_public_posts/up.yaml b/hasura/hasura-migrations/migrations/1591691750165_add_relationship__table_public_posts/up.yaml new file mode 100644 index 000000000..5a55bfbe1 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591691750165_add_relationship__table_public_posts/up.yaml @@ -0,0 +1,8 @@ +- args: + name: poll + table: + name: posts + schema: public + using: + foreign_key_constraint_on: poll_id + type: create_object_relationship diff --git a/hasura/hasura-migrations/migrations/1591692079949_create_table_public_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591692079949_create_table_public_poll_votes/down.yaml new file mode 100644 index 000000000..2b34bd630 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692079949_create_table_public_poll_votes/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: DROP TABLE "public"."poll_votes"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591692079949_create_table_public_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591692079949_create_table_public_poll_votes/up.yaml new file mode 100644 index 000000000..c3b726c24 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692079949_create_table_public_poll_votes/up.yaml @@ -0,0 +1,13 @@ +- args: + cascade: false + read_only: false + sql: CREATE TABLE "public"."poll_votes"("id" serial NOT NULL, "poll_id" integer + NOT NULL, "user_id" integer NOT NULL, "vote" bpchar NOT NULL, "created_at" timestamp + NOT NULL DEFAULT now(), "updated_at" timestamp NOT NULL DEFAULT now(), PRIMARY + KEY ("id") , FOREIGN KEY ("poll_id") REFERENCES "public"."poll"("id") ON UPDATE + restrict ON DELETE restrict, UNIQUE ("id")); + type: run_sql +- args: + name: poll_votes + schema: public + type: add_existing_table_or_view diff --git a/hasura/hasura-migrations/migrations/1591692108483_add_relationship__table_public_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591692108483_add_relationship__table_public_poll_votes/down.yaml new file mode 100644 index 000000000..50e238c8b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692108483_add_relationship__table_public_poll_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: poll + table: + name: poll_votes + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591692108483_add_relationship__table_public_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591692108483_add_relationship__table_public_poll_votes/up.yaml new file mode 100644 index 000000000..b004fa6f2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692108483_add_relationship__table_public_poll_votes/up.yaml @@ -0,0 +1,8 @@ +- args: + name: poll + table: + name: poll_votes + schema: public + using: + foreign_key_constraint_on: poll_id + type: create_object_relationship diff --git a/hasura/hasura-migrations/migrations/1591692145733_table_poll_votes_create_remote_relationship_voter/down.yaml b/hasura/hasura-migrations/migrations/1591692145733_table_poll_votes_create_remote_relationship_voter/down.yaml new file mode 100644 index 000000000..88849afeb --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692145733_table_poll_votes_create_remote_relationship_voter/down.yaml @@ -0,0 +1,6 @@ +- args: + name: voter + table: + name: poll_votes + schema: public + type: delete_remote_relationship diff --git a/hasura/hasura-migrations/migrations/1591692145733_table_poll_votes_create_remote_relationship_voter/up.yaml b/hasura/hasura-migrations/migrations/1591692145733_table_poll_votes_create_remote_relationship_voter/up.yaml new file mode 100644 index 000000000..0c6d1f417 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692145733_table_poll_votes_create_remote_relationship_voter/up.yaml @@ -0,0 +1,13 @@ +- args: + hasura_fields: + - user_id + name: voter + remote_field: + user: + arguments: + id: $user_id + remote_schema: auth + table: + name: poll_votes + schema: public + type: create_remote_relationship diff --git a/hasura/hasura-migrations/migrations/1591692234831_add_relationship__table_public_poll/down.yaml b/hasura/hasura-migrations/migrations/1591692234831_add_relationship__table_public_poll/down.yaml new file mode 100644 index 000000000..61d1271e2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692234831_add_relationship__table_public_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: posts + table: + name: poll + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591692234831_add_relationship__table_public_poll/up.yaml b/hasura/hasura-migrations/migrations/1591692234831_add_relationship__table_public_poll/up.yaml new file mode 100644 index 000000000..1f95f4c8d --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692234831_add_relationship__table_public_poll/up.yaml @@ -0,0 +1,12 @@ +- args: + name: posts + table: + name: poll + schema: public + using: + foreign_key_constraint_on: + column: poll_id + table: + name: posts + schema: public + type: create_array_relationship diff --git a/hasura/hasura-migrations/migrations/1591692243735_add_relationship__table_public_poll/down.yaml b/hasura/hasura-migrations/migrations/1591692243735_add_relationship__table_public_poll/down.yaml new file mode 100644 index 000000000..991bdd43d --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692243735_add_relationship__table_public_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: poll_votes + table: + name: poll + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591692243735_add_relationship__table_public_poll/up.yaml b/hasura/hasura-migrations/migrations/1591692243735_add_relationship__table_public_poll/up.yaml new file mode 100644 index 000000000..21aac6a4f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692243735_add_relationship__table_public_poll/up.yaml @@ -0,0 +1,12 @@ +- args: + name: poll_votes + table: + name: poll + schema: public + using: + foreign_key_constraint_on: + column: poll_id + table: + name: poll_votes + schema: public + type: create_array_relationship diff --git a/hasura/hasura-migrations/migrations/1591692261923_drop_relationship_post_votes_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591692261923_drop_relationship_post_votes_public_table_posts/down.yaml new file mode 100644 index 000000000..4b4f19249 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692261923_drop_relationship_post_votes_public_table_posts/down.yaml @@ -0,0 +1,12 @@ +- args: + name: post_votes + table: + name: posts + schema: public + using: + foreign_key_constraint_on: + column: post_id + table: + name: post_votes + schema: public + type: create_array_relationship diff --git a/hasura/hasura-migrations/migrations/1591692261923_drop_relationship_post_votes_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591692261923_drop_relationship_post_votes_public_table_posts/up.yaml new file mode 100644 index 000000000..a47e326ca --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692261923_drop_relationship_post_votes_public_table_posts/up.yaml @@ -0,0 +1,6 @@ +- args: + relationship: post_votes + table: + name: posts + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591692369110_alter_table_public_poll_add_column_created_at/down.yaml b/hasura/hasura-migrations/migrations/1591692369110_alter_table_public_poll_add_column_created_at/down.yaml new file mode 100644 index 000000000..91a29cc29 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692369110_alter_table_public_poll_add_column_created_at/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" DROP COLUMN "created_at"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591692369110_alter_table_public_poll_add_column_created_at/up.yaml b/hasura/hasura-migrations/migrations/1591692369110_alter_table_public_poll_add_column_created_at/up.yaml new file mode 100644 index 000000000..f29f1540f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692369110_alter_table_public_poll_add_column_created_at/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" ADD COLUMN "created_at" timestamp NOT NULL DEFAULT + now(); + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591692383595_alter_table_public_poll_add_column_updated_at/down.yaml b/hasura/hasura-migrations/migrations/1591692383595_alter_table_public_poll_add_column_updated_at/down.yaml new file mode 100644 index 000000000..72b315ef4 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692383595_alter_table_public_poll_add_column_updated_at/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" DROP COLUMN "updated_at"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591692383595_alter_table_public_poll_add_column_updated_at/up.yaml b/hasura/hasura-migrations/migrations/1591692383595_alter_table_public_poll_add_column_updated_at/up.yaml new file mode 100644 index 000000000..b0f9b9e34 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692383595_alter_table_public_poll_add_column_updated_at/up.yaml @@ -0,0 +1,6 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" ADD COLUMN "updated_at" timestamp NOT NULL DEFAULT + now(); + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591692413798_update_permission_anonymous_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591692413798_update_permission_anonymous_public_table_poll/down.yaml new file mode 100644 index 000000000..652307632 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692413798_update_permission_anonymous_public_table_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + role: anonymous + table: + name: poll + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1591692413798_update_permission_anonymous_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591692413798_update_permission_anonymous_public_table_poll/up.yaml new file mode 100644 index 000000000..a5e8e405a --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692413798_update_permission_anonymous_public_table_poll/up.yaml @@ -0,0 +1,17 @@ +- args: + permission: + allow_aggregations: true + backend_only: false + columns: + - id + - block_end + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: anonymous + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591692844048_apply_same_permissions_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591692844048_apply_same_permissions_public_table_poll/down.yaml new file mode 100644 index 000000000..50d7f69f3 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692844048_apply_same_permissions_public_table_poll/down.yaml @@ -0,0 +1,12 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_insert_permission +- args: + role: user + table: + name: poll + schema: public + type: drop_update_permission diff --git a/hasura/hasura-migrations/migrations/1591692844048_apply_same_permissions_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591692844048_apply_same_permissions_public_table_poll/up.yaml new file mode 100644 index 000000000..19fb5c13a --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692844048_apply_same_permissions_public_table_poll/up.yaml @@ -0,0 +1,36 @@ +- args: + permission: + allow_upsert: true + backend_only: false + check: + posts: + author_id: + _eq: X-Hasura-User-Id + columns: + - block_end + filter: + posts: + author_id: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: poll + schema: public + type: create_update_permission +- args: + permission: + allow_upsert: true + backend_only: false + check: + posts: + author_id: + _eq: X-Hasura-User-Id + columns: + - block_end + set: {} + role: user + table: + name: poll + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591692878220_update_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591692878220_update_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..92aad81d2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692878220_update_permission_user_public_table_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1591692878220_update_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591692878220_update_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..bdd9f0aeb --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692878220_update_permission_user_public_table_poll/up.yaml @@ -0,0 +1,17 @@ +- args: + permission: + allow_aggregations: true + backend_only: false + columns: + - block_end + - id + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: user + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591692915618_apply_same_permissions_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591692915618_apply_same_permissions_public_table_poll/down.yaml new file mode 100644 index 000000000..aff1db422 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692915618_apply_same_permissions_public_table_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591692915618_apply_same_permissions_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591692915618_apply_same_permissions_public_table_poll/up.yaml new file mode 100644 index 000000000..5bc9b0ef0 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692915618_apply_same_permissions_public_table_poll/up.yaml @@ -0,0 +1,19 @@ +- args: + permission: + backend_only: false + check: + posts: + author_id: + _eq: X-Hasura-User-Id + columns: + - block_end + filter: + posts: + author_id: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: poll + schema: public + type: create_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591692960440_update_permission_anonymous_public_table_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591692960440_update_permission_anonymous_public_table_poll_votes/down.yaml new file mode 100644 index 000000000..e93d81cd6 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692960440_update_permission_anonymous_public_table_poll_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: anonymous + table: + name: poll_votes + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1591692960440_update_permission_anonymous_public_table_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591692960440_update_permission_anonymous_public_table_poll_votes/up.yaml new file mode 100644 index 000000000..60d5ff0ea --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692960440_update_permission_anonymous_public_table_poll_votes/up.yaml @@ -0,0 +1,19 @@ +- args: + permission: + allow_aggregations: true + backend_only: false + columns: + - id + - poll_id + - user_id + - vote + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: anonymous + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591692994943_update_permission_user_public_table_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591692994943_update_permission_user_public_table_poll_votes/down.yaml new file mode 100644 index 000000000..88f7801dc --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692994943_update_permission_user_public_table_poll_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll_votes + schema: public + type: drop_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591692994943_update_permission_user_public_table_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591692994943_update_permission_user_public_table_poll_votes/up.yaml new file mode 100644 index 000000000..8ebe5a950 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591692994943_update_permission_user_public_table_poll_votes/up.yaml @@ -0,0 +1,17 @@ +- args: + permission: + allow_upsert: true + backend_only: false + check: + user_id: + _eq: X-Hasura-User-Id + columns: + - poll_id + - user_id + - vote + set: {} + role: user + table: + name: poll_votes + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591693013352_apply_same_permissions_public_table_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591693013352_apply_same_permissions_public_table_poll_votes/down.yaml new file mode 100644 index 000000000..f244e422e --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693013352_apply_same_permissions_public_table_poll_votes/down.yaml @@ -0,0 +1,12 @@ +- args: + role: user + table: + name: poll_votes + schema: public + type: drop_delete_permission +- args: + role: user + table: + name: poll_votes + schema: public + type: drop_update_permission diff --git a/hasura/hasura-migrations/migrations/1591693013352_apply_same_permissions_public_table_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591693013352_apply_same_permissions_public_table_poll_votes/up.yaml new file mode 100644 index 000000000..74c3cc193 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693013352_apply_same_permissions_public_table_poll_votes/up.yaml @@ -0,0 +1,38 @@ +- args: + permission: + backend_only: false + check: + user_id: + _eq: X-Hasura-User-Id + columns: + - poll_id + - user_id + - vote + filter: + user_id: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: poll_votes + schema: public + type: create_update_permission +- args: + permission: + backend_only: false + check: + user_id: + _eq: X-Hasura-User-Id + columns: + - poll_id + - user_id + - vote + filter: + user_id: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: poll_votes + schema: public + type: create_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591693032342_update_permission_user_public_table_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591693032342_update_permission_user_public_table_poll_votes/down.yaml new file mode 100644 index 000000000..369a7c5a2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693032342_update_permission_user_public_table_poll_votes/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll_votes + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1591693032342_update_permission_user_public_table_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591693032342_update_permission_user_public_table_poll_votes/up.yaml new file mode 100644 index 000000000..8a80c866f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693032342_update_permission_user_public_table_poll_votes/up.yaml @@ -0,0 +1,19 @@ +- args: + permission: + allow_aggregations: true + backend_only: false + columns: + - vote + - id + - poll_id + - user_id + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: user + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591693127056_update_permission_user_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591693127056_update_permission_user_public_table_posts/down.yaml new file mode 100644 index 000000000..bee48bc6b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693127056_update_permission_user_public_table_posts/down.yaml @@ -0,0 +1,27 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - poll_block_number_end + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591693127056_update_permission_user_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591693127056_update_permission_user_public_table_posts/up.yaml new file mode 100644 index 000000000..0fc1f36f1 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693127056_update_permission_user_public_table_posts/up.yaml @@ -0,0 +1,25 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591693135655_update_permission_user_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591693135655_update_permission_user_public_table_posts/down.yaml new file mode 100644 index 000000000..84ca41379 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693135655_update_permission_user_public_table_posts/down.yaml @@ -0,0 +1,28 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + _and: + - author_id: + _eq: X-Hasura-User-Id + - type_id: + _eq: 1 + columns: + - author_id + - poll_block_number_end + - content + - has_poll + - title + - topic_id + - type_id + set: {} + role: user + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591693135655_update_permission_user_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591693135655_update_permission_user_public_table_posts/up.yaml new file mode 100644 index 000000000..93ec82637 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693135655_update_permission_user_public_table_posts/up.yaml @@ -0,0 +1,26 @@ +- args: + role: user + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + _and: + - author_id: + _eq: X-Hasura-User-Id + - type_id: + _eq: 1 + columns: + - author_id + - content + - title + - topic_id + - type_id + set: {} + role: user + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591693143030_update_permission_proposal_bot_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591693143030_update_permission_proposal_bot_public_table_posts/down.yaml new file mode 100644 index 000000000..bd730fae0 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693143030_update_permission_proposal_bot_public_table_posts/down.yaml @@ -0,0 +1,25 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + author_id: + _eq: X-Hasura-User-Id + columns: + - author_id + - poll_block_number_end + - content + - has_poll + - title + - topic_id + - type_id + set: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591693143030_update_permission_proposal_bot_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591693143030_update_permission_proposal_bot_public_table_posts/up.yaml new file mode 100644 index 000000000..bc769a231 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693143030_update_permission_proposal_bot_public_table_posts/up.yaml @@ -0,0 +1,23 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_insert_permission +- args: + permission: + check: + author_id: + _eq: X-Hasura-User-Id + columns: + - author_id + - content + - title + - topic_id + - type_id + set: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591693151518_update_permission_proposal_bot_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591693151518_update_permission_proposal_bot_public_table_posts/down.yaml new file mode 100644 index 000000000..8a7259779 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693151518_update_permission_proposal_bot_public_table_posts/down.yaml @@ -0,0 +1,27 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - poll_block_number_end + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591693151518_update_permission_proposal_bot_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591693151518_update_permission_proposal_bot_public_table_posts/up.yaml new file mode 100644 index 000000000..434adfa6d --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693151518_update_permission_proposal_bot_public_table_posts/up.yaml @@ -0,0 +1,25 @@ +- args: + role: proposal_bot + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: proposal_bot + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591693193633_update_permission_anonymous_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591693193633_update_permission_anonymous_public_table_posts/down.yaml new file mode 100644 index 000000000..f401ecfe4 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693193633_update_permission_anonymous_public_table_posts/down.yaml @@ -0,0 +1,27 @@ +- args: + role: anonymous + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - poll_block_number_end + - content + - created_at + - has_poll + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591693193633_update_permission_anonymous_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591693193633_update_permission_anonymous_public_table_posts/up.yaml new file mode 100644 index 000000000..9a6f3cde9 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693193633_update_permission_anonymous_public_table_posts/up.yaml @@ -0,0 +1,25 @@ +- args: + role: anonymous + table: + name: posts + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: false + columns: + - author_id + - content + - created_at + - id + - title + - topic_id + - type_id + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: posts + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591693205543_alter_table_public_posts_drop_column_has_poll/down.yaml b/hasura/hasura-migrations/migrations/1591693205543_alter_table_public_posts_drop_column_has_poll/down.yaml new file mode 100644 index 000000000..6b612d737 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693205543_alter_table_public_posts_drop_column_has_poll/down.yaml @@ -0,0 +1,15 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ADD COLUMN "has_poll" bool; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ALTER COLUMN "has_poll" DROP NOT NULL; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ALTER COLUMN "has_poll" SET DEFAULT false; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591693205543_alter_table_public_posts_drop_column_has_poll/up.yaml b/hasura/hasura-migrations/migrations/1591693205543_alter_table_public_posts_drop_column_has_poll/up.yaml new file mode 100644 index 000000000..60cf12f15 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693205543_alter_table_public_posts_drop_column_has_poll/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" DROP COLUMN "has_poll" CASCADE; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591693227470_alter_table_public_posts_drop_column_poll_block_number_end/down.yaml b/hasura/hasura-migrations/migrations/1591693227470_alter_table_public_posts_drop_column_poll_block_number_end/down.yaml new file mode 100644 index 000000000..11061bc69 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693227470_alter_table_public_posts_drop_column_poll_block_number_end/down.yaml @@ -0,0 +1,11 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ADD COLUMN "poll_block_number_end" int4; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ALTER COLUMN "poll_block_number_end" DROP NOT + NULL; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591693227470_alter_table_public_posts_drop_column_poll_block_number_end/up.yaml b/hasura/hasura-migrations/migrations/1591693227470_alter_table_public_posts_drop_column_poll_block_number_end/up.yaml new file mode 100644 index 000000000..3676a592d --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591693227470_alter_table_public_posts_drop_column_poll_block_number_end/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" DROP COLUMN "poll_block_number_end" CASCADE; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591694916750_drop_table_public_post_votes/down.yaml b/hasura/hasura-migrations/migrations/1591694916750_drop_table_public_post_votes/down.yaml new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591694916750_drop_table_public_post_votes/down.yaml @@ -0,0 +1 @@ +[] diff --git a/hasura/hasura-migrations/migrations/1591694916750_drop_table_public_post_votes/up.yaml b/hasura/hasura-migrations/migrations/1591694916750_drop_table_public_post_votes/up.yaml new file mode 100644 index 000000000..6aebbbd4a --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591694916750_drop_table_public_post_votes/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: DROP TABLE "public"."post_votes"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591710822941_alter_table_public_poll_add_column_post_id/down.yaml b/hasura/hasura-migrations/migrations/1591710822941_alter_table_public_poll_add_column_post_id/down.yaml new file mode 100644 index 000000000..7fb917778 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591710822941_alter_table_public_poll_add_column_post_id/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" DROP COLUMN "post_id"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591710822941_alter_table_public_poll_add_column_post_id/up.yaml b/hasura/hasura-migrations/migrations/1591710822941_alter_table_public_poll_add_column_post_id/up.yaml new file mode 100644 index 000000000..d733493b7 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591710822941_alter_table_public_poll_add_column_post_id/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" ADD COLUMN "post_id" integer NOT NULL; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591710846626_set_fk_public_poll_post_id/down.yaml b/hasura/hasura-migrations/migrations/1591710846626_set_fk_public_poll_post_id/down.yaml new file mode 100644 index 000000000..9f6a66cb0 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591710846626_set_fk_public_poll_post_id/down.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: alter table "public"."poll" drop constraint "poll_post_id_fkey"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591710846626_set_fk_public_poll_post_id/up.yaml b/hasura/hasura-migrations/migrations/1591710846626_set_fk_public_poll_post_id/up.yaml new file mode 100644 index 000000000..d62f0157a --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591710846626_set_fk_public_poll_post_id/up.yaml @@ -0,0 +1,10 @@ +- args: + cascade: false + read_only: false + sql: |- + alter table "public"."poll" + add constraint "poll_post_id_fkey" + foreign key ("post_id") + references "public"."posts" + ("id") on update restrict on delete restrict; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591710865995_add_relationship__table_public_poll/down.yaml b/hasura/hasura-migrations/migrations/1591710865995_add_relationship__table_public_poll/down.yaml new file mode 100644 index 000000000..32f7032cd --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591710865995_add_relationship__table_public_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: post + table: + name: poll + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591710865995_add_relationship__table_public_poll/up.yaml b/hasura/hasura-migrations/migrations/1591710865995_add_relationship__table_public_poll/up.yaml new file mode 100644 index 000000000..e6d927b7b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591710865995_add_relationship__table_public_poll/up.yaml @@ -0,0 +1,8 @@ +- args: + name: post + table: + name: poll + schema: public + using: + foreign_key_constraint_on: post_id + type: create_object_relationship diff --git a/hasura/hasura-migrations/migrations/1591710875868_drop_relationship_poll_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591710875868_drop_relationship_poll_public_table_posts/down.yaml new file mode 100644 index 000000000..5a55bfbe1 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591710875868_drop_relationship_poll_public_table_posts/down.yaml @@ -0,0 +1,8 @@ +- args: + name: poll + table: + name: posts + schema: public + using: + foreign_key_constraint_on: poll_id + type: create_object_relationship diff --git a/hasura/hasura-migrations/migrations/1591710875868_drop_relationship_poll_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591710875868_drop_relationship_poll_public_table_posts/up.yaml new file mode 100644 index 000000000..46e357054 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591710875868_drop_relationship_poll_public_table_posts/up.yaml @@ -0,0 +1,6 @@ +- args: + relationship: poll + table: + name: posts + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591711198482_add_relationship__table_public_posts/down.yaml b/hasura/hasura-migrations/migrations/1591711198482_add_relationship__table_public_posts/down.yaml new file mode 100644 index 000000000..46e357054 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711198482_add_relationship__table_public_posts/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: poll + table: + name: posts + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591711198482_add_relationship__table_public_posts/up.yaml b/hasura/hasura-migrations/migrations/1591711198482_add_relationship__table_public_posts/up.yaml new file mode 100644 index 000000000..5a55bfbe1 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711198482_add_relationship__table_public_posts/up.yaml @@ -0,0 +1,8 @@ +- args: + name: poll + table: + name: posts + schema: public + using: + foreign_key_constraint_on: poll_id + type: create_object_relationship diff --git a/hasura/hasura-migrations/migrations/1591711295651_delete_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711295651_delete_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..2f1b84915 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711295651_delete_permission_user_public_table_poll/down.yaml @@ -0,0 +1,15 @@ +- args: + permission: + backend_only: false + check: + posts: + author_id: + _eq: X-Hasura-User-Id + columns: + - block_end + set: {} + role: user + table: + name: poll + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591711295651_delete_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711295651_delete_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..8074a214f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711295651_delete_permission_user_public_table_poll/up.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591711298802_delete_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711298802_delete_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..2de3dfa65 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711298802_delete_permission_user_public_table_poll/down.yaml @@ -0,0 +1,15 @@ +- args: + permission: + allow_aggregations: true + columns: + - block_end + - id + - created_at + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591711298802_delete_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711298802_delete_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..92aad81d2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711298802_delete_permission_user_public_table_poll/up.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1591711301778_delete_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711301778_delete_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..55807f8ea --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711301778_delete_permission_user_public_table_poll/down.yaml @@ -0,0 +1,18 @@ +- args: + permission: + check: + posts: + author_id: + _eq: X-Hasura-User-Id + columns: + - block_end + filter: + posts: + author_id: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: poll + schema: public + type: create_update_permission diff --git a/hasura/hasura-migrations/migrations/1591711301778_delete_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711301778_delete_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..1e9d1b147 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711301778_delete_permission_user_public_table_poll/up.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_update_permission diff --git a/hasura/hasura-migrations/migrations/1591711304546_delete_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711304546_delete_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..46359ec90 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711304546_delete_permission_user_public_table_poll/down.yaml @@ -0,0 +1,11 @@ +- args: + permission: + filter: + posts: + author_id: + _eq: X-Hasura-User-Id + role: user + table: + name: poll + schema: public + type: create_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591711304546_delete_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711304546_delete_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..aff1db422 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711304546_delete_permission_user_public_table_poll/up.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591711349916_drop_relationship_posts_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711349916_drop_relationship_posts_public_table_poll/down.yaml new file mode 100644 index 000000000..1f95f4c8d --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711349916_drop_relationship_posts_public_table_poll/down.yaml @@ -0,0 +1,12 @@ +- args: + name: posts + table: + name: poll + schema: public + using: + foreign_key_constraint_on: + column: poll_id + table: + name: posts + schema: public + type: create_array_relationship diff --git a/hasura/hasura-migrations/migrations/1591711349916_drop_relationship_posts_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711349916_drop_relationship_posts_public_table_poll/up.yaml new file mode 100644 index 000000000..61d1271e2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711349916_drop_relationship_posts_public_table_poll/up.yaml @@ -0,0 +1,6 @@ +- args: + relationship: posts + table: + name: poll + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591711415750_update_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711415750_update_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..8074a214f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711415750_update_permission_user_public_table_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591711415750_update_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711415750_update_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..e20852c4b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711415750_update_permission_user_public_table_poll/up.yaml @@ -0,0 +1,17 @@ +- args: + permission: + allow_upsert: true + backend_only: false + check: + post: + author_id: + _eq: X-Hasura-User-Id + columns: + - block_end + - post_id + set: {} + role: user + table: + name: poll + schema: public + type: create_insert_permission diff --git a/hasura/hasura-migrations/migrations/1591711424931_update_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711424931_update_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..92aad81d2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711424931_update_permission_user_public_table_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_select_permission diff --git a/hasura/hasura-migrations/migrations/1591711424931_update_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711424931_update_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..548343558 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711424931_update_permission_user_public_table_poll/up.yaml @@ -0,0 +1,18 @@ +- args: + permission: + allow_aggregations: true + backend_only: false + columns: + - block_end + - id + - post_id + - created_at + - updated_at + computed_fields: [] + filter: {} + limit: null + role: user + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591711440804_update_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711440804_update_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..1e9d1b147 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711440804_update_permission_user_public_table_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_update_permission diff --git a/hasura/hasura-migrations/migrations/1591711440804_update_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711440804_update_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..9409dfea4 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711440804_update_permission_user_public_table_poll/up.yaml @@ -0,0 +1,16 @@ +- args: + permission: + backend_only: false + columns: + - block_end + - post_id + filter: + post: + author_id: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: poll + schema: public + type: create_update_permission diff --git a/hasura/hasura-migrations/migrations/1591711449429_update_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591711449429_update_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..aff1db422 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711449429_update_permission_user_public_table_poll/down.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591711449429_update_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591711449429_update_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..95985be0a --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711449429_update_permission_user_public_table_poll/up.yaml @@ -0,0 +1,12 @@ +- args: + permission: + backend_only: false + filter: + post: + author_id: + _eq: X-Hasura-User-Id + role: user + table: + name: poll + schema: public + type: create_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591711486018_drop_relationship_poll_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591711486018_drop_relationship_poll_public_table_posts/down.yaml new file mode 100644 index 000000000..5a55bfbe1 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711486018_drop_relationship_poll_public_table_posts/down.yaml @@ -0,0 +1,8 @@ +- args: + name: poll + table: + name: posts + schema: public + using: + foreign_key_constraint_on: poll_id + type: create_object_relationship diff --git a/hasura/hasura-migrations/migrations/1591711486018_drop_relationship_poll_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591711486018_drop_relationship_poll_public_table_posts/up.yaml new file mode 100644 index 000000000..46e357054 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711486018_drop_relationship_poll_public_table_posts/up.yaml @@ -0,0 +1,6 @@ +- args: + relationship: poll + table: + name: posts + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591711496030_alter_table_public_posts_drop_column_poll_id/down.yaml b/hasura/hasura-migrations/migrations/1591711496030_alter_table_public_posts_drop_column_poll_id/down.yaml new file mode 100644 index 000000000..32b8dd528 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711496030_alter_table_public_posts_drop_column_poll_id/down.yaml @@ -0,0 +1,16 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ADD COLUMN "poll_id" int4; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ALTER COLUMN "poll_id" DROP NOT NULL; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" ADD CONSTRAINT posts_poll_id_fkey FOREIGN KEY + (poll_id) REFERENCES "public"."poll" (id) ON DELETE restrict ON UPDATE restrict; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591711496030_alter_table_public_posts_drop_column_poll_id/up.yaml b/hasura/hasura-migrations/migrations/1591711496030_alter_table_public_posts_drop_column_poll_id/up.yaml new file mode 100644 index 000000000..151405828 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591711496030_alter_table_public_posts_drop_column_poll_id/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."posts" DROP COLUMN "poll_id" CASCADE; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591714881453_update_permission_anonymous_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591714881453_update_permission_anonymous_public_table_poll/down.yaml new file mode 100644 index 000000000..e65d46ee9 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591714881453_update_permission_anonymous_public_table_poll/down.yaml @@ -0,0 +1,21 @@ +- args: + role: anonymous + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - id + - block_end + - created_at + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591714881453_update_permission_anonymous_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591714881453_update_permission_anonymous_public_table_poll/up.yaml new file mode 100644 index 000000000..14c85f27b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591714881453_update_permission_anonymous_public_table_poll/up.yaml @@ -0,0 +1,22 @@ +- args: + role: anonymous + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - id + - block_end + - created_at + - updated_at + - post_id + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll + schema: public + type: create_select_permission From 063bc5fcf325a3daeca6dca59876d542de7a3d06 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 10 Jun 2020 15:48:45 +0530 Subject: [PATCH 57/62] timestamps and permissions --- .../down.yaml | 21 +++++++++++++++++ .../up.yaml | 20 ++++++++++++++++ .../down.yaml | 11 +++++++++ .../up.yaml | 6 +++++ .../down.yaml | 22 ++++++++++++++++++ .../up.yaml | 21 +++++++++++++++++ .../down.yaml | 22 ++++++++++++++++++ .../up.yaml | 21 +++++++++++++++++ .../down.yaml | 15 ++++++++++++ .../up.yaml | 5 ++++ .../down.yaml | 7 ++++++ .../up.yaml | 11 +++++++++ .../down.yaml | 21 +++++++++++++++++ .../up.yaml | 22 ++++++++++++++++++ .../down.yaml | 21 +++++++++++++++++ .../up.yaml | 22 ++++++++++++++++++ .../down.yaml | 23 +++++++++++++++++++ .../up.yaml | 22 ++++++++++++++++++ .../down.yaml | 23 +++++++++++++++++++ .../up.yaml | 22 ++++++++++++++++++ .../down.yaml | 15 ++++++++++++ .../up.yaml | 5 ++++ .../down.yaml | 7 ++++++ .../up.yaml | 12 ++++++++++ 24 files changed, 397 insertions(+) create mode 100644 hasura/hasura-migrations/migrations/1591783921171_update_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591783921171_update_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591783928515_delete_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591783928515_delete_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784156111_update_permission_anonymous_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784156111_update_permission_anonymous_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784203328_update_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784203328_update_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784218585_alter_table_public_poll_drop_column_updated_at/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784218585_alter_table_public_poll_drop_column_updated_at/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784231257_alter_table_public_poll_add_column_updated_at/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784231257_alter_table_public_poll_add_column_updated_at/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784238235_update_permission_anonymous_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784238235_update_permission_anonymous_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784245879_update_permission_user_public_table_poll/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784245879_update_permission_user_public_table_poll/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784265460_update_permission_anonymous_public_table_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784265460_update_permission_anonymous_public_table_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784271440_update_permission_user_public_table_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784271440_update_permission_user_public_table_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784279283_alter_table_public_poll_votes_drop_column_updated_at/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784279283_alter_table_public_poll_votes_drop_column_updated_at/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784288149_alter_table_public_poll_votes_add_column_updated_at/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784288149_alter_table_public_poll_votes_add_column_updated_at/up.yaml diff --git a/hasura/hasura-migrations/migrations/1591783921171_update_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591783921171_update_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..f9316170c --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591783921171_update_permission_user_public_table_poll/down.yaml @@ -0,0 +1,21 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_update_permission +- args: + permission: + columns: + - block_end + - post_id + filter: + post: + author_id: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: poll + schema: public + type: create_update_permission diff --git a/hasura/hasura-migrations/migrations/1591783921171_update_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591783921171_update_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..24e3ed263 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591783921171_update_permission_user_public_table_poll/up.yaml @@ -0,0 +1,20 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_update_permission +- args: + permission: + columns: + - block_end + filter: + post: + author_id: + _eq: X-Hasura-User-Id + set: {} + role: user + table: + name: poll + schema: public + type: create_update_permission diff --git a/hasura/hasura-migrations/migrations/1591783928515_delete_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591783928515_delete_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..39594d5bf --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591783928515_delete_permission_user_public_table_poll/down.yaml @@ -0,0 +1,11 @@ +- args: + permission: + filter: + post: + author_id: + _eq: X-Hasura-User-Id + role: user + table: + name: poll + schema: public + type: create_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591783928515_delete_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591783928515_delete_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..aff1db422 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591783928515_delete_permission_user_public_table_poll/up.yaml @@ -0,0 +1,6 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_delete_permission diff --git a/hasura/hasura-migrations/migrations/1591784156111_update_permission_anonymous_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591784156111_update_permission_anonymous_public_table_poll/down.yaml new file mode 100644 index 000000000..14c85f27b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784156111_update_permission_anonymous_public_table_poll/down.yaml @@ -0,0 +1,22 @@ +- args: + role: anonymous + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - id + - block_end + - created_at + - updated_at + - post_id + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784156111_update_permission_anonymous_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591784156111_update_permission_anonymous_public_table_poll/up.yaml new file mode 100644 index 000000000..213d0e746 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784156111_update_permission_anonymous_public_table_poll/up.yaml @@ -0,0 +1,21 @@ +- args: + role: anonymous + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - block_end + - created_at + - id + - post_id + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784203328_update_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591784203328_update_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..4d64a5e50 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784203328_update_permission_user_public_table_poll/down.yaml @@ -0,0 +1,22 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - block_end + - id + - post_id + - created_at + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784203328_update_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591784203328_update_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..4ef52a7d2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784203328_update_permission_user_public_table_poll/up.yaml @@ -0,0 +1,21 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - block_end + - created_at + - id + - post_id + computed_fields: [] + filter: {} + role: user + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784218585_alter_table_public_poll_drop_column_updated_at/down.yaml b/hasura/hasura-migrations/migrations/1591784218585_alter_table_public_poll_drop_column_updated_at/down.yaml new file mode 100644 index 000000000..cad1e1d46 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784218585_alter_table_public_poll_drop_column_updated_at/down.yaml @@ -0,0 +1,15 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" ADD COLUMN "updated_at" timestamp; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" ALTER COLUMN "updated_at" DROP NOT NULL; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" ALTER COLUMN "updated_at" SET DEFAULT now(); + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591784218585_alter_table_public_poll_drop_column_updated_at/up.yaml b/hasura/hasura-migrations/migrations/1591784218585_alter_table_public_poll_drop_column_updated_at/up.yaml new file mode 100644 index 000000000..406634042 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784218585_alter_table_public_poll_drop_column_updated_at/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll" DROP COLUMN "updated_at" CASCADE; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591784231257_alter_table_public_poll_add_column_updated_at/down.yaml b/hasura/hasura-migrations/migrations/1591784231257_alter_table_public_poll_add_column_updated_at/down.yaml new file mode 100644 index 000000000..9a769c10c --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784231257_alter_table_public_poll_add_column_updated_at/down.yaml @@ -0,0 +1,7 @@ +- args: + cascade: false + read_only: false + sql: |- + DROP TRIGGER IF EXISTS "set_public_poll_updated_at" ON "public"."poll"; + ALTER TABLE "public"."poll" DROP COLUMN "updated_at"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591784231257_alter_table_public_poll_add_column_updated_at/up.yaml b/hasura/hasura-migrations/migrations/1591784231257_alter_table_public_poll_add_column_updated_at/up.yaml new file mode 100644 index 000000000..8ed9d5c01 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784231257_alter_table_public_poll_add_column_updated_at/up.yaml @@ -0,0 +1,11 @@ +- args: + cascade: false + read_only: false + sql: "ALTER TABLE \"public\".\"poll\" ADD COLUMN \"updated_at\" timestamptz NULL + DEFAULT now();\n\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS + TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\" + = NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_poll_updated_at\"\nBEFORE + UPDATE ON \"public\".\"poll\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT + ON TRIGGER \"set_public_poll_updated_at\" ON \"public\".\"poll\" \nIS 'trigger + to set value of column \"updated_at\" to current timestamp on row update';" + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591784238235_update_permission_anonymous_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591784238235_update_permission_anonymous_public_table_poll/down.yaml new file mode 100644 index 000000000..213d0e746 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784238235_update_permission_anonymous_public_table_poll/down.yaml @@ -0,0 +1,21 @@ +- args: + role: anonymous + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - block_end + - created_at + - id + - post_id + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784238235_update_permission_anonymous_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591784238235_update_permission_anonymous_public_table_poll/up.yaml new file mode 100644 index 000000000..bec513f4c --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784238235_update_permission_anonymous_public_table_poll/up.yaml @@ -0,0 +1,22 @@ +- args: + role: anonymous + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - id + - block_end + - created_at + - post_id + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784245879_update_permission_user_public_table_poll/down.yaml b/hasura/hasura-migrations/migrations/1591784245879_update_permission_user_public_table_poll/down.yaml new file mode 100644 index 000000000..4ef52a7d2 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784245879_update_permission_user_public_table_poll/down.yaml @@ -0,0 +1,21 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - block_end + - created_at + - id + - post_id + computed_fields: [] + filter: {} + role: user + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784245879_update_permission_user_public_table_poll/up.yaml b/hasura/hasura-migrations/migrations/1591784245879_update_permission_user_public_table_poll/up.yaml new file mode 100644 index 000000000..4d64a5e50 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784245879_update_permission_user_public_table_poll/up.yaml @@ -0,0 +1,22 @@ +- args: + role: user + table: + name: poll + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - block_end + - id + - post_id + - created_at + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: poll + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784265460_update_permission_anonymous_public_table_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591784265460_update_permission_anonymous_public_table_poll_votes/down.yaml new file mode 100644 index 000000000..9c476ac53 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784265460_update_permission_anonymous_public_table_poll_votes/down.yaml @@ -0,0 +1,23 @@ +- args: + role: anonymous + table: + name: poll_votes + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - id + - poll_id + - user_id + - vote + - created_at + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784265460_update_permission_anonymous_public_table_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591784265460_update_permission_anonymous_public_table_poll_votes/up.yaml new file mode 100644 index 000000000..b4229b643 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784265460_update_permission_anonymous_public_table_poll_votes/up.yaml @@ -0,0 +1,22 @@ +- args: + role: anonymous + table: + name: poll_votes + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - created_at + - id + - poll_id + - user_id + - vote + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784271440_update_permission_user_public_table_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591784271440_update_permission_user_public_table_poll_votes/down.yaml new file mode 100644 index 000000000..fd4ff6ba1 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784271440_update_permission_user_public_table_poll_votes/down.yaml @@ -0,0 +1,23 @@ +- args: + role: user + table: + name: poll_votes + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - vote + - id + - poll_id + - user_id + - created_at + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784271440_update_permission_user_public_table_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591784271440_update_permission_user_public_table_poll_votes/up.yaml new file mode 100644 index 000000000..c8aed703f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784271440_update_permission_user_public_table_poll_votes/up.yaml @@ -0,0 +1,22 @@ +- args: + role: user + table: + name: poll_votes + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - created_at + - id + - poll_id + - user_id + - vote + computed_fields: [] + filter: {} + role: user + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591784279283_alter_table_public_poll_votes_drop_column_updated_at/down.yaml b/hasura/hasura-migrations/migrations/1591784279283_alter_table_public_poll_votes_drop_column_updated_at/down.yaml new file mode 100644 index 000000000..857fb2188 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784279283_alter_table_public_poll_votes_drop_column_updated_at/down.yaml @@ -0,0 +1,15 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll_votes" ADD COLUMN "updated_at" timestamp; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll_votes" ALTER COLUMN "updated_at" DROP NOT NULL; + type: run_sql +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll_votes" ALTER COLUMN "updated_at" SET DEFAULT now(); + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591784279283_alter_table_public_poll_votes_drop_column_updated_at/up.yaml b/hasura/hasura-migrations/migrations/1591784279283_alter_table_public_poll_votes_drop_column_updated_at/up.yaml new file mode 100644 index 000000000..57175da15 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784279283_alter_table_public_poll_votes_drop_column_updated_at/up.yaml @@ -0,0 +1,5 @@ +- args: + cascade: false + read_only: false + sql: ALTER TABLE "public"."poll_votes" DROP COLUMN "updated_at" CASCADE; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591784288149_alter_table_public_poll_votes_add_column_updated_at/down.yaml b/hasura/hasura-migrations/migrations/1591784288149_alter_table_public_poll_votes_add_column_updated_at/down.yaml new file mode 100644 index 000000000..ec74f3d1e --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784288149_alter_table_public_poll_votes_add_column_updated_at/down.yaml @@ -0,0 +1,7 @@ +- args: + cascade: false + read_only: false + sql: |- + DROP TRIGGER IF EXISTS "set_public_poll_votes_updated_at" ON "public"."poll_votes"; + ALTER TABLE "public"."poll_votes" DROP COLUMN "updated_at"; + type: run_sql diff --git a/hasura/hasura-migrations/migrations/1591784288149_alter_table_public_poll_votes_add_column_updated_at/up.yaml b/hasura/hasura-migrations/migrations/1591784288149_alter_table_public_poll_votes_add_column_updated_at/up.yaml new file mode 100644 index 000000000..326ff8d0b --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784288149_alter_table_public_poll_votes_add_column_updated_at/up.yaml @@ -0,0 +1,12 @@ +- args: + cascade: false + read_only: false + sql: "ALTER TABLE \"public\".\"poll_votes\" ADD COLUMN \"updated_at\" timestamptz + NULL DEFAULT now();\n\nCREATE OR REPLACE FUNCTION \"public\".\"set_current_timestamp_updated_at\"()\nRETURNS + TRIGGER AS $$\nDECLARE\n _new record;\nBEGIN\n _new := NEW;\n _new.\"updated_at\" + = NOW();\n RETURN _new;\nEND;\n$$ LANGUAGE plpgsql;\nCREATE TRIGGER \"set_public_poll_votes_updated_at\"\nBEFORE + UPDATE ON \"public\".\"poll_votes\"\nFOR EACH ROW\nEXECUTE PROCEDURE \"public\".\"set_current_timestamp_updated_at\"();\nCOMMENT + ON TRIGGER \"set_public_poll_votes_updated_at\" ON \"public\".\"poll_votes\" + \nIS 'trigger to set value of column \"updated_at\" to current timestamp on + row update';" + type: run_sql From 310262387a78f82c5640d1e2b0b4a81a9f9f9fcd Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 10 Jun 2020 15:50:57 +0530 Subject: [PATCH 58/62] added relationship --- .../down.yaml | 8 ++++++++ .../up.yaml | 6 ++++++ .../down.yaml | 6 ++++++ .../up.yaml | 12 ++++++++++++ 4 files changed, 32 insertions(+) create mode 100644 hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784367682_add_relationship__table_public_posts/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591784367682_add_relationship__table_public_posts/up.yaml diff --git a/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/down.yaml new file mode 100644 index 000000000..3a3a29c8e --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/down.yaml @@ -0,0 +1,8 @@ +- args: + name: poll + table: + name: posts + schema: public + using: + foreign_key_constraint_on: id + type: create_object_relationship diff --git a/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/up.yaml new file mode 100644 index 000000000..46e357054 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/up.yaml @@ -0,0 +1,6 @@ +- args: + relationship: poll + table: + name: posts + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591784367682_add_relationship__table_public_posts/down.yaml b/hasura/hasura-migrations/migrations/1591784367682_add_relationship__table_public_posts/down.yaml new file mode 100644 index 000000000..c08e590a7 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784367682_add_relationship__table_public_posts/down.yaml @@ -0,0 +1,6 @@ +- args: + relationship: polls + table: + name: posts + schema: public + type: drop_relationship diff --git a/hasura/hasura-migrations/migrations/1591784367682_add_relationship__table_public_posts/up.yaml b/hasura/hasura-migrations/migrations/1591784367682_add_relationship__table_public_posts/up.yaml new file mode 100644 index 000000000..20ea07cd6 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591784367682_add_relationship__table_public_posts/up.yaml @@ -0,0 +1,12 @@ +- args: + name: polls + table: + name: posts + schema: public + using: + foreign_key_constraint_on: + column: post_id + table: + name: poll + schema: public + type: create_array_relationship From d71907babf7f777dd09661f71185c5084d4db4ed Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 10 Jun 2020 16:16:00 +0530 Subject: [PATCH 59/62] added @ardatan/graphql-tools --- front-end/package.json | 1 + front-end/yarn.lock | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/front-end/package.json b/front-end/package.json index 2c3a57f2e..8b5139403 100644 --- a/front-end/package.json +++ b/front-end/package.json @@ -18,6 +18,7 @@ "Thibaut Sardan" ], "dependencies": { + "@ardatan/graphql-tools": "^4.1.0", "@polkadot/api": "^1.18.1", "@polkadot/extension-dapp": "^0.30.1", "@polkadot/extension-inject": "^0.30.1", diff --git a/front-end/yarn.lock b/front-end/yarn.lock index ce748e3ad..6de2a0e19 100644 --- a/front-end/yarn.lock +++ b/front-end/yarn.lock @@ -66,6 +66,17 @@ "@apollo/react-hooks" "^3.1.5" tslib "^1.10.0" +"@ardatan/graphql-tools@^4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@ardatan/graphql-tools/-/graphql-tools-4.1.0.tgz#183508ef4e3d4966f763cb1634a81be1c1255f8d" + integrity sha512-0b+KH5RZN9vCMpEjxrwFwZ7v3K6QDjs1EH+R6eRrgKMR2X274JWqYraHKLWE1uJ8iwrkRaOYfCV12jLVuvWS+A== + dependencies: + apollo-link "^1.2.3" + apollo-utilities "^1.0.1" + deprecated-decorator "^0.1.6" + iterall "^1.1.3" + uuid "^3.1.0" + "@babel/code-frame@7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" From 7ee6a9907508600aa857518b0d5b87948ca14509 Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 10 Jun 2020 16:36:03 +0530 Subject: [PATCH 60/62] added permission --- .../down.yaml | 22 ++++++++++++++++++ .../up.yaml | 23 +++++++++++++++++++ .../down.yaml | 22 ++++++++++++++++++ .../up.yaml | 23 +++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 hasura/hasura-migrations/migrations/1591787142733_update_permission_anonymous_public_table_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591787142733_update_permission_anonymous_public_table_poll_votes/up.yaml create mode 100644 hasura/hasura-migrations/migrations/1591787147722_update_permission_user_public_table_poll_votes/down.yaml create mode 100644 hasura/hasura-migrations/migrations/1591787147722_update_permission_user_public_table_poll_votes/up.yaml diff --git a/hasura/hasura-migrations/migrations/1591787142733_update_permission_anonymous_public_table_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591787142733_update_permission_anonymous_public_table_poll_votes/down.yaml new file mode 100644 index 000000000..b4229b643 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591787142733_update_permission_anonymous_public_table_poll_votes/down.yaml @@ -0,0 +1,22 @@ +- args: + role: anonymous + table: + name: poll_votes + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - created_at + - id + - poll_id + - user_id + - vote + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591787142733_update_permission_anonymous_public_table_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591787142733_update_permission_anonymous_public_table_poll_votes/up.yaml new file mode 100644 index 000000000..9c476ac53 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591787142733_update_permission_anonymous_public_table_poll_votes/up.yaml @@ -0,0 +1,23 @@ +- args: + role: anonymous + table: + name: poll_votes + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - id + - poll_id + - user_id + - vote + - created_at + - updated_at + computed_fields: [] + filter: {} + role: anonymous + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591787147722_update_permission_user_public_table_poll_votes/down.yaml b/hasura/hasura-migrations/migrations/1591787147722_update_permission_user_public_table_poll_votes/down.yaml new file mode 100644 index 000000000..c8aed703f --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591787147722_update_permission_user_public_table_poll_votes/down.yaml @@ -0,0 +1,22 @@ +- args: + role: user + table: + name: poll_votes + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - created_at + - id + - poll_id + - user_id + - vote + computed_fields: [] + filter: {} + role: user + table: + name: poll_votes + schema: public + type: create_select_permission diff --git a/hasura/hasura-migrations/migrations/1591787147722_update_permission_user_public_table_poll_votes/up.yaml b/hasura/hasura-migrations/migrations/1591787147722_update_permission_user_public_table_poll_votes/up.yaml new file mode 100644 index 000000000..fd4ff6ba1 --- /dev/null +++ b/hasura/hasura-migrations/migrations/1591787147722_update_permission_user_public_table_poll_votes/up.yaml @@ -0,0 +1,23 @@ +- args: + role: user + table: + name: poll_votes + schema: public + type: drop_select_permission +- args: + permission: + allow_aggregations: true + columns: + - vote + - id + - poll_id + - user_id + - created_at + - updated_at + computed_fields: [] + filter: {} + role: user + table: + name: poll_votes + schema: public + type: create_select_permission From b71cfacc3af01d9e36955b4bf065648f39fca5df Mon Sep 17 00:00:00 2001 From: Nikhil Ranjan Date: Wed, 10 Jun 2020 17:27:28 +0530 Subject: [PATCH 61/62] removed unused relationship --- .../down.yaml | 8 -------- .../up.yaml | 6 ------ 2 files changed, 14 deletions(-) delete mode 100644 hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/down.yaml delete mode 100644 hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/up.yaml diff --git a/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/down.yaml b/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/down.yaml deleted file mode 100644 index 3a3a29c8e..000000000 --- a/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/down.yaml +++ /dev/null @@ -1,8 +0,0 @@ -- args: - name: poll - table: - name: posts - schema: public - using: - foreign_key_constraint_on: id - type: create_object_relationship diff --git a/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/up.yaml b/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/up.yaml deleted file mode 100644 index 46e357054..000000000 --- a/hasura/hasura-migrations/migrations/1591784363689_drop_relationship_poll_public_table_posts/up.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- args: - relationship: poll - table: - name: posts - schema: public - type: drop_relationship From 0d8240a2148136a7b8500faacfa1ef7aa914be78 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Date: Wed, 10 Jun 2020 16:27:51 +0200 Subject: [PATCH 62/62] prevent poll vote when finished (#878) --- front-end/src/components/BlockCountdown.tsx | 23 +- .../components/Post/Poll/CouncilSignals.tsx | 6 +- .../components/Post/Poll/GeneralSignals.tsx | 13 +- front-end/src/components/Post/Poll/Poll.tsx | 1 + front-end/src/generated/graphql.tsx | 19829 ++++++++-------- front-end/src/hooks/useCurrentBlock.ts | 32 + front-end/src/screens/CreatePost/index.tsx | 11 +- front-end/src/screens/CreatePost/query.ts | 8 - 8 files changed, 9688 insertions(+), 10235 deletions(-) create mode 100644 front-end/src/hooks/useCurrentBlock.ts diff --git a/front-end/src/components/BlockCountdown.tsx b/front-end/src/components/BlockCountdown.tsx index 69f540e38..7817d4c2b 100644 --- a/front-end/src/components/BlockCountdown.tsx +++ b/front-end/src/components/BlockCountdown.tsx @@ -2,12 +2,12 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { ApiPromiseContext } from '@substrate/context'; import styled from '@xstyled/styled-components'; import BN from 'bn.js'; -import React, { useContext, useEffect, useState } from 'react'; +import React from 'react'; import { Popup } from 'semantic-ui-react'; import { useBlockTime } from 'src/hooks'; +import useCurrentBlock from 'src/hooks/useCurrentBlock'; import blockToTime from 'src/util/blockToTime'; interface Props { @@ -22,27 +22,10 @@ const DivContent = styled.div` const BlockCountdown = ({ className, endBlock }:Props ) => { const ZERO = new BN(0); - const { api, isApiReady } = useContext(ApiPromiseContext); - const [currentBlock, setCurrentBlock] = useState(ZERO); + const currentBlock = useCurrentBlock() || ZERO; const blocksRemaining = endBlock - currentBlock.toNumber(); const { blocktime } = useBlockTime(); - useEffect(() => { - if (!isApiReady) { - return; - } - - let unsubscribe: () => void; - - api.derive.chain.bestNumber((number) => { - setCurrentBlock(number); - }) - .then(unsub => {unsubscribe = unsub;}) - .catch(e => console.error(e)); - - return () => unsubscribe && unsubscribe(); - }, [api, isApiReady]); - return ( { const [nays, setNays] = useState(0); const [memberSet, setMemberSet] = useState>(new Set()); const [councilVotes, setCouncilVotes] = useState([]); - const currentBlockNumberResult = useGetCurrentBlockNumberQuery(); - const currentBlockNumber = currentBlockNumberResult?.data?.blockNumbers?.[0]?.number || endBlock; + const currentBlockNumber = useCurrentBlock()?.toNumber() || endBlock; const councilAtPollEndBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: endBlock } }); const councilAtCurrentBlockNumber = useCouncilAtBlockNumberQuery({ variables: { blockNumber: currentBlockNumber } }); diff --git a/front-end/src/components/Post/Poll/GeneralSignals.tsx b/front-end/src/components/Post/Poll/GeneralSignals.tsx index 62464478b..92e9639ac 100644 --- a/front-end/src/components/Post/Poll/GeneralSignals.tsx +++ b/front-end/src/components/Post/Poll/GeneralSignals.tsx @@ -5,6 +5,7 @@ import styled from '@xstyled/styled-components'; import { ApolloQueryResult } from 'apollo-client'; import React, { useCallback, useContext, useState } from 'react'; +import useCurrentBlock from 'src/hooks/useCurrentBlock'; import ButtonLink from 'src/ui-components/ButtonLink'; import HelperTooltip from 'src/ui-components/HelperTooltip'; @@ -20,17 +21,20 @@ import GeneralChainSignalBar from '../../../ui-components/GeneralChainSignalBar' interface Props { ayes: number, className?: string, - ownVote?: Vote | null, + endBlock: number nays: number, + ownVote?: Vote | null, pollId: number refetch: (variables?: PollVotesQueryVariables | undefined) => Promise> } -const CouncilSignals = ({ className, ayes, ownVote, nays, pollId, refetch }: Props) => { +const CouncilSignals = ({ ayes, className, endBlock, nays, ownVote, pollId, refetch }: Props) => { const { id } = useContext(UserDetailsContext); const [error, setErr] = useState(null); const [addPollVoteMutation] = useAddPollVoteMutation(); const [deleteVoteMutation] = useDeleteVoteMutation(); + const currentBlockNumber = useCurrentBlock()?.toNumber() || 0; + const canVote = endBlock > currentBlockNumber; const cancelVote = useCallback(async () => { if (!id) { @@ -84,11 +88,12 @@ const CouncilSignals = ({ className, ayes, ownVote, nays, pollId, refetch }: Pro
castVote(Vote.AYE)} onClickNay={() => castVote(Vote.NAY)} /> - {ownVote && + {!canVote && Poll finished} + {ownVote && canVote && Cancel {ownVote.toLowerCase()} vote } diff --git a/front-end/src/components/Post/Poll/Poll.tsx b/front-end/src/components/Post/Poll/Poll.tsx index 663272ce9..ced678c53 100644 --- a/front-end/src/components/Post/Poll/Poll.tsx +++ b/front-end/src/components/Post/Poll/Poll.tsx @@ -42,6 +42,7 @@ const Poll = ({ pollId, endBlock }: Props) => { <> = T | null; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: string, - String: string, - Boolean: boolean, - Int: number, - Float: number, - DateTime: any, - timestamptz: any, - uuid: any, - timestamp: any, - bpchar: any, - Json: any, - Long: any, - Upload: any, + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + DateTime: any; + /** Raw JSON value */ + Json: any; + /** The `Upload` scalar type represents a file upload. */ + Upload: any; + bpchar: any; + timestamp: any; + timestamptz: any; + uuid: any; }; export type Address = { - __typename?: 'Address', - address?: Maybe, - name?: Maybe, - public_key?: Maybe, - source?: Maybe, + __typename?: 'Address'; + address?: Maybe; + name?: Maybe; + public_key?: Maybe; + source?: Maybe; }; export type AddressLinkType = { - __typename?: 'AddressLinkType', - address_id?: Maybe, - message?: Maybe, - sign_message?: Maybe, + __typename?: 'AddressLinkType'; + address_id?: Maybe; + message?: Maybe; + sign_message?: Maybe; }; export type AddressLoginType = { - __typename?: 'AddressLoginType', - message?: Maybe, - signMessage?: Maybe, + __typename?: 'AddressLoginType'; + message?: Maybe; + signMessage?: Maybe; }; export type AggregateBlockIndex = { - __typename?: 'AggregateBlockIndex', - count: Scalars['Int'], + __typename?: 'AggregateBlockIndex'; + count: Scalars['Int']; }; export type AggregateBlockNumber = { - __typename?: 'AggregateBlockNumber', - count: Scalars['Int'], + __typename?: 'AggregateBlockNumber'; + count: Scalars['Int']; }; export type AggregateCouncil = { - __typename?: 'AggregateCouncil', - count: Scalars['Int'], + __typename?: 'AggregateCouncil'; + count: Scalars['Int']; }; export type AggregateCouncilMember = { - __typename?: 'AggregateCouncilMember', - count: Scalars['Int'], + __typename?: 'AggregateCouncilMember'; + count: Scalars['Int']; }; export type AggregateEra = { - __typename?: 'AggregateEra', - count: Scalars['Int'], + __typename?: 'AggregateEra'; + count: Scalars['Int']; }; export type AggregateHeartBeat = { - __typename?: 'AggregateHeartBeat', - count: Scalars['Int'], + __typename?: 'AggregateHeartBeat'; + count: Scalars['Int']; }; export type AggregateMotion = { - __typename?: 'AggregateMotion', - count: Scalars['Int'], + __typename?: 'AggregateMotion'; + count: Scalars['Int']; }; export type AggregateMotionProposalArgument = { - __typename?: 'AggregateMotionProposalArgument', - count: Scalars['Int'], + __typename?: 'AggregateMotionProposalArgument'; + count: Scalars['Int']; }; export type AggregateMotionStatus = { - __typename?: 'AggregateMotionStatus', - count: Scalars['Int'], + __typename?: 'AggregateMotionStatus'; + count: Scalars['Int']; }; export type AggregateNomination = { - __typename?: 'AggregateNomination', - count: Scalars['Int'], + __typename?: 'AggregateNomination'; + count: Scalars['Int']; }; export type AggregateOfflineValidator = { - __typename?: 'AggregateOfflineValidator', - count: Scalars['Int'], + __typename?: 'AggregateOfflineValidator'; + count: Scalars['Int']; }; export type AggregatePreimage = { - __typename?: 'AggregatePreimage', - count: Scalars['Int'], + __typename?: 'AggregatePreimage'; + count: Scalars['Int']; }; export type AggregatePreimageArgument = { - __typename?: 'AggregatePreimageArgument', - count: Scalars['Int'], + __typename?: 'AggregatePreimageArgument'; + count: Scalars['Int']; }; export type AggregatePreimageStatus = { - __typename?: 'AggregatePreimageStatus', - count: Scalars['Int'], + __typename?: 'AggregatePreimageStatus'; + count: Scalars['Int']; }; export type AggregateProposal = { - __typename?: 'AggregateProposal', - count: Scalars['Int'], + __typename?: 'AggregateProposal'; + count: Scalars['Int']; }; export type AggregateProposalStatus = { - __typename?: 'AggregateProposalStatus', - count: Scalars['Int'], + __typename?: 'AggregateProposalStatus'; + count: Scalars['Int']; }; export type AggregateReferendum = { - __typename?: 'AggregateReferendum', - count: Scalars['Int'], + __typename?: 'AggregateReferendum'; + count: Scalars['Int']; }; export type AggregateReferendumStatus = { - __typename?: 'AggregateReferendumStatus', - count: Scalars['Int'], + __typename?: 'AggregateReferendumStatus'; + count: Scalars['Int']; }; export type AggregateReward = { - __typename?: 'AggregateReward', - count: Scalars['Int'], + __typename?: 'AggregateReward'; + count: Scalars['Int']; }; export type AggregateSession = { - __typename?: 'AggregateSession', - count: Scalars['Int'], + __typename?: 'AggregateSession'; + count: Scalars['Int']; }; export type AggregateSlashing = { - __typename?: 'AggregateSlashing', - count: Scalars['Int'], + __typename?: 'AggregateSlashing'; + count: Scalars['Int']; }; export type AggregateStake = { - __typename?: 'AggregateStake', - count: Scalars['Int'], + __typename?: 'AggregateStake'; + count: Scalars['Int']; }; export type AggregateTotalIssuance = { - __typename?: 'AggregateTotalIssuance', - count: Scalars['Int'], + __typename?: 'AggregateTotalIssuance'; + count: Scalars['Int']; }; export type AggregateTreasurySpendProposal = { - __typename?: 'AggregateTreasurySpendProposal', - count: Scalars['Int'], + __typename?: 'AggregateTreasurySpendProposal'; + count: Scalars['Int']; }; export type AggregateTreasuryStatus = { - __typename?: 'AggregateTreasuryStatus', - count: Scalars['Int'], + __typename?: 'AggregateTreasuryStatus'; + count: Scalars['Int']; }; export type AggregateValidator = { - __typename?: 'AggregateValidator', - count: Scalars['Int'], -}; - -export type BatchPayload = { - __typename?: 'BatchPayload', - count: Scalars['Long'], + __typename?: 'AggregateValidator'; + count: Scalars['Int']; }; export type BlockIndex = Node & { - __typename?: 'BlockIndex', - id: Scalars['ID'], - identifier: Scalars['String'], - index: Scalars['Int'], - startFrom: Scalars['Int'], + __typename?: 'BlockIndex'; + id: Scalars['ID']; + identifier: Scalars['String']; + index: Scalars['Int']; + startFrom: Scalars['Int']; }; +/** A connection to a list of items. */ export type BlockIndexConnection = { - __typename?: 'BlockIndexConnection', - aggregate: AggregateBlockIndex, - edges: Array>, - pageInfo: PageInfo, -}; - -export type BlockIndexCreateInput = { - id?: Maybe, - identifier: Scalars['String'], - index: Scalars['Int'], - startFrom: Scalars['Int'], + __typename?: 'BlockIndexConnection'; + aggregate: AggregateBlockIndex; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; +/** An edge in a connection. */ export type BlockIndexEdge = { - __typename?: 'BlockIndexEdge', - cursor: Scalars['String'], - node: BlockIndex, + __typename?: 'BlockIndexEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: BlockIndex; }; export enum BlockIndexOrderByInput { @@ -215,132 +210,163 @@ export enum BlockIndexOrderByInput { } export type BlockIndexPreviousValues = { - __typename?: 'BlockIndexPreviousValues', - id: Scalars['ID'], - identifier: Scalars['String'], - index: Scalars['Int'], - startFrom: Scalars['Int'], + __typename?: 'BlockIndexPreviousValues'; + id: Scalars['ID']; + identifier: Scalars['String']; + index: Scalars['Int']; + startFrom: Scalars['Int']; }; export type BlockIndexSubscriptionPayload = { - __typename?: 'BlockIndexSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, + __typename?: 'BlockIndexSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; export type BlockIndexSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type BlockIndexUpdateInput = { - identifier?: Maybe, - index?: Maybe, - startFrom?: Maybe, -}; - -export type BlockIndexUpdateManyMutationInput = { - identifier?: Maybe, - index?: Maybe, - startFrom?: Maybe, + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; export type BlockIndexWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - identifier?: Maybe, - identifier_contains?: Maybe, - identifier_ends_with?: Maybe, - identifier_gt?: Maybe, - identifier_gte?: Maybe, - identifier_in?: Maybe>, - identifier_lt?: Maybe, - identifier_lte?: Maybe, - identifier_not?: Maybe, - identifier_not_contains?: Maybe, - identifier_not_ends_with?: Maybe, - identifier_not_in?: Maybe>, - identifier_not_starts_with?: Maybe, - identifier_starts_with?: Maybe, - index?: Maybe, - index_gt?: Maybe, - index_gte?: Maybe, - index_in?: Maybe>, - index_lt?: Maybe, - index_lte?: Maybe, - index_not?: Maybe, - index_not_in?: Maybe>, - startFrom?: Maybe, - startFrom_gt?: Maybe, - startFrom_gte?: Maybe, - startFrom_in?: Maybe>, - startFrom_lt?: Maybe, - startFrom_lte?: Maybe, - startFrom_not?: Maybe, - startFrom_not_in?: Maybe>, + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + identifier?: Maybe; + /** All values containing the given string. */ + identifier_contains?: Maybe; + /** All values ending with the given string. */ + identifier_ends_with?: Maybe; + /** All values greater than the given value. */ + identifier_gt?: Maybe; + /** All values greater than or equal the given value. */ + identifier_gte?: Maybe; + /** All values that are contained in given list. */ + identifier_in?: Maybe>; + /** All values less than the given value. */ + identifier_lt?: Maybe; + /** All values less than or equal the given value. */ + identifier_lte?: Maybe; + /** All values that are not equal to given value. */ + identifier_not?: Maybe; + /** All values not containing the given string. */ + identifier_not_contains?: Maybe; + /** All values not ending with the given string. */ + identifier_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + identifier_not_in?: Maybe>; + /** All values not starting with the given string. */ + identifier_not_starts_with?: Maybe; + /** All values starting with the given string. */ + identifier_starts_with?: Maybe; + index?: Maybe; + /** All values greater than the given value. */ + index_gt?: Maybe; + /** All values greater than or equal the given value. */ + index_gte?: Maybe; + /** All values that are contained in given list. */ + index_in?: Maybe>; + /** All values less than the given value. */ + index_lt?: Maybe; + /** All values less than or equal the given value. */ + index_lte?: Maybe; + /** All values that are not equal to given value. */ + index_not?: Maybe; + /** All values that are not contained in given list. */ + index_not_in?: Maybe>; + startFrom?: Maybe; + /** All values greater than the given value. */ + startFrom_gt?: Maybe; + /** All values greater than or equal the given value. */ + startFrom_gte?: Maybe; + /** All values that are contained in given list. */ + startFrom_in?: Maybe>; + /** All values less than the given value. */ + startFrom_lt?: Maybe; + /** All values less than or equal the given value. */ + startFrom_lte?: Maybe; + /** All values that are not equal to given value. */ + startFrom_not?: Maybe; + /** All values that are not contained in given list. */ + startFrom_not_in?: Maybe>; }; export type BlockIndexWhereUniqueInput = { - id?: Maybe, - identifier?: Maybe, + id?: Maybe; + identifier?: Maybe; }; export type BlockNumber = Node & { - __typename?: 'BlockNumber', - authoredBy: Scalars['String'], - hash: Scalars['String'], - id: Scalars['ID'], - number: Scalars['Int'], - startDateTime: Scalars['DateTime'], + __typename?: 'BlockNumber'; + authoredBy: Scalars['String']; + hash: Scalars['String']; + id: Scalars['ID']; + number: Scalars['Int']; + startDateTime: Scalars['DateTime']; }; +/** A connection to a list of items. */ export type BlockNumberConnection = { - __typename?: 'BlockNumberConnection', - aggregate: AggregateBlockNumber, - edges: Array>, - pageInfo: PageInfo, -}; - -export type BlockNumberCreateInput = { - authoredBy: Scalars['String'], - hash: Scalars['String'], - id?: Maybe, - number: Scalars['Int'], - startDateTime: Scalars['DateTime'], -}; - -export type BlockNumberCreateOneInput = { - connect?: Maybe, - create?: Maybe, + __typename?: 'BlockNumberConnection'; + aggregate: AggregateBlockNumber; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; +/** An edge in a connection. */ export type BlockNumberEdge = { - __typename?: 'BlockNumberEdge', - cursor: Scalars['String'], - node: BlockNumber, + __typename?: 'BlockNumberEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: BlockNumber; }; export enum BlockNumberOrderByInput { @@ -357,147 +383,164 @@ export enum BlockNumberOrderByInput { } export type BlockNumberPreviousValues = { - __typename?: 'BlockNumberPreviousValues', - authoredBy: Scalars['String'], - hash: Scalars['String'], - id: Scalars['ID'], - number: Scalars['Int'], - startDateTime: Scalars['DateTime'], + __typename?: 'BlockNumberPreviousValues'; + authoredBy: Scalars['String']; + hash: Scalars['String']; + id: Scalars['ID']; + number: Scalars['Int']; + startDateTime: Scalars['DateTime']; }; export type BlockNumberSubscriptionPayload = { - __typename?: 'BlockNumberSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, + __typename?: 'BlockNumberSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; export type BlockNumberSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type BlockNumberUpdateDataInput = { - authoredBy?: Maybe, - hash?: Maybe, - number?: Maybe, - startDateTime?: Maybe, -}; - -export type BlockNumberUpdateInput = { - authoredBy?: Maybe, - hash?: Maybe, - number?: Maybe, - startDateTime?: Maybe, -}; - -export type BlockNumberUpdateManyMutationInput = { - authoredBy?: Maybe, - hash?: Maybe, - number?: Maybe, - startDateTime?: Maybe, -}; - -export type BlockNumberUpdateOneRequiredInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type BlockNumberUpsertNestedInput = { - create: BlockNumberCreateInput, - update: BlockNumberUpdateDataInput, + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; export type BlockNumberWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - authoredBy?: Maybe, - authoredBy_contains?: Maybe, - authoredBy_ends_with?: Maybe, - authoredBy_gt?: Maybe, - authoredBy_gte?: Maybe, - authoredBy_in?: Maybe>, - authoredBy_lt?: Maybe, - authoredBy_lte?: Maybe, - authoredBy_not?: Maybe, - authoredBy_not_contains?: Maybe, - authoredBy_not_ends_with?: Maybe, - authoredBy_not_in?: Maybe>, - authoredBy_not_starts_with?: Maybe, - authoredBy_starts_with?: Maybe, - hash?: Maybe, - hash_contains?: Maybe, - hash_ends_with?: Maybe, - hash_gt?: Maybe, - hash_gte?: Maybe, - hash_in?: Maybe>, - hash_lt?: Maybe, - hash_lte?: Maybe, - hash_not?: Maybe, - hash_not_contains?: Maybe, - hash_not_ends_with?: Maybe, - hash_not_in?: Maybe>, - hash_not_starts_with?: Maybe, - hash_starts_with?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - number?: Maybe, - number_gt?: Maybe, - number_gte?: Maybe, - number_in?: Maybe>, - number_lt?: Maybe, - number_lte?: Maybe, - number_not?: Maybe, - number_not_in?: Maybe>, - startDateTime?: Maybe, - startDateTime_gt?: Maybe, - startDateTime_gte?: Maybe, - startDateTime_in?: Maybe>, - startDateTime_lt?: Maybe, - startDateTime_lte?: Maybe, - startDateTime_not?: Maybe, - startDateTime_not_in?: Maybe>, + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + authoredBy?: Maybe; + /** All values containing the given string. */ + authoredBy_contains?: Maybe; + /** All values ending with the given string. */ + authoredBy_ends_with?: Maybe; + /** All values greater than the given value. */ + authoredBy_gt?: Maybe; + /** All values greater than or equal the given value. */ + authoredBy_gte?: Maybe; + /** All values that are contained in given list. */ + authoredBy_in?: Maybe>; + /** All values less than the given value. */ + authoredBy_lt?: Maybe; + /** All values less than or equal the given value. */ + authoredBy_lte?: Maybe; + /** All values that are not equal to given value. */ + authoredBy_not?: Maybe; + /** All values not containing the given string. */ + authoredBy_not_contains?: Maybe; + /** All values not ending with the given string. */ + authoredBy_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + authoredBy_not_in?: Maybe>; + /** All values not starting with the given string. */ + authoredBy_not_starts_with?: Maybe; + /** All values starting with the given string. */ + authoredBy_starts_with?: Maybe; + hash?: Maybe; + /** All values containing the given string. */ + hash_contains?: Maybe; + /** All values ending with the given string. */ + hash_ends_with?: Maybe; + /** All values greater than the given value. */ + hash_gt?: Maybe; + /** All values greater than or equal the given value. */ + hash_gte?: Maybe; + /** All values that are contained in given list. */ + hash_in?: Maybe>; + /** All values less than the given value. */ + hash_lt?: Maybe; + /** All values less than or equal the given value. */ + hash_lte?: Maybe; + /** All values that are not equal to given value. */ + hash_not?: Maybe; + /** All values not containing the given string. */ + hash_not_contains?: Maybe; + /** All values not ending with the given string. */ + hash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + hash_not_in?: Maybe>; + /** All values not starting with the given string. */ + hash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + hash_starts_with?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + number?: Maybe; + /** All values greater than the given value. */ + number_gt?: Maybe; + /** All values greater than or equal the given value. */ + number_gte?: Maybe; + /** All values that are contained in given list. */ + number_in?: Maybe>; + /** All values less than the given value. */ + number_lt?: Maybe; + /** All values less than or equal the given value. */ + number_lte?: Maybe; + /** All values that are not equal to given value. */ + number_not?: Maybe; + /** All values that are not contained in given list. */ + number_not_in?: Maybe>; + startDateTime?: Maybe; + /** All values greater than the given value. */ + startDateTime_gt?: Maybe; + /** All values greater than or equal the given value. */ + startDateTime_gte?: Maybe; + /** All values that are contained in given list. */ + startDateTime_in?: Maybe>; + /** All values less than the given value. */ + startDateTime_lt?: Maybe; + /** All values less than or equal the given value. */ + startDateTime_lte?: Maybe; + /** All values that are not equal to given value. */ + startDateTime_not?: Maybe; + /** All values that are not contained in given list. */ + startDateTime_not_in?: Maybe>; }; export type BlockNumberWhereUniqueInput = { - hash?: Maybe, - id?: Maybe, - number?: Maybe, -}; - - -export type Bpchar_Comparison_Exp = { - _eq?: Maybe, - _gt?: Maybe, - _gte?: Maybe, - _in?: Maybe>, - _is_null?: Maybe, - _lt?: Maybe, - _lte?: Maybe, - _neq?: Maybe, - _nin?: Maybe>, + hash?: Maybe; + id?: Maybe; + number?: Maybe; }; export enum CacheControlScope { @@ -506,1643 +549,2861 @@ export enum CacheControlScope { } export type ChangeResponse = { - __typename?: 'ChangeResponse', - message?: Maybe, - token?: Maybe, + __typename?: 'ChangeResponse'; + message?: Maybe; + token?: Maybe; }; -export type Comment_Reactions = { - __typename?: 'comment_reactions', - comment: Comments, - comment_id: Scalars['uuid'], - created_at: Scalars['timestamp'], - id: Scalars['Int'], - reacting_user?: Maybe, - reaction: Scalars['bpchar'], - updated_at: Scalars['timestamp'], - user_id: Scalars['Int'], +export type Council = Node & { + __typename?: 'Council'; + blockNumber: BlockNumber; + id: Scalars['ID']; + members?: Maybe>; }; -export type Comment_Reactions_Aggregate = { - __typename?: 'comment_reactions_aggregate', - aggregate?: Maybe, - nodes: Array, -}; -export type Comment_Reactions_Aggregate_Fields = { - __typename?: 'comment_reactions_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, +export type CouncilMembersArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; - -export type Comment_Reactions_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe +/** A connection to a list of items. */ +export type CouncilConnection = { + __typename?: 'CouncilConnection'; + aggregate: AggregateCouncil; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type Comment_Reactions_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, +/** An edge in a connection. */ +export type CouncilEdge = { + __typename?: 'CouncilEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Council; }; -export type Comment_Reactions_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, +export type CouncilMember = Node & { + __typename?: 'CouncilMember'; + address: Scalars['String']; + councils?: Maybe>; + id: Scalars['ID']; }; -export type Comment_Reactions_Avg_Fields = { - __typename?: 'comment_reactions_avg_fields', - id?: Maybe, - user_id?: Maybe, + +export type CouncilMemberCouncilsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Comment_Reactions_Avg_Order_By = { - id?: Maybe, - user_id?: Maybe, +/** A connection to a list of items. */ +export type CouncilMemberConnection = { + __typename?: 'CouncilMemberConnection'; + aggregate: AggregateCouncilMember; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type Comment_Reactions_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - comment?: Maybe, - comment_id?: Maybe, - created_at?: Maybe, - id?: Maybe, - reaction?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, +/** An edge in a connection. */ +export type CouncilMemberEdge = { + __typename?: 'CouncilMemberEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: CouncilMember; }; -export enum Comment_Reactions_Constraint { - CommentReactionsPkey = 'comment_reactions_pkey' +export enum CouncilMemberOrderByInput { + AddressAsc = 'address_ASC', + AddressDesc = 'address_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC' } -export type Comment_Reactions_Inc_Input = { - id?: Maybe, - user_id?: Maybe, +export type CouncilMemberPreviousValues = { + __typename?: 'CouncilMemberPreviousValues'; + address: Scalars['String']; + id: Scalars['ID']; }; -export type Comment_Reactions_Insert_Input = { - comment?: Maybe, - comment_id?: Maybe, - created_at?: Maybe, - id?: Maybe, - reaction?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, +export type CouncilMemberSubscriptionPayload = { + __typename?: 'CouncilMemberSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type Comment_Reactions_Max_Fields = { - __typename?: 'comment_reactions_max_fields', - comment_id?: Maybe, - created_at?: Maybe, - id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, +export type CouncilMemberSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type Comment_Reactions_Max_Order_By = { - comment_id?: Maybe, - created_at?: Maybe, - id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, +export type CouncilMemberWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + address?: Maybe; + /** All values containing the given string. */ + address_contains?: Maybe; + /** All values ending with the given string. */ + address_ends_with?: Maybe; + /** All values greater than the given value. */ + address_gt?: Maybe; + /** All values greater than or equal the given value. */ + address_gte?: Maybe; + /** All values that are contained in given list. */ + address_in?: Maybe>; + /** All values less than the given value. */ + address_lt?: Maybe; + /** All values less than or equal the given value. */ + address_lte?: Maybe; + /** All values that are not equal to given value. */ + address_not?: Maybe; + /** All values not containing the given string. */ + address_not_contains?: Maybe; + /** All values not ending with the given string. */ + address_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + address_not_in?: Maybe>; + /** All values not starting with the given string. */ + address_not_starts_with?: Maybe; + /** All values starting with the given string. */ + address_starts_with?: Maybe; + councils_every?: Maybe; + councils_none?: Maybe; + councils_some?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; }; -export type Comment_Reactions_Min_Fields = { - __typename?: 'comment_reactions_min_fields', - comment_id?: Maybe, - created_at?: Maybe, - id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, +export type CouncilMemberWhereUniqueInput = { + address?: Maybe; + id?: Maybe; }; -export type Comment_Reactions_Min_Order_By = { - comment_id?: Maybe, - created_at?: Maybe, - id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, +export enum CouncilOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC' +} + +export type CouncilPreviousValues = { + __typename?: 'CouncilPreviousValues'; + id: Scalars['ID']; }; -export type Comment_Reactions_Mutation_Response = { - __typename?: 'comment_reactions_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, +export type CouncilSubscriptionPayload = { + __typename?: 'CouncilSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type Comment_Reactions_Obj_Rel_Insert_Input = { - data: Comment_Reactions_Insert_Input, - on_conflict?: Maybe, +export type CouncilSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type Comment_Reactions_On_Conflict = { - constraint: Comment_Reactions_Constraint, - update_columns: Array, - where?: Maybe, +export type CouncilWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + members_every?: Maybe; + members_none?: Maybe; + members_some?: Maybe; }; -export type Comment_Reactions_Order_By = { - comment?: Maybe, - comment_id?: Maybe, - created_at?: Maybe, - id?: Maybe, - reaction?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, +export type CouncilWhereUniqueInput = { + id?: Maybe; }; -export type Comment_Reactions_Pk_Columns_Input = { - id: Scalars['Int'], + +export type Era = Node & { + __typename?: 'Era'; + eraStartSessionIndex: Session; + id: Scalars['ID']; + index: Scalars['Int']; + individualPoints: Array; + totalPoints: Scalars['String']; }; -export enum Comment_Reactions_Select_Column { - CommentId = 'comment_id', - CreatedAt = 'created_at', - Id = 'id', - Reaction = 'reaction', - UpdatedAt = 'updated_at', - UserId = 'user_id' -} +/** A connection to a list of items. */ +export type EraConnection = { + __typename?: 'EraConnection'; + aggregate: AggregateEra; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; -export type Comment_Reactions_Set_Input = { - comment_id?: Maybe, - created_at?: Maybe, - id?: Maybe, - reaction?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, +/** An edge in a connection. */ +export type EraEdge = { + __typename?: 'EraEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Era; }; -export type Comment_Reactions_Stddev_Fields = { - __typename?: 'comment_reactions_stddev_fields', - id?: Maybe, - user_id?: Maybe, +export enum EraOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + IndexAsc = 'index_ASC', + IndexDesc = 'index_DESC', + TotalPointsAsc = 'totalPoints_ASC', + TotalPointsDesc = 'totalPoints_DESC' +} + +export type EraPreviousValues = { + __typename?: 'EraPreviousValues'; + id: Scalars['ID']; + index: Scalars['Int']; + individualPoints: Array; + totalPoints: Scalars['String']; }; -export type Comment_Reactions_Stddev_Order_By = { - id?: Maybe, - user_id?: Maybe, +export type EraSubscriptionPayload = { + __typename?: 'EraSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type Comment_Reactions_Stddev_Pop_Fields = { - __typename?: 'comment_reactions_stddev_pop_fields', - id?: Maybe, - user_id?: Maybe, +export type EraSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type Comment_Reactions_Stddev_Pop_Order_By = { - id?: Maybe, - user_id?: Maybe, +export type EraWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + eraStartSessionIndex?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + index?: Maybe; + /** All values greater than the given value. */ + index_gt?: Maybe; + /** All values greater than or equal the given value. */ + index_gte?: Maybe; + /** All values that are contained in given list. */ + index_in?: Maybe>; + /** All values less than the given value. */ + index_lt?: Maybe; + /** All values less than or equal the given value. */ + index_lte?: Maybe; + /** All values that are not equal to given value. */ + index_not?: Maybe; + /** All values that are not contained in given list. */ + index_not_in?: Maybe>; + totalPoints?: Maybe; + /** All values containing the given string. */ + totalPoints_contains?: Maybe; + /** All values ending with the given string. */ + totalPoints_ends_with?: Maybe; + /** All values greater than the given value. */ + totalPoints_gt?: Maybe; + /** All values greater than or equal the given value. */ + totalPoints_gte?: Maybe; + /** All values that are contained in given list. */ + totalPoints_in?: Maybe>; + /** All values less than the given value. */ + totalPoints_lt?: Maybe; + /** All values less than or equal the given value. */ + totalPoints_lte?: Maybe; + /** All values that are not equal to given value. */ + totalPoints_not?: Maybe; + /** All values not containing the given string. */ + totalPoints_not_contains?: Maybe; + /** All values not ending with the given string. */ + totalPoints_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + totalPoints_not_in?: Maybe>; + /** All values not starting with the given string. */ + totalPoints_not_starts_with?: Maybe; + /** All values starting with the given string. */ + totalPoints_starts_with?: Maybe; }; -export type Comment_Reactions_Stddev_Samp_Fields = { - __typename?: 'comment_reactions_stddev_samp_fields', - id?: Maybe, - user_id?: Maybe, +export type EraWhereUniqueInput = { + id?: Maybe; + index?: Maybe; }; -export type Comment_Reactions_Stddev_Samp_Order_By = { - id?: Maybe, - user_id?: Maybe, +export type HeartBeat = Node & { + __typename?: 'HeartBeat'; + authorityId: Scalars['String']; + id: Scalars['ID']; + sessionIndex: Session; }; -export type Comment_Reactions_Sum_Fields = { - __typename?: 'comment_reactions_sum_fields', - id?: Maybe, - user_id?: Maybe, +/** A connection to a list of items. */ +export type HeartBeatConnection = { + __typename?: 'HeartBeatConnection'; + aggregate: AggregateHeartBeat; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type Comment_Reactions_Sum_Order_By = { - id?: Maybe, - user_id?: Maybe, +/** An edge in a connection. */ +export type HeartBeatEdge = { + __typename?: 'HeartBeatEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: HeartBeat; }; -export enum Comment_Reactions_Update_Column { - CommentId = 'comment_id', - CreatedAt = 'created_at', - Id = 'id', - Reaction = 'reaction', - UpdatedAt = 'updated_at', - UserId = 'user_id' +export enum HeartBeatOrderByInput { + AuthorityIdAsc = 'authorityId_ASC', + AuthorityIdDesc = 'authorityId_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC' } -export type Comment_Reactions_Var_Pop_Fields = { - __typename?: 'comment_reactions_var_pop_fields', - id?: Maybe, - user_id?: Maybe, +export type HeartBeatPreviousValues = { + __typename?: 'HeartBeatPreviousValues'; + authorityId: Scalars['String']; + id: Scalars['ID']; }; -export type Comment_Reactions_Var_Pop_Order_By = { - id?: Maybe, - user_id?: Maybe, +export type HeartBeatSubscriptionPayload = { + __typename?: 'HeartBeatSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type Comment_Reactions_Var_Samp_Fields = { - __typename?: 'comment_reactions_var_samp_fields', - id?: Maybe, - user_id?: Maybe, +export type HeartBeatSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type Comment_Reactions_Var_Samp_Order_By = { - id?: Maybe, - user_id?: Maybe, +export type HeartBeatWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + authorityId?: Maybe; + /** All values containing the given string. */ + authorityId_contains?: Maybe; + /** All values ending with the given string. */ + authorityId_ends_with?: Maybe; + /** All values greater than the given value. */ + authorityId_gt?: Maybe; + /** All values greater than or equal the given value. */ + authorityId_gte?: Maybe; + /** All values that are contained in given list. */ + authorityId_in?: Maybe>; + /** All values less than the given value. */ + authorityId_lt?: Maybe; + /** All values less than or equal the given value. */ + authorityId_lte?: Maybe; + /** All values that are not equal to given value. */ + authorityId_not?: Maybe; + /** All values not containing the given string. */ + authorityId_not_contains?: Maybe; + /** All values not ending with the given string. */ + authorityId_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + authorityId_not_in?: Maybe>; + /** All values not starting with the given string. */ + authorityId_not_starts_with?: Maybe; + /** All values starting with the given string. */ + authorityId_starts_with?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + sessionIndex?: Maybe; }; -export type Comment_Reactions_Variance_Fields = { - __typename?: 'comment_reactions_variance_fields', - id?: Maybe, - user_id?: Maybe, +export type HeartBeatWhereUniqueInput = { + id?: Maybe; }; -export type Comment_Reactions_Variance_Order_By = { - id?: Maybe, - user_id?: Maybe, +/** expression to compare columns of type Int. All fields are combined with logical 'AND'. */ +export type Int_Comparison_Exp = { + _eq?: Maybe; + _gt?: Maybe; + _gte?: Maybe; + _in?: Maybe>; + _is_null?: Maybe; + _lt?: Maybe; + _lte?: Maybe; + _neq?: Maybe; + _nin?: Maybe>; }; -export type Comments = { - __typename?: 'comments', - author?: Maybe, - author_id: Scalars['Int'], - comment_reactions: Array, - comment_reactions_aggregate: Comment_Reactions_Aggregate, - content: Scalars['String'], - created_at: Scalars['timestamptz'], - id: Scalars['uuid'], - post: Posts, - post_id: Scalars['Int'], - updated_at: Scalars['timestamptz'], + +export type LoginResponse = { + __typename?: 'LoginResponse'; + token?: Maybe; }; +export type Message = { + __typename?: 'Message'; + message?: Maybe; +}; -export type CommentsComment_ReactionsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +export type Motion = { + __typename?: 'Motion'; + author: Scalars['String']; + id: Scalars['Int']; + memberCount: Scalars['Int']; + metaDescription: Scalars['String']; + method: Scalars['String']; + motionProposalArguments?: Maybe>; + motionProposalHash: Scalars['String']; + motionProposalId: Scalars['Int']; + motionStatus?: Maybe>; + preimage?: Maybe; + preimageHash?: Maybe; + section: Scalars['String']; + treasurySpendProposal?: Maybe; }; -export type CommentsComment_Reactions_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +export type MotionMotionProposalArgumentsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Comments_Aggregate = { - __typename?: 'comments_aggregate', - aggregate?: Maybe, - nodes: Array, -}; -export type Comments_Aggregate_Fields = { - __typename?: 'comments_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, +export type MotionMotionStatusArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; - -export type Comments_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe +/** A connection to a list of items. */ +export type MotionConnection = { + __typename?: 'MotionConnection'; + aggregate: AggregateMotion; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type Comments_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, +/** An edge in a connection. */ +export type MotionEdge = { + __typename?: 'MotionEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Motion; }; -export type Comments_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, +export enum MotionOrderByInput { + AuthorAsc = 'author_ASC', + AuthorDesc = 'author_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + MemberCountAsc = 'memberCount_ASC', + MemberCountDesc = 'memberCount_DESC', + MetaDescriptionAsc = 'metaDescription_ASC', + MetaDescriptionDesc = 'metaDescription_DESC', + MethodAsc = 'method_ASC', + MethodDesc = 'method_DESC', + MotionProposalHashAsc = 'motionProposalHash_ASC', + MotionProposalHashDesc = 'motionProposalHash_DESC', + MotionProposalIdAsc = 'motionProposalId_ASC', + MotionProposalIdDesc = 'motionProposalId_DESC', + PreimageHashAsc = 'preimageHash_ASC', + PreimageHashDesc = 'preimageHash_DESC', + SectionAsc = 'section_ASC', + SectionDesc = 'section_DESC' +} + +export type MotionPreviousValues = { + __typename?: 'MotionPreviousValues'; + author: Scalars['String']; + id: Scalars['Int']; + memberCount: Scalars['Int']; + metaDescription: Scalars['String']; + method: Scalars['String']; + motionProposalHash: Scalars['String']; + motionProposalId: Scalars['Int']; + preimageHash?: Maybe; + section: Scalars['String']; }; -export type Comments_Avg_Fields = { - __typename?: 'comments_avg_fields', - author_id?: Maybe, - post_id?: Maybe, +export type MotionProposalArgument = Node & { + __typename?: 'MotionProposalArgument'; + id: Scalars['ID']; + motion: Motion; + name: Scalars['String']; + value: Scalars['String']; }; -export type Comments_Avg_Order_By = { - author_id?: Maybe, - post_id?: Maybe, +/** A connection to a list of items. */ +export type MotionProposalArgumentConnection = { + __typename?: 'MotionProposalArgumentConnection'; + aggregate: AggregateMotionProposalArgument; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type Comments_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - author_id?: Maybe, - comment_reactions?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, +/** An edge in a connection. */ +export type MotionProposalArgumentEdge = { + __typename?: 'MotionProposalArgumentEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: MotionProposalArgument; }; -export enum Comments_Constraint { - CommentsPkey = 'comments_pkey' +export enum MotionProposalArgumentOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + NameAsc = 'name_ASC', + NameDesc = 'name_DESC', + ValueAsc = 'value_ASC', + ValueDesc = 'value_DESC' } -export type Comments_Inc_Input = { - author_id?: Maybe, - post_id?: Maybe, +export type MotionProposalArgumentPreviousValues = { + __typename?: 'MotionProposalArgumentPreviousValues'; + id: Scalars['ID']; + name: Scalars['String']; + value: Scalars['String']; }; -export type Comments_Insert_Input = { - author_id?: Maybe, - comment_reactions?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, +export type MotionProposalArgumentSubscriptionPayload = { + __typename?: 'MotionProposalArgumentSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type Comments_Max_Fields = { - __typename?: 'comments_max_fields', - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, +export type MotionProposalArgumentSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type Comments_Max_Order_By = { - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, +export type MotionProposalArgumentWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + motion?: Maybe; + name?: Maybe; + /** All values containing the given string. */ + name_contains?: Maybe; + /** All values ending with the given string. */ + name_ends_with?: Maybe; + /** All values greater than the given value. */ + name_gt?: Maybe; + /** All values greater than or equal the given value. */ + name_gte?: Maybe; + /** All values that are contained in given list. */ + name_in?: Maybe>; + /** All values less than the given value. */ + name_lt?: Maybe; + /** All values less than or equal the given value. */ + name_lte?: Maybe; + /** All values that are not equal to given value. */ + name_not?: Maybe; + /** All values not containing the given string. */ + name_not_contains?: Maybe; + /** All values not ending with the given string. */ + name_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + name_not_in?: Maybe>; + /** All values not starting with the given string. */ + name_not_starts_with?: Maybe; + /** All values starting with the given string. */ + name_starts_with?: Maybe; + value?: Maybe; + /** All values containing the given string. */ + value_contains?: Maybe; + /** All values ending with the given string. */ + value_ends_with?: Maybe; + /** All values greater than the given value. */ + value_gt?: Maybe; + /** All values greater than or equal the given value. */ + value_gte?: Maybe; + /** All values that are contained in given list. */ + value_in?: Maybe>; + /** All values less than the given value. */ + value_lt?: Maybe; + /** All values less than or equal the given value. */ + value_lte?: Maybe; + /** All values that are not equal to given value. */ + value_not?: Maybe; + /** All values not containing the given string. */ + value_not_contains?: Maybe; + /** All values not ending with the given string. */ + value_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + value_not_in?: Maybe>; + /** All values not starting with the given string. */ + value_not_starts_with?: Maybe; + /** All values starting with the given string. */ + value_starts_with?: Maybe; }; -export type Comments_Min_Fields = { - __typename?: 'comments_min_fields', - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, +export type MotionProposalArgumentWhereUniqueInput = { + id?: Maybe; }; -export type Comments_Min_Order_By = { - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, +export type MotionStatus = Node & { + __typename?: 'MotionStatus'; + blockNumber: BlockNumber; + id: Scalars['ID']; + motion: Motion; + status: Scalars['String']; + uniqueStatus: Scalars['String']; }; -export type Comments_Mutation_Response = { - __typename?: 'comments_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, +/** A connection to a list of items. */ +export type MotionStatusConnection = { + __typename?: 'MotionStatusConnection'; + aggregate: AggregateMotionStatus; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type Comments_Obj_Rel_Insert_Input = { - data: Comments_Insert_Input, - on_conflict?: Maybe, +/** An edge in a connection. */ +export type MotionStatusEdge = { + __typename?: 'MotionStatusEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: MotionStatus; }; -export type Comments_On_Conflict = { - constraint: Comments_Constraint, - update_columns: Array, - where?: Maybe, -}; +export enum MotionStatusOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + StatusAsc = 'status_ASC', + StatusDesc = 'status_DESC', + UniqueStatusAsc = 'uniqueStatus_ASC', + UniqueStatusDesc = 'uniqueStatus_DESC' +} -export type Comments_Order_By = { - author_id?: Maybe, - comment_reactions_aggregate?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, +export type MotionStatusPreviousValues = { + __typename?: 'MotionStatusPreviousValues'; + id: Scalars['ID']; + status: Scalars['String']; + uniqueStatus: Scalars['String']; }; -export type Comments_Pk_Columns_Input = { - id: Scalars['uuid'], +export type MotionStatusSubscriptionPayload = { + __typename?: 'MotionStatusSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export enum Comments_Select_Column { - AuthorId = 'author_id', - Content = 'content', - CreatedAt = 'created_at', - Id = 'id', - PostId = 'post_id', - UpdatedAt = 'updated_at' -} - -export type Comments_Set_Input = { - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, +export type MotionStatusSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type Comments_Stddev_Fields = { - __typename?: 'comments_stddev_fields', - author_id?: Maybe, - post_id?: Maybe, +export type MotionStatusWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + motion?: Maybe; + status?: Maybe; + /** All values containing the given string. */ + status_contains?: Maybe; + /** All values ending with the given string. */ + status_ends_with?: Maybe; + /** All values greater than the given value. */ + status_gt?: Maybe; + /** All values greater than or equal the given value. */ + status_gte?: Maybe; + /** All values that are contained in given list. */ + status_in?: Maybe>; + /** All values less than the given value. */ + status_lt?: Maybe; + /** All values less than or equal the given value. */ + status_lte?: Maybe; + /** All values that are not equal to given value. */ + status_not?: Maybe; + /** All values not containing the given string. */ + status_not_contains?: Maybe; + /** All values not ending with the given string. */ + status_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + status_not_in?: Maybe>; + /** All values not starting with the given string. */ + status_not_starts_with?: Maybe; + /** All values starting with the given string. */ + status_starts_with?: Maybe; + uniqueStatus?: Maybe; + /** All values containing the given string. */ + uniqueStatus_contains?: Maybe; + /** All values ending with the given string. */ + uniqueStatus_ends_with?: Maybe; + /** All values greater than the given value. */ + uniqueStatus_gt?: Maybe; + /** All values greater than or equal the given value. */ + uniqueStatus_gte?: Maybe; + /** All values that are contained in given list. */ + uniqueStatus_in?: Maybe>; + /** All values less than the given value. */ + uniqueStatus_lt?: Maybe; + /** All values less than or equal the given value. */ + uniqueStatus_lte?: Maybe; + /** All values that are not equal to given value. */ + uniqueStatus_not?: Maybe; + /** All values not containing the given string. */ + uniqueStatus_not_contains?: Maybe; + /** All values not ending with the given string. */ + uniqueStatus_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + uniqueStatus_not_in?: Maybe>; + /** All values not starting with the given string. */ + uniqueStatus_not_starts_with?: Maybe; + /** All values starting with the given string. */ + uniqueStatus_starts_with?: Maybe; }; -export type Comments_Stddev_Order_By = { - author_id?: Maybe, - post_id?: Maybe, +export type MotionStatusWhereUniqueInput = { + id?: Maybe; + uniqueStatus?: Maybe; }; -export type Comments_Stddev_Pop_Fields = { - __typename?: 'comments_stddev_pop_fields', - author_id?: Maybe, - post_id?: Maybe, +export type MotionSubscriptionPayload = { + __typename?: 'MotionSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type Comments_Stddev_Pop_Order_By = { - author_id?: Maybe, - post_id?: Maybe, +export type MotionSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type Comments_Stddev_Samp_Fields = { - __typename?: 'comments_stddev_samp_fields', - author_id?: Maybe, - post_id?: Maybe, +export type MotionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + author?: Maybe; + /** All values containing the given string. */ + author_contains?: Maybe; + /** All values ending with the given string. */ + author_ends_with?: Maybe; + /** All values greater than the given value. */ + author_gt?: Maybe; + /** All values greater than or equal the given value. */ + author_gte?: Maybe; + /** All values that are contained in given list. */ + author_in?: Maybe>; + /** All values less than the given value. */ + author_lt?: Maybe; + /** All values less than or equal the given value. */ + author_lte?: Maybe; + /** All values that are not equal to given value. */ + author_not?: Maybe; + /** All values not containing the given string. */ + author_not_contains?: Maybe; + /** All values not ending with the given string. */ + author_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + author_not_in?: Maybe>; + /** All values not starting with the given string. */ + author_not_starts_with?: Maybe; + /** All values starting with the given string. */ + author_starts_with?: Maybe; + id?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + memberCount?: Maybe; + /** All values greater than the given value. */ + memberCount_gt?: Maybe; + /** All values greater than or equal the given value. */ + memberCount_gte?: Maybe; + /** All values that are contained in given list. */ + memberCount_in?: Maybe>; + /** All values less than the given value. */ + memberCount_lt?: Maybe; + /** All values less than or equal the given value. */ + memberCount_lte?: Maybe; + /** All values that are not equal to given value. */ + memberCount_not?: Maybe; + /** All values that are not contained in given list. */ + memberCount_not_in?: Maybe>; + metaDescription?: Maybe; + /** All values containing the given string. */ + metaDescription_contains?: Maybe; + /** All values ending with the given string. */ + metaDescription_ends_with?: Maybe; + /** All values greater than the given value. */ + metaDescription_gt?: Maybe; + /** All values greater than or equal the given value. */ + metaDescription_gte?: Maybe; + /** All values that are contained in given list. */ + metaDescription_in?: Maybe>; + /** All values less than the given value. */ + metaDescription_lt?: Maybe; + /** All values less than or equal the given value. */ + metaDescription_lte?: Maybe; + /** All values that are not equal to given value. */ + metaDescription_not?: Maybe; + /** All values not containing the given string. */ + metaDescription_not_contains?: Maybe; + /** All values not ending with the given string. */ + metaDescription_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + metaDescription_not_in?: Maybe>; + /** All values not starting with the given string. */ + metaDescription_not_starts_with?: Maybe; + /** All values starting with the given string. */ + metaDescription_starts_with?: Maybe; + method?: Maybe; + /** All values containing the given string. */ + method_contains?: Maybe; + /** All values ending with the given string. */ + method_ends_with?: Maybe; + /** All values greater than the given value. */ + method_gt?: Maybe; + /** All values greater than or equal the given value. */ + method_gte?: Maybe; + /** All values that are contained in given list. */ + method_in?: Maybe>; + /** All values less than the given value. */ + method_lt?: Maybe; + /** All values less than or equal the given value. */ + method_lte?: Maybe; + /** All values that are not equal to given value. */ + method_not?: Maybe; + /** All values not containing the given string. */ + method_not_contains?: Maybe; + /** All values not ending with the given string. */ + method_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + method_not_in?: Maybe>; + /** All values not starting with the given string. */ + method_not_starts_with?: Maybe; + /** All values starting with the given string. */ + method_starts_with?: Maybe; + motionProposalArguments_every?: Maybe; + motionProposalArguments_none?: Maybe; + motionProposalArguments_some?: Maybe; + motionProposalHash?: Maybe; + /** All values containing the given string. */ + motionProposalHash_contains?: Maybe; + /** All values ending with the given string. */ + motionProposalHash_ends_with?: Maybe; + /** All values greater than the given value. */ + motionProposalHash_gt?: Maybe; + /** All values greater than or equal the given value. */ + motionProposalHash_gte?: Maybe; + /** All values that are contained in given list. */ + motionProposalHash_in?: Maybe>; + /** All values less than the given value. */ + motionProposalHash_lt?: Maybe; + /** All values less than or equal the given value. */ + motionProposalHash_lte?: Maybe; + /** All values that are not equal to given value. */ + motionProposalHash_not?: Maybe; + /** All values not containing the given string. */ + motionProposalHash_not_contains?: Maybe; + /** All values not ending with the given string. */ + motionProposalHash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + motionProposalHash_not_in?: Maybe>; + /** All values not starting with the given string. */ + motionProposalHash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + motionProposalHash_starts_with?: Maybe; + motionProposalId?: Maybe; + /** All values greater than the given value. */ + motionProposalId_gt?: Maybe; + /** All values greater than or equal the given value. */ + motionProposalId_gte?: Maybe; + /** All values that are contained in given list. */ + motionProposalId_in?: Maybe>; + /** All values less than the given value. */ + motionProposalId_lt?: Maybe; + /** All values less than or equal the given value. */ + motionProposalId_lte?: Maybe; + /** All values that are not equal to given value. */ + motionProposalId_not?: Maybe; + /** All values that are not contained in given list. */ + motionProposalId_not_in?: Maybe>; + motionStatus_every?: Maybe; + motionStatus_none?: Maybe; + motionStatus_some?: Maybe; + preimage?: Maybe; + preimageHash?: Maybe; + /** All values containing the given string. */ + preimageHash_contains?: Maybe; + /** All values ending with the given string. */ + preimageHash_ends_with?: Maybe; + /** All values greater than the given value. */ + preimageHash_gt?: Maybe; + /** All values greater than or equal the given value. */ + preimageHash_gte?: Maybe; + /** All values that are contained in given list. */ + preimageHash_in?: Maybe>; + /** All values less than the given value. */ + preimageHash_lt?: Maybe; + /** All values less than or equal the given value. */ + preimageHash_lte?: Maybe; + /** All values that are not equal to given value. */ + preimageHash_not?: Maybe; + /** All values not containing the given string. */ + preimageHash_not_contains?: Maybe; + /** All values not ending with the given string. */ + preimageHash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + preimageHash_not_in?: Maybe>; + /** All values not starting with the given string. */ + preimageHash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + preimageHash_starts_with?: Maybe; + section?: Maybe; + /** All values containing the given string. */ + section_contains?: Maybe; + /** All values ending with the given string. */ + section_ends_with?: Maybe; + /** All values greater than the given value. */ + section_gt?: Maybe; + /** All values greater than or equal the given value. */ + section_gte?: Maybe; + /** All values that are contained in given list. */ + section_in?: Maybe>; + /** All values less than the given value. */ + section_lt?: Maybe; + /** All values less than or equal the given value. */ + section_lte?: Maybe; + /** All values that are not equal to given value. */ + section_not?: Maybe; + /** All values not containing the given string. */ + section_not_contains?: Maybe; + /** All values not ending with the given string. */ + section_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + section_not_in?: Maybe>; + /** All values not starting with the given string. */ + section_not_starts_with?: Maybe; + /** All values starting with the given string. */ + section_starts_with?: Maybe; + treasurySpendProposal?: Maybe; }; -export type Comments_Stddev_Samp_Order_By = { - author_id?: Maybe, - post_id?: Maybe, +export type MotionWhereInput_Remote_Rel_Public_Onchain_Linksonchain_Motion = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + author?: Maybe; + /** All values containing the given string. */ + author_contains?: Maybe; + /** All values ending with the given string. */ + author_ends_with?: Maybe; + /** All values greater than the given value. */ + author_gt?: Maybe; + /** All values greater than or equal the given value. */ + author_gte?: Maybe; + /** All values that are contained in given list. */ + author_in?: Maybe>; + /** All values less than the given value. */ + author_lt?: Maybe; + /** All values less than or equal the given value. */ + author_lte?: Maybe; + /** All values that are not equal to given value. */ + author_not?: Maybe; + /** All values not containing the given string. */ + author_not_contains?: Maybe; + /** All values not ending with the given string. */ + author_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + author_not_in?: Maybe>; + /** All values not starting with the given string. */ + author_not_starts_with?: Maybe; + /** All values starting with the given string. */ + author_starts_with?: Maybe; + id?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + memberCount?: Maybe; + /** All values greater than the given value. */ + memberCount_gt?: Maybe; + /** All values greater than or equal the given value. */ + memberCount_gte?: Maybe; + /** All values that are contained in given list. */ + memberCount_in?: Maybe>; + /** All values less than the given value. */ + memberCount_lt?: Maybe; + /** All values less than or equal the given value. */ + memberCount_lte?: Maybe; + /** All values that are not equal to given value. */ + memberCount_not?: Maybe; + /** All values that are not contained in given list. */ + memberCount_not_in?: Maybe>; + metaDescription?: Maybe; + /** All values containing the given string. */ + metaDescription_contains?: Maybe; + /** All values ending with the given string. */ + metaDescription_ends_with?: Maybe; + /** All values greater than the given value. */ + metaDescription_gt?: Maybe; + /** All values greater than or equal the given value. */ + metaDescription_gte?: Maybe; + /** All values that are contained in given list. */ + metaDescription_in?: Maybe>; + /** All values less than the given value. */ + metaDescription_lt?: Maybe; + /** All values less than or equal the given value. */ + metaDescription_lte?: Maybe; + /** All values that are not equal to given value. */ + metaDescription_not?: Maybe; + /** All values not containing the given string. */ + metaDescription_not_contains?: Maybe; + /** All values not ending with the given string. */ + metaDescription_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + metaDescription_not_in?: Maybe>; + /** All values not starting with the given string. */ + metaDescription_not_starts_with?: Maybe; + /** All values starting with the given string. */ + metaDescription_starts_with?: Maybe; + method?: Maybe; + /** All values containing the given string. */ + method_contains?: Maybe; + /** All values ending with the given string. */ + method_ends_with?: Maybe; + /** All values greater than the given value. */ + method_gt?: Maybe; + /** All values greater than or equal the given value. */ + method_gte?: Maybe; + /** All values that are contained in given list. */ + method_in?: Maybe>; + /** All values less than the given value. */ + method_lt?: Maybe; + /** All values less than or equal the given value. */ + method_lte?: Maybe; + /** All values that are not equal to given value. */ + method_not?: Maybe; + /** All values not containing the given string. */ + method_not_contains?: Maybe; + /** All values not ending with the given string. */ + method_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + method_not_in?: Maybe>; + /** All values not starting with the given string. */ + method_not_starts_with?: Maybe; + /** All values starting with the given string. */ + method_starts_with?: Maybe; + motionProposalArguments_every?: Maybe; + motionProposalArguments_none?: Maybe; + motionProposalArguments_some?: Maybe; + motionProposalHash?: Maybe; + /** All values containing the given string. */ + motionProposalHash_contains?: Maybe; + /** All values ending with the given string. */ + motionProposalHash_ends_with?: Maybe; + /** All values greater than the given value. */ + motionProposalHash_gt?: Maybe; + /** All values greater than or equal the given value. */ + motionProposalHash_gte?: Maybe; + /** All values that are contained in given list. */ + motionProposalHash_in?: Maybe>; + /** All values less than the given value. */ + motionProposalHash_lt?: Maybe; + /** All values less than or equal the given value. */ + motionProposalHash_lte?: Maybe; + /** All values that are not equal to given value. */ + motionProposalHash_not?: Maybe; + /** All values not containing the given string. */ + motionProposalHash_not_contains?: Maybe; + /** All values not ending with the given string. */ + motionProposalHash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + motionProposalHash_not_in?: Maybe>; + /** All values not starting with the given string. */ + motionProposalHash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + motionProposalHash_starts_with?: Maybe; + /** All values greater than the given value. */ + motionProposalId_gt?: Maybe; + /** All values greater than or equal the given value. */ + motionProposalId_gte?: Maybe; + /** All values that are contained in given list. */ + motionProposalId_in?: Maybe>; + /** All values less than the given value. */ + motionProposalId_lt?: Maybe; + /** All values less than or equal the given value. */ + motionProposalId_lte?: Maybe; + /** All values that are not equal to given value. */ + motionProposalId_not?: Maybe; + /** All values that are not contained in given list. */ + motionProposalId_not_in?: Maybe>; + motionStatus_every?: Maybe; + motionStatus_none?: Maybe; + motionStatus_some?: Maybe; + preimage?: Maybe; + preimageHash?: Maybe; + /** All values containing the given string. */ + preimageHash_contains?: Maybe; + /** All values ending with the given string. */ + preimageHash_ends_with?: Maybe; + /** All values greater than the given value. */ + preimageHash_gt?: Maybe; + /** All values greater than or equal the given value. */ + preimageHash_gte?: Maybe; + /** All values that are contained in given list. */ + preimageHash_in?: Maybe>; + /** All values less than the given value. */ + preimageHash_lt?: Maybe; + /** All values less than or equal the given value. */ + preimageHash_lte?: Maybe; + /** All values that are not equal to given value. */ + preimageHash_not?: Maybe; + /** All values not containing the given string. */ + preimageHash_not_contains?: Maybe; + /** All values not ending with the given string. */ + preimageHash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + preimageHash_not_in?: Maybe>; + /** All values not starting with the given string. */ + preimageHash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + preimageHash_starts_with?: Maybe; + section?: Maybe; + /** All values containing the given string. */ + section_contains?: Maybe; + /** All values ending with the given string. */ + section_ends_with?: Maybe; + /** All values greater than the given value. */ + section_gt?: Maybe; + /** All values greater than or equal the given value. */ + section_gte?: Maybe; + /** All values that are contained in given list. */ + section_in?: Maybe>; + /** All values less than the given value. */ + section_lt?: Maybe; + /** All values less than or equal the given value. */ + section_lte?: Maybe; + /** All values that are not equal to given value. */ + section_not?: Maybe; + /** All values not containing the given string. */ + section_not_contains?: Maybe; + /** All values not ending with the given string. */ + section_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + section_not_in?: Maybe>; + /** All values not starting with the given string. */ + section_not_starts_with?: Maybe; + /** All values starting with the given string. */ + section_starts_with?: Maybe; + treasurySpendProposal?: Maybe; }; -export type Comments_Sum_Fields = { - __typename?: 'comments_sum_fields', - author_id?: Maybe, - post_id?: Maybe, +export type MotionWhereUniqueInput = { + id?: Maybe; + motionProposalId?: Maybe; }; -export type Comments_Sum_Order_By = { - author_id?: Maybe, - post_id?: Maybe, +export type Mutation = { + __typename?: 'Mutation'; + addressLinkConfirm?: Maybe; + addressLinkStart?: Maybe; + addressLogin?: Maybe; + addressLoginStart?: Maybe; + addressSignupConfirm?: Maybe; + addressSignupStart?: Maybe; + addressUnlink?: Maybe; + changeEmail?: Maybe; + changeNotificationPreference?: Maybe; + changePassword?: Maybe; + changeUsername?: Maybe; + login?: Maybe; + logout?: Maybe; + postSubscribe?: Maybe; + postUnsubscribe?: Maybe; + reportContent?: Maybe; + requestResetPassword?: Maybe; + resendVerifyEmailToken?: Maybe; + resetPassword?: Maybe; + setCredentialsConfirm?: Maybe; + setCredentialsStart?: Maybe; + setDefaultAddress?: Maybe; + signup?: Maybe; + undoEmailChange?: Maybe; + verifyEmail?: Maybe; }; -export enum Comments_Update_Column { - AuthorId = 'author_id', - Content = 'content', - CreatedAt = 'created_at', - Id = 'id', - PostId = 'post_id', - UpdatedAt = 'updated_at' -} -export type Comments_Var_Pop_Fields = { - __typename?: 'comments_var_pop_fields', - author_id?: Maybe, - post_id?: Maybe, +export type MutationAddressLinkConfirmArgs = { + address_id: Scalars['Int']; + signature: Scalars['String']; }; -export type Comments_Var_Pop_Order_By = { - author_id?: Maybe, - post_id?: Maybe, -}; -export type Comments_Var_Samp_Fields = { - __typename?: 'comments_var_samp_fields', - author_id?: Maybe, - post_id?: Maybe, +export type MutationAddressLinkStartArgs = { + address: Scalars['String']; + network: Scalars['String']; }; -export type Comments_Var_Samp_Order_By = { - author_id?: Maybe, - post_id?: Maybe, -}; -export type Comments_Variance_Fields = { - __typename?: 'comments_variance_fields', - author_id?: Maybe, - post_id?: Maybe, +export type MutationAddressLoginArgs = { + address: Scalars['String']; + signature: Scalars['String']; }; -export type Comments_Variance_Order_By = { - author_id?: Maybe, - post_id?: Maybe, -}; -export type Council = Node & { - __typename?: 'Council', - blockNumber: BlockNumber, - id: Scalars['ID'], - members?: Maybe>, +export type MutationAddressLoginStartArgs = { + address: Scalars['String']; }; -export type CouncilMembersArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +export type MutationAddressSignupConfirmArgs = { + address: Scalars['String']; + network: Scalars['String']; + signature: Scalars['String']; }; -export type CouncilConnection = { - __typename?: 'CouncilConnection', - aggregate: AggregateCouncil, - edges: Array>, - pageInfo: PageInfo, -}; -export type CouncilCreateInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - members?: Maybe, +export type MutationAddressSignupStartArgs = { + address: Scalars['String']; }; -export type CouncilCreateManyWithoutMembersInput = { - connect?: Maybe>, - create?: Maybe>, -}; -export type CouncilCreateWithoutMembersInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, +export type MutationAddressUnlinkArgs = { + address: Scalars['String']; }; -export type CouncilEdge = { - __typename?: 'CouncilEdge', - cursor: Scalars['String'], - node: Council, -}; -export type CouncilMember = Node & { - __typename?: 'CouncilMember', - address: Scalars['String'], - councils?: Maybe>, - id: Scalars['ID'], +export type MutationChangeEmailArgs = { + email: Scalars['String']; + password: Scalars['String']; }; -export type CouncilMemberCouncilsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - -export type CouncilMemberConnection = { - __typename?: 'CouncilMemberConnection', - aggregate: AggregateCouncilMember, - edges: Array>, - pageInfo: PageInfo, +export type MutationChangeNotificationPreferenceArgs = { + notificationPreferences?: Maybe; }; -export type CouncilMemberCreateInput = { - address: Scalars['String'], - councils?: Maybe, - id?: Maybe, -}; -export type CouncilMemberCreateManyWithoutCouncilsInput = { - connect?: Maybe>, - create?: Maybe>, +export type MutationChangePasswordArgs = { + newPassword: Scalars['String']; + oldPassword: Scalars['String']; }; -export type CouncilMemberCreateWithoutCouncilsInput = { - address: Scalars['String'], - id?: Maybe, -}; -export type CouncilMemberEdge = { - __typename?: 'CouncilMemberEdge', - cursor: Scalars['String'], - node: CouncilMember, +export type MutationChangeUsernameArgs = { + password: Scalars['String']; + username: Scalars['String']; }; -export enum CouncilMemberOrderByInput { - AddressAsc = 'address_ASC', - AddressDesc = 'address_DESC', - IdAsc = 'id_ASC', - IdDesc = 'id_DESC' -} -export type CouncilMemberPreviousValues = { - __typename?: 'CouncilMemberPreviousValues', - address: Scalars['String'], - id: Scalars['ID'], -}; - -export type CouncilMemberScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - address?: Maybe, - address_contains?: Maybe, - address_ends_with?: Maybe, - address_gt?: Maybe, - address_gte?: Maybe, - address_in?: Maybe>, - address_lt?: Maybe, - address_lte?: Maybe, - address_not?: Maybe, - address_not_contains?: Maybe, - address_not_ends_with?: Maybe, - address_not_in?: Maybe>, - address_not_starts_with?: Maybe, - address_starts_with?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, +export type MutationLoginArgs = { + password: Scalars['String']; + username: Scalars['String']; }; -export type CouncilMemberSubscriptionPayload = { - __typename?: 'CouncilMemberSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type CouncilMemberSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +export type MutationPostSubscribeArgs = { + post_id: Scalars['Int']; }; -export type CouncilMemberUpdateInput = { - address?: Maybe, - councils?: Maybe, -}; -export type CouncilMemberUpdateManyDataInput = { - address?: Maybe, +export type MutationPostUnsubscribeArgs = { + post_id: Scalars['Int']; }; -export type CouncilMemberUpdateManyMutationInput = { - address?: Maybe, -}; -export type CouncilMemberUpdateManyWithoutCouncilsInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - updateMany?: Maybe>, - upsert?: Maybe>, +export type MutationReportContentArgs = { + comments?: Maybe; + content_id: Scalars['String']; + network: Scalars['String']; + reason: Scalars['String']; + type: Scalars['String']; }; -export type CouncilMemberUpdateManyWithWhereNestedInput = { - data: CouncilMemberUpdateManyDataInput, - where: CouncilMemberScalarWhereInput, -}; -export type CouncilMemberUpdateWithoutCouncilsDataInput = { - address?: Maybe, +export type MutationRequestResetPasswordArgs = { + email: Scalars['String']; }; -export type CouncilMemberUpdateWithWhereUniqueWithoutCouncilsInput = { - data: CouncilMemberUpdateWithoutCouncilsDataInput, - where: CouncilMemberWhereUniqueInput, -}; -export type CouncilMemberUpsertWithWhereUniqueWithoutCouncilsInput = { - create: CouncilMemberCreateWithoutCouncilsInput, - update: CouncilMemberUpdateWithoutCouncilsDataInput, - where: CouncilMemberWhereUniqueInput, +export type MutationResetPasswordArgs = { + newPassword: Scalars['String']; + token: Scalars['String']; + userId: Scalars['Int']; }; -export type CouncilMemberWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - address?: Maybe, - address_contains?: Maybe, - address_ends_with?: Maybe, - address_gt?: Maybe, - address_gte?: Maybe, - address_in?: Maybe>, - address_lt?: Maybe, - address_lte?: Maybe, - address_not?: Maybe, - address_not_contains?: Maybe, - address_not_ends_with?: Maybe, - address_not_in?: Maybe>, - address_not_starts_with?: Maybe, - address_starts_with?: Maybe, - councils_every?: Maybe, - councils_none?: Maybe, - councils_some?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, -}; -export type CouncilMemberWhereUniqueInput = { - address?: Maybe, - id?: Maybe, +export type MutationSetCredentialsConfirmArgs = { + address: Scalars['String']; + email?: Maybe; + password: Scalars['String']; + signature: Scalars['String']; + username: Scalars['String']; }; -export enum CouncilOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC' -} - -export type CouncilPreviousValues = { - __typename?: 'CouncilPreviousValues', - id: Scalars['ID'], -}; - -export type CouncilScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, -}; -export type CouncilSubscriptionPayload = { - __typename?: 'CouncilSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, +export type MutationSetCredentialsStartArgs = { + address: Scalars['String']; }; -export type CouncilSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; -export type CouncilUpdateInput = { - blockNumber?: Maybe, - members?: Maybe, +export type MutationSetDefaultAddressArgs = { + address: Scalars['String']; }; -export type CouncilUpdateManyWithoutMembersInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - upsert?: Maybe>, -}; -export type CouncilUpdateWithoutMembersDataInput = { - blockNumber?: Maybe, +export type MutationSignupArgs = { + email?: Maybe; + password: Scalars['String']; + username: Scalars['String']; }; -export type CouncilUpdateWithWhereUniqueWithoutMembersInput = { - data: CouncilUpdateWithoutMembersDataInput, - where: CouncilWhereUniqueInput, -}; -export type CouncilUpsertWithWhereUniqueWithoutMembersInput = { - create: CouncilCreateWithoutMembersInput, - update: CouncilUpdateWithoutMembersDataInput, - where: CouncilWhereUniqueInput, +export type MutationUndoEmailChangeArgs = { + token: Scalars['String']; }; -export type CouncilWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - members_every?: Maybe, - members_none?: Maybe, - members_some?: Maybe, -}; -export type CouncilWhereUniqueInput = { - id?: Maybe, +export type MutationVerifyEmailArgs = { + token: Scalars['String']; }; +export enum MutationType { + Created = 'CREATED', + Deleted = 'DELETED', + Updated = 'UPDATED' +} -export type Era = Node & { - __typename?: 'Era', - eraStartSessionIndex: Session, - id: Scalars['ID'], - index: Scalars['Int'], - individualPoints: Array, - totalPoints: Scalars['String'], -}; - -export type EraConnection = { - __typename?: 'EraConnection', - aggregate: AggregateEra, - edges: Array>, - pageInfo: PageInfo, +/** An object with an ID */ +export type Node = { + /** The id of the object. */ + id: Scalars['ID']; }; -export type EraCreateindividualPointsInput = { - set?: Maybe>, +export type Nomination = Node & { + __typename?: 'Nomination'; + id: Scalars['ID']; + nominatorController: Scalars['String']; + nominatorStash: Scalars['String']; + session: Session; + stakedAmount: Scalars['String']; + validatorController: Scalars['String']; + validatorStash: Scalars['String']; }; -export type EraCreateInput = { - eraStartSessionIndex: SessionCreateOneInput, - id?: Maybe, - index: Scalars['Int'], - individualPoints?: Maybe, - totalPoints: Scalars['String'], +/** A connection to a list of items. */ +export type NominationConnection = { + __typename?: 'NominationConnection'; + aggregate: AggregateNomination; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type EraEdge = { - __typename?: 'EraEdge', - cursor: Scalars['String'], - node: Era, +/** An edge in a connection. */ +export type NominationEdge = { + __typename?: 'NominationEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Nomination; }; -export enum EraOrderByInput { +export enum NominationOrderByInput { IdAsc = 'id_ASC', IdDesc = 'id_DESC', - IndexAsc = 'index_ASC', - IndexDesc = 'index_DESC', - TotalPointsAsc = 'totalPoints_ASC', - TotalPointsDesc = 'totalPoints_DESC' + NominatorControllerAsc = 'nominatorController_ASC', + NominatorControllerDesc = 'nominatorController_DESC', + NominatorStashAsc = 'nominatorStash_ASC', + NominatorStashDesc = 'nominatorStash_DESC', + StakedAmountAsc = 'stakedAmount_ASC', + StakedAmountDesc = 'stakedAmount_DESC', + ValidatorControllerAsc = 'validatorController_ASC', + ValidatorControllerDesc = 'validatorController_DESC', + ValidatorStashAsc = 'validatorStash_ASC', + ValidatorStashDesc = 'validatorStash_DESC' } -export type EraPreviousValues = { - __typename?: 'EraPreviousValues', - id: Scalars['ID'], - index: Scalars['Int'], - individualPoints: Array, - totalPoints: Scalars['String'], -}; - -export type EraSubscriptionPayload = { - __typename?: 'EraSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; - -export type EraSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +export type NominationPreviousValues = { + __typename?: 'NominationPreviousValues'; + id: Scalars['ID']; + nominatorController: Scalars['String']; + nominatorStash: Scalars['String']; + stakedAmount: Scalars['String']; + validatorController: Scalars['String']; + validatorStash: Scalars['String']; }; -export type EraUpdateindividualPointsInput = { - set?: Maybe>, +export type NominationSubscriptionPayload = { + __typename?: 'NominationSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type EraUpdateInput = { - eraStartSessionIndex?: Maybe, - index?: Maybe, - individualPoints?: Maybe, - totalPoints?: Maybe, +export type NominationSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type EraUpdateManyMutationInput = { - index?: Maybe, - individualPoints?: Maybe, - totalPoints?: Maybe, +export type NominationWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + nominatorController?: Maybe; + /** All values containing the given string. */ + nominatorController_contains?: Maybe; + /** All values ending with the given string. */ + nominatorController_ends_with?: Maybe; + /** All values greater than the given value. */ + nominatorController_gt?: Maybe; + /** All values greater than or equal the given value. */ + nominatorController_gte?: Maybe; + /** All values that are contained in given list. */ + nominatorController_in?: Maybe>; + /** All values less than the given value. */ + nominatorController_lt?: Maybe; + /** All values less than or equal the given value. */ + nominatorController_lte?: Maybe; + /** All values that are not equal to given value. */ + nominatorController_not?: Maybe; + /** All values not containing the given string. */ + nominatorController_not_contains?: Maybe; + /** All values not ending with the given string. */ + nominatorController_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + nominatorController_not_in?: Maybe>; + /** All values not starting with the given string. */ + nominatorController_not_starts_with?: Maybe; + /** All values starting with the given string. */ + nominatorController_starts_with?: Maybe; + nominatorStash?: Maybe; + /** All values containing the given string. */ + nominatorStash_contains?: Maybe; + /** All values ending with the given string. */ + nominatorStash_ends_with?: Maybe; + /** All values greater than the given value. */ + nominatorStash_gt?: Maybe; + /** All values greater than or equal the given value. */ + nominatorStash_gte?: Maybe; + /** All values that are contained in given list. */ + nominatorStash_in?: Maybe>; + /** All values less than the given value. */ + nominatorStash_lt?: Maybe; + /** All values less than or equal the given value. */ + nominatorStash_lte?: Maybe; + /** All values that are not equal to given value. */ + nominatorStash_not?: Maybe; + /** All values not containing the given string. */ + nominatorStash_not_contains?: Maybe; + /** All values not ending with the given string. */ + nominatorStash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + nominatorStash_not_in?: Maybe>; + /** All values not starting with the given string. */ + nominatorStash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + nominatorStash_starts_with?: Maybe; + session?: Maybe; + stakedAmount?: Maybe; + /** All values containing the given string. */ + stakedAmount_contains?: Maybe; + /** All values ending with the given string. */ + stakedAmount_ends_with?: Maybe; + /** All values greater than the given value. */ + stakedAmount_gt?: Maybe; + /** All values greater than or equal the given value. */ + stakedAmount_gte?: Maybe; + /** All values that are contained in given list. */ + stakedAmount_in?: Maybe>; + /** All values less than the given value. */ + stakedAmount_lt?: Maybe; + /** All values less than or equal the given value. */ + stakedAmount_lte?: Maybe; + /** All values that are not equal to given value. */ + stakedAmount_not?: Maybe; + /** All values not containing the given string. */ + stakedAmount_not_contains?: Maybe; + /** All values not ending with the given string. */ + stakedAmount_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + stakedAmount_not_in?: Maybe>; + /** All values not starting with the given string. */ + stakedAmount_not_starts_with?: Maybe; + /** All values starting with the given string. */ + stakedAmount_starts_with?: Maybe; + validatorController?: Maybe; + /** All values containing the given string. */ + validatorController_contains?: Maybe; + /** All values ending with the given string. */ + validatorController_ends_with?: Maybe; + /** All values greater than the given value. */ + validatorController_gt?: Maybe; + /** All values greater than or equal the given value. */ + validatorController_gte?: Maybe; + /** All values that are contained in given list. */ + validatorController_in?: Maybe>; + /** All values less than the given value. */ + validatorController_lt?: Maybe; + /** All values less than or equal the given value. */ + validatorController_lte?: Maybe; + /** All values that are not equal to given value. */ + validatorController_not?: Maybe; + /** All values not containing the given string. */ + validatorController_not_contains?: Maybe; + /** All values not ending with the given string. */ + validatorController_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + validatorController_not_in?: Maybe>; + /** All values not starting with the given string. */ + validatorController_not_starts_with?: Maybe; + /** All values starting with the given string. */ + validatorController_starts_with?: Maybe; + validatorStash?: Maybe; + /** All values containing the given string. */ + validatorStash_contains?: Maybe; + /** All values ending with the given string. */ + validatorStash_ends_with?: Maybe; + /** All values greater than the given value. */ + validatorStash_gt?: Maybe; + /** All values greater than or equal the given value. */ + validatorStash_gte?: Maybe; + /** All values that are contained in given list. */ + validatorStash_in?: Maybe>; + /** All values less than the given value. */ + validatorStash_lt?: Maybe; + /** All values less than or equal the given value. */ + validatorStash_lte?: Maybe; + /** All values that are not equal to given value. */ + validatorStash_not?: Maybe; + /** All values not containing the given string. */ + validatorStash_not_contains?: Maybe; + /** All values not ending with the given string. */ + validatorStash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + validatorStash_not_in?: Maybe>; + /** All values not starting with the given string. */ + validatorStash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + validatorStash_starts_with?: Maybe; }; -export type EraWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - eraStartSessionIndex?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - index?: Maybe, - index_gt?: Maybe, - index_gte?: Maybe, - index_in?: Maybe>, - index_lt?: Maybe, - index_lte?: Maybe, - index_not?: Maybe, - index_not_in?: Maybe>, - totalPoints?: Maybe, - totalPoints_contains?: Maybe, - totalPoints_ends_with?: Maybe, - totalPoints_gt?: Maybe, - totalPoints_gte?: Maybe, - totalPoints_in?: Maybe>, - totalPoints_lt?: Maybe, - totalPoints_lte?: Maybe, - totalPoints_not?: Maybe, - totalPoints_not_contains?: Maybe, - totalPoints_not_ends_with?: Maybe, - totalPoints_not_in?: Maybe>, - totalPoints_not_starts_with?: Maybe, - totalPoints_starts_with?: Maybe, +export type NominationWhereUniqueInput = { + id?: Maybe; }; -export type EraWhereUniqueInput = { - id?: Maybe, - index?: Maybe, +export type NotificationPreferences = { + __typename?: 'NotificationPreferences'; + newProposal?: Maybe; + ownProposal?: Maybe; + postCreated?: Maybe; + postParticipated?: Maybe; }; -export type HeartBeat = Node & { - __typename?: 'HeartBeat', - authorityId: Scalars['String'], - id: Scalars['ID'], - sessionIndex: Session, +export type NotificationPreferencesInput = { + newProposal?: Maybe; + ownProposal?: Maybe; + postCreated?: Maybe; + postParticipated?: Maybe; }; -export type HeartBeatConnection = { - __typename?: 'HeartBeatConnection', - aggregate: AggregateHeartBeat, - edges: Array>, - pageInfo: PageInfo, +export type OfflineValidator = Node & { + __typename?: 'OfflineValidator'; + id: Scalars['ID']; + others: Array; + own: Scalars['String']; + sessionIndex: Session; + total: Scalars['String']; + validatorId: Scalars['String']; }; -export type HeartBeatCreateInput = { - authorityId: Scalars['String'], - id?: Maybe, - sessionIndex: SessionCreateOneInput, +/** A connection to a list of items. */ +export type OfflineValidatorConnection = { + __typename?: 'OfflineValidatorConnection'; + aggregate: AggregateOfflineValidator; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type HeartBeatEdge = { - __typename?: 'HeartBeatEdge', - cursor: Scalars['String'], - node: HeartBeat, +/** An edge in a connection. */ +export type OfflineValidatorEdge = { + __typename?: 'OfflineValidatorEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: OfflineValidator; }; -export enum HeartBeatOrderByInput { - AuthorityIdAsc = 'authorityId_ASC', - AuthorityIdDesc = 'authorityId_DESC', +export enum OfflineValidatorOrderByInput { IdAsc = 'id_ASC', - IdDesc = 'id_DESC' + IdDesc = 'id_DESC', + OwnAsc = 'own_ASC', + OwnDesc = 'own_DESC', + TotalAsc = 'total_ASC', + TotalDesc = 'total_DESC', + ValidatorIdAsc = 'validatorId_ASC', + ValidatorIdDesc = 'validatorId_DESC' } -export type HeartBeatPreviousValues = { - __typename?: 'HeartBeatPreviousValues', - authorityId: Scalars['String'], - id: Scalars['ID'], +export type OfflineValidatorPreviousValues = { + __typename?: 'OfflineValidatorPreviousValues'; + id: Scalars['ID']; + others: Array; + own: Scalars['String']; + total: Scalars['String']; + validatorId: Scalars['String']; }; -export type HeartBeatSubscriptionPayload = { - __typename?: 'HeartBeatSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, +export type OfflineValidatorSubscriptionPayload = { + __typename?: 'OfflineValidatorSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type HeartBeatSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +export type OfflineValidatorSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type HeartBeatUpdateInput = { - authorityId?: Maybe, - sessionIndex?: Maybe, +export type OfflineValidatorWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + own?: Maybe; + /** All values containing the given string. */ + own_contains?: Maybe; + /** All values ending with the given string. */ + own_ends_with?: Maybe; + /** All values greater than the given value. */ + own_gt?: Maybe; + /** All values greater than or equal the given value. */ + own_gte?: Maybe; + /** All values that are contained in given list. */ + own_in?: Maybe>; + /** All values less than the given value. */ + own_lt?: Maybe; + /** All values less than or equal the given value. */ + own_lte?: Maybe; + /** All values that are not equal to given value. */ + own_not?: Maybe; + /** All values not containing the given string. */ + own_not_contains?: Maybe; + /** All values not ending with the given string. */ + own_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + own_not_in?: Maybe>; + /** All values not starting with the given string. */ + own_not_starts_with?: Maybe; + /** All values starting with the given string. */ + own_starts_with?: Maybe; + sessionIndex?: Maybe; + total?: Maybe; + /** All values containing the given string. */ + total_contains?: Maybe; + /** All values ending with the given string. */ + total_ends_with?: Maybe; + /** All values greater than the given value. */ + total_gt?: Maybe; + /** All values greater than or equal the given value. */ + total_gte?: Maybe; + /** All values that are contained in given list. */ + total_in?: Maybe>; + /** All values less than the given value. */ + total_lt?: Maybe; + /** All values less than or equal the given value. */ + total_lte?: Maybe; + /** All values that are not equal to given value. */ + total_not?: Maybe; + /** All values not containing the given string. */ + total_not_contains?: Maybe; + /** All values not ending with the given string. */ + total_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + total_not_in?: Maybe>; + /** All values not starting with the given string. */ + total_not_starts_with?: Maybe; + /** All values starting with the given string. */ + total_starts_with?: Maybe; + validatorId?: Maybe; + /** All values containing the given string. */ + validatorId_contains?: Maybe; + /** All values ending with the given string. */ + validatorId_ends_with?: Maybe; + /** All values greater than the given value. */ + validatorId_gt?: Maybe; + /** All values greater than or equal the given value. */ + validatorId_gte?: Maybe; + /** All values that are contained in given list. */ + validatorId_in?: Maybe>; + /** All values less than the given value. */ + validatorId_lt?: Maybe; + /** All values less than or equal the given value. */ + validatorId_lte?: Maybe; + /** All values that are not equal to given value. */ + validatorId_not?: Maybe; + /** All values not containing the given string. */ + validatorId_not_contains?: Maybe; + /** All values not ending with the given string. */ + validatorId_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + validatorId_not_in?: Maybe>; + /** All values not starting with the given string. */ + validatorId_not_starts_with?: Maybe; + /** All values starting with the given string. */ + validatorId_starts_with?: Maybe; }; -export type HeartBeatUpdateManyMutationInput = { - authorityId?: Maybe, +export type OfflineValidatorWhereUniqueInput = { + id?: Maybe; }; -export type HeartBeatWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - authorityId?: Maybe, - authorityId_contains?: Maybe, - authorityId_ends_with?: Maybe, - authorityId_gt?: Maybe, - authorityId_gte?: Maybe, - authorityId_in?: Maybe>, - authorityId_lt?: Maybe, - authorityId_lte?: Maybe, - authorityId_not?: Maybe, - authorityId_not_contains?: Maybe, - authorityId_not_ends_with?: Maybe, - authorityId_not_in?: Maybe>, - authorityId_not_starts_with?: Maybe, - authorityId_starts_with?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - sessionIndex?: Maybe, +/** Information about pagination in a connection. */ +export type PageInfo = { + __typename?: 'PageInfo'; + /** When paginating forwards, the cursor to continue. */ + endCursor?: Maybe; + /** When paginating forwards, are there more items? */ + hasNextPage: Scalars['Boolean']; + /** When paginating backwards, are there more items? */ + hasPreviousPage: Scalars['Boolean']; + /** When paginating backwards, the cursor to continue. */ + startCursor?: Maybe; }; -export type HeartBeatWhereUniqueInput = { - id?: Maybe, +export type Preimage = Node & { + __typename?: 'Preimage'; + author: Scalars['String']; + depositAmount: Scalars['String']; + hash: Scalars['String']; + id: Scalars['ID']; + metaDescription: Scalars['String']; + method: Scalars['String']; + motion?: Maybe; + preimageArguments?: Maybe>; + preimageStatus?: Maybe>; + proposal?: Maybe; + referendum?: Maybe; + section: Scalars['String']; }; -export type Int_Comparison_Exp = { - _eq?: Maybe, - _gt?: Maybe, - _gte?: Maybe, - _in?: Maybe>, - _is_null?: Maybe, - _lt?: Maybe, - _lte?: Maybe, - _neq?: Maybe, - _nin?: Maybe>, + +export type PreimagePreimageArgumentsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type LoginResponse = { - __typename?: 'LoginResponse', - token?: Maybe, +export type PreimagePreimageStatusArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; +export type PreimageArgument = Node & { + __typename?: 'PreimageArgument'; + id: Scalars['ID']; + name: Scalars['String']; + preimage: Preimage; + value: Scalars['String']; +}; -export type Message = { - __typename?: 'Message', - message?: Maybe, +/** A connection to a list of items. */ +export type PreimageArgumentConnection = { + __typename?: 'PreimageArgumentConnection'; + aggregate: AggregatePreimageArgument; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type Motion = { - __typename?: 'Motion', - author: Scalars['String'], - id: Scalars['Int'], - memberCount: Scalars['Int'], - metaDescription: Scalars['String'], - method: Scalars['String'], - motionProposalArguments?: Maybe>, - motionProposalHash: Scalars['String'], - motionProposalId: Scalars['Int'], - motionStatus?: Maybe>, - preimage?: Maybe, - preimageHash?: Maybe, - section: Scalars['String'], - treasurySpendProposal?: Maybe, +/** An edge in a connection. */ +export type PreimageArgumentEdge = { + __typename?: 'PreimageArgumentEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: PreimageArgument; }; +export enum PreimageArgumentOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + NameAsc = 'name_ASC', + NameDesc = 'name_DESC', + ValueAsc = 'value_ASC', + ValueDesc = 'value_DESC' +} -export type MotionMotionProposalArgumentsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +export type PreimageArgumentPreviousValues = { + __typename?: 'PreimageArgumentPreviousValues'; + id: Scalars['ID']; + name: Scalars['String']; + value: Scalars['String']; }; +export type PreimageArgumentSubscriptionPayload = { + __typename?: 'PreimageArgumentSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; +}; -export type MotionMotionStatusArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +export type PreimageArgumentSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type MotionConnection = { - __typename?: 'MotionConnection', - aggregate: AggregateMotion, - edges: Array>, - pageInfo: PageInfo, -}; - -export type MotionCreateInput = { - author: Scalars['String'], - memberCount: Scalars['Int'], - metaDescription: Scalars['String'], - method: Scalars['String'], - motionProposalArguments?: Maybe, - motionProposalHash: Scalars['String'], - motionProposalId: Scalars['Int'], - motionStatus?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - section: Scalars['String'], - treasurySpendProposal?: Maybe, -}; - -export type MotionCreateOneWithoutMotionProposalArgumentsInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type MotionCreateOneWithoutMotionStatusInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type MotionCreateOneWithoutPreimageInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type MotionCreateOneWithoutTreasurySpendProposalInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type MotionCreateWithoutMotionProposalArgumentsInput = { - author: Scalars['String'], - memberCount: Scalars['Int'], - metaDescription: Scalars['String'], - method: Scalars['String'], - motionProposalHash: Scalars['String'], - motionProposalId: Scalars['Int'], - motionStatus?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - section: Scalars['String'], - treasurySpendProposal?: Maybe, -}; - -export type MotionCreateWithoutMotionStatusInput = { - author: Scalars['String'], - memberCount: Scalars['Int'], - metaDescription: Scalars['String'], - method: Scalars['String'], - motionProposalArguments?: Maybe, - motionProposalHash: Scalars['String'], - motionProposalId: Scalars['Int'], - preimage?: Maybe, - preimageHash?: Maybe, - section: Scalars['String'], - treasurySpendProposal?: Maybe, -}; - -export type MotionCreateWithoutPreimageInput = { - author: Scalars['String'], - memberCount: Scalars['Int'], - metaDescription: Scalars['String'], - method: Scalars['String'], - motionProposalArguments?: Maybe, - motionProposalHash: Scalars['String'], - motionProposalId: Scalars['Int'], - motionStatus?: Maybe, - preimageHash?: Maybe, - section: Scalars['String'], - treasurySpendProposal?: Maybe, -}; - -export type MotionCreateWithoutTreasurySpendProposalInput = { - author: Scalars['String'], - memberCount: Scalars['Int'], - metaDescription: Scalars['String'], - method: Scalars['String'], - motionProposalArguments?: Maybe, - motionProposalHash: Scalars['String'], - motionProposalId: Scalars['Int'], - motionStatus?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - section: Scalars['String'], +export type PreimageArgumentWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + name?: Maybe; + /** All values containing the given string. */ + name_contains?: Maybe; + /** All values ending with the given string. */ + name_ends_with?: Maybe; + /** All values greater than the given value. */ + name_gt?: Maybe; + /** All values greater than or equal the given value. */ + name_gte?: Maybe; + /** All values that are contained in given list. */ + name_in?: Maybe>; + /** All values less than the given value. */ + name_lt?: Maybe; + /** All values less than or equal the given value. */ + name_lte?: Maybe; + /** All values that are not equal to given value. */ + name_not?: Maybe; + /** All values not containing the given string. */ + name_not_contains?: Maybe; + /** All values not ending with the given string. */ + name_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + name_not_in?: Maybe>; + /** All values not starting with the given string. */ + name_not_starts_with?: Maybe; + /** All values starting with the given string. */ + name_starts_with?: Maybe; + preimage?: Maybe; + value?: Maybe; + /** All values containing the given string. */ + value_contains?: Maybe; + /** All values ending with the given string. */ + value_ends_with?: Maybe; + /** All values greater than the given value. */ + value_gt?: Maybe; + /** All values greater than or equal the given value. */ + value_gte?: Maybe; + /** All values that are contained in given list. */ + value_in?: Maybe>; + /** All values less than the given value. */ + value_lt?: Maybe; + /** All values less than or equal the given value. */ + value_lte?: Maybe; + /** All values that are not equal to given value. */ + value_not?: Maybe; + /** All values not containing the given string. */ + value_not_contains?: Maybe; + /** All values not ending with the given string. */ + value_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + value_not_in?: Maybe>; + /** All values not starting with the given string. */ + value_not_starts_with?: Maybe; + /** All values starting with the given string. */ + value_starts_with?: Maybe; }; -export type MotionEdge = { - __typename?: 'MotionEdge', - cursor: Scalars['String'], - node: Motion, +export type PreimageArgumentWhereUniqueInput = { + id?: Maybe; }; -export enum MotionOrderByInput { +/** A connection to a list of items. */ +export type PreimageConnection = { + __typename?: 'PreimageConnection'; + aggregate: AggregatePreimage; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type PreimageEdge = { + __typename?: 'PreimageEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Preimage; +}; + +export enum PreimageOrderByInput { AuthorAsc = 'author_ASC', AuthorDesc = 'author_DESC', + DepositAmountAsc = 'depositAmount_ASC', + DepositAmountDesc = 'depositAmount_DESC', + HashAsc = 'hash_ASC', + HashDesc = 'hash_DESC', IdAsc = 'id_ASC', IdDesc = 'id_DESC', - MemberCountAsc = 'memberCount_ASC', - MemberCountDesc = 'memberCount_DESC', MetaDescriptionAsc = 'metaDescription_ASC', MetaDescriptionDesc = 'metaDescription_DESC', MethodAsc = 'method_ASC', MethodDesc = 'method_DESC', - MotionProposalHashAsc = 'motionProposalHash_ASC', - MotionProposalHashDesc = 'motionProposalHash_DESC', - MotionProposalIdAsc = 'motionProposalId_ASC', - MotionProposalIdDesc = 'motionProposalId_DESC', - PreimageHashAsc = 'preimageHash_ASC', - PreimageHashDesc = 'preimageHash_DESC', SectionAsc = 'section_ASC', SectionDesc = 'section_DESC' } -export type MotionPreviousValues = { - __typename?: 'MotionPreviousValues', - author: Scalars['String'], - id: Scalars['Int'], - memberCount: Scalars['Int'], - metaDescription: Scalars['String'], - method: Scalars['String'], - motionProposalHash: Scalars['String'], - motionProposalId: Scalars['Int'], - preimageHash?: Maybe, - section: Scalars['String'], -}; - -export type MotionProposalArgument = Node & { - __typename?: 'MotionProposalArgument', - id: Scalars['ID'], - motion: Motion, - name: Scalars['String'], - value: Scalars['String'], -}; - -export type MotionProposalArgumentConnection = { - __typename?: 'MotionProposalArgumentConnection', - aggregate: AggregateMotionProposalArgument, - edges: Array>, - pageInfo: PageInfo, -}; - -export type MotionProposalArgumentCreateInput = { - id?: Maybe, - motion: MotionCreateOneWithoutMotionProposalArgumentsInput, - name: Scalars['String'], - value: Scalars['String'], +export type PreimagePreviousValues = { + __typename?: 'PreimagePreviousValues'; + author: Scalars['String']; + depositAmount: Scalars['String']; + hash: Scalars['String']; + id: Scalars['ID']; + metaDescription: Scalars['String']; + method: Scalars['String']; + section: Scalars['String']; }; -export type MotionProposalArgumentCreateManyWithoutMotionInput = { - connect?: Maybe>, - create?: Maybe>, +export type PreimageStatus = Node & { + __typename?: 'PreimageStatus'; + blockNumber: BlockNumber; + id: Scalars['ID']; + preimage: Preimage; + status: Scalars['String']; }; -export type MotionProposalArgumentCreateWithoutMotionInput = { - id?: Maybe, - name: Scalars['String'], - value: Scalars['String'], +/** A connection to a list of items. */ +export type PreimageStatusConnection = { + __typename?: 'PreimageStatusConnection'; + aggregate: AggregatePreimageStatus; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type MotionProposalArgumentEdge = { - __typename?: 'MotionProposalArgumentEdge', - cursor: Scalars['String'], - node: MotionProposalArgument, +/** An edge in a connection. */ +export type PreimageStatusEdge = { + __typename?: 'PreimageStatusEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: PreimageStatus; }; -export enum MotionProposalArgumentOrderByInput { +export enum PreimageStatusOrderByInput { IdAsc = 'id_ASC', IdDesc = 'id_DESC', - NameAsc = 'name_ASC', - NameDesc = 'name_DESC', - ValueAsc = 'value_ASC', - ValueDesc = 'value_DESC' + StatusAsc = 'status_ASC', + StatusDesc = 'status_DESC' } -export type MotionProposalArgumentPreviousValues = { - __typename?: 'MotionProposalArgumentPreviousValues', - id: Scalars['ID'], - name: Scalars['String'], - value: Scalars['String'], -}; - -export type MotionProposalArgumentScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - name?: Maybe, - name_contains?: Maybe, - name_ends_with?: Maybe, - name_gt?: Maybe, - name_gte?: Maybe, - name_in?: Maybe>, - name_lt?: Maybe, - name_lte?: Maybe, - name_not?: Maybe, - name_not_contains?: Maybe, - name_not_ends_with?: Maybe, - name_not_in?: Maybe>, - name_not_starts_with?: Maybe, - name_starts_with?: Maybe, - value?: Maybe, - value_contains?: Maybe, - value_ends_with?: Maybe, - value_gt?: Maybe, - value_gte?: Maybe, - value_in?: Maybe>, - value_lt?: Maybe, - value_lte?: Maybe, - value_not?: Maybe, - value_not_contains?: Maybe, - value_not_ends_with?: Maybe, - value_not_in?: Maybe>, - value_not_starts_with?: Maybe, - value_starts_with?: Maybe, -}; - -export type MotionProposalArgumentSubscriptionPayload = { - __typename?: 'MotionProposalArgumentSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, +export type PreimageStatusPreviousValues = { + __typename?: 'PreimageStatusPreviousValues'; + id: Scalars['ID']; + status: Scalars['String']; }; -export type MotionProposalArgumentSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +export type PreimageStatusSubscriptionPayload = { + __typename?: 'PreimageStatusSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type MotionProposalArgumentUpdateInput = { - motion?: Maybe, - name?: Maybe, - value?: Maybe, +export type PreimageStatusSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type MotionProposalArgumentUpdateManyDataInput = { - name?: Maybe, - value?: Maybe, +export type PreimageStatusWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + preimage?: Maybe; + status?: Maybe; + /** All values containing the given string. */ + status_contains?: Maybe; + /** All values ending with the given string. */ + status_ends_with?: Maybe; + /** All values greater than the given value. */ + status_gt?: Maybe; + /** All values greater than or equal the given value. */ + status_gte?: Maybe; + /** All values that are contained in given list. */ + status_in?: Maybe>; + /** All values less than the given value. */ + status_lt?: Maybe; + /** All values less than or equal the given value. */ + status_lte?: Maybe; + /** All values that are not equal to given value. */ + status_not?: Maybe; + /** All values not containing the given string. */ + status_not_contains?: Maybe; + /** All values not ending with the given string. */ + status_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + status_not_in?: Maybe>; + /** All values not starting with the given string. */ + status_not_starts_with?: Maybe; + /** All values starting with the given string. */ + status_starts_with?: Maybe; }; -export type MotionProposalArgumentUpdateManyMutationInput = { - name?: Maybe, - value?: Maybe, +export type PreimageStatusWhereUniqueInput = { + id?: Maybe; }; -export type MotionProposalArgumentUpdateManyWithoutMotionInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - updateMany?: Maybe>, - upsert?: Maybe>, +export type PreimageSubscriptionPayload = { + __typename?: 'PreimageSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type MotionProposalArgumentUpdateManyWithWhereNestedInput = { - data: MotionProposalArgumentUpdateManyDataInput, - where: MotionProposalArgumentScalarWhereInput, +export type PreimageSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type MotionProposalArgumentUpdateWithoutMotionDataInput = { - name?: Maybe, - value?: Maybe, +export type PreimageWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + author?: Maybe; + /** All values containing the given string. */ + author_contains?: Maybe; + /** All values ending with the given string. */ + author_ends_with?: Maybe; + /** All values greater than the given value. */ + author_gt?: Maybe; + /** All values greater than or equal the given value. */ + author_gte?: Maybe; + /** All values that are contained in given list. */ + author_in?: Maybe>; + /** All values less than the given value. */ + author_lt?: Maybe; + /** All values less than or equal the given value. */ + author_lte?: Maybe; + /** All values that are not equal to given value. */ + author_not?: Maybe; + /** All values not containing the given string. */ + author_not_contains?: Maybe; + /** All values not ending with the given string. */ + author_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + author_not_in?: Maybe>; + /** All values not starting with the given string. */ + author_not_starts_with?: Maybe; + /** All values starting with the given string. */ + author_starts_with?: Maybe; + depositAmount?: Maybe; + /** All values containing the given string. */ + depositAmount_contains?: Maybe; + /** All values ending with the given string. */ + depositAmount_ends_with?: Maybe; + /** All values greater than the given value. */ + depositAmount_gt?: Maybe; + /** All values greater than or equal the given value. */ + depositAmount_gte?: Maybe; + /** All values that are contained in given list. */ + depositAmount_in?: Maybe>; + /** All values less than the given value. */ + depositAmount_lt?: Maybe; + /** All values less than or equal the given value. */ + depositAmount_lte?: Maybe; + /** All values that are not equal to given value. */ + depositAmount_not?: Maybe; + /** All values not containing the given string. */ + depositAmount_not_contains?: Maybe; + /** All values not ending with the given string. */ + depositAmount_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + depositAmount_not_in?: Maybe>; + /** All values not starting with the given string. */ + depositAmount_not_starts_with?: Maybe; + /** All values starting with the given string. */ + depositAmount_starts_with?: Maybe; + hash?: Maybe; + /** All values containing the given string. */ + hash_contains?: Maybe; + /** All values ending with the given string. */ + hash_ends_with?: Maybe; + /** All values greater than the given value. */ + hash_gt?: Maybe; + /** All values greater than or equal the given value. */ + hash_gte?: Maybe; + /** All values that are contained in given list. */ + hash_in?: Maybe>; + /** All values less than the given value. */ + hash_lt?: Maybe; + /** All values less than or equal the given value. */ + hash_lte?: Maybe; + /** All values that are not equal to given value. */ + hash_not?: Maybe; + /** All values not containing the given string. */ + hash_not_contains?: Maybe; + /** All values not ending with the given string. */ + hash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + hash_not_in?: Maybe>; + /** All values not starting with the given string. */ + hash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + hash_starts_with?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + metaDescription?: Maybe; + /** All values containing the given string. */ + metaDescription_contains?: Maybe; + /** All values ending with the given string. */ + metaDescription_ends_with?: Maybe; + /** All values greater than the given value. */ + metaDescription_gt?: Maybe; + /** All values greater than or equal the given value. */ + metaDescription_gte?: Maybe; + /** All values that are contained in given list. */ + metaDescription_in?: Maybe>; + /** All values less than the given value. */ + metaDescription_lt?: Maybe; + /** All values less than or equal the given value. */ + metaDescription_lte?: Maybe; + /** All values that are not equal to given value. */ + metaDescription_not?: Maybe; + /** All values not containing the given string. */ + metaDescription_not_contains?: Maybe; + /** All values not ending with the given string. */ + metaDescription_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + metaDescription_not_in?: Maybe>; + /** All values not starting with the given string. */ + metaDescription_not_starts_with?: Maybe; + /** All values starting with the given string. */ + metaDescription_starts_with?: Maybe; + method?: Maybe; + /** All values containing the given string. */ + method_contains?: Maybe; + /** All values ending with the given string. */ + method_ends_with?: Maybe; + /** All values greater than the given value. */ + method_gt?: Maybe; + /** All values greater than or equal the given value. */ + method_gte?: Maybe; + /** All values that are contained in given list. */ + method_in?: Maybe>; + /** All values less than the given value. */ + method_lt?: Maybe; + /** All values less than or equal the given value. */ + method_lte?: Maybe; + /** All values that are not equal to given value. */ + method_not?: Maybe; + /** All values not containing the given string. */ + method_not_contains?: Maybe; + /** All values not ending with the given string. */ + method_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + method_not_in?: Maybe>; + /** All values not starting with the given string. */ + method_not_starts_with?: Maybe; + /** All values starting with the given string. */ + method_starts_with?: Maybe; + motion?: Maybe; + preimageArguments_every?: Maybe; + preimageArguments_none?: Maybe; + preimageArguments_some?: Maybe; + preimageStatus_every?: Maybe; + preimageStatus_none?: Maybe; + preimageStatus_some?: Maybe; + proposal?: Maybe; + referendum?: Maybe; + section?: Maybe; + /** All values containing the given string. */ + section_contains?: Maybe; + /** All values ending with the given string. */ + section_ends_with?: Maybe; + /** All values greater than the given value. */ + section_gt?: Maybe; + /** All values greater than or equal the given value. */ + section_gte?: Maybe; + /** All values that are contained in given list. */ + section_in?: Maybe>; + /** All values less than the given value. */ + section_lt?: Maybe; + /** All values less than or equal the given value. */ + section_lte?: Maybe; + /** All values that are not equal to given value. */ + section_not?: Maybe; + /** All values not containing the given string. */ + section_not_contains?: Maybe; + /** All values not ending with the given string. */ + section_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + section_not_in?: Maybe>; + /** All values not starting with the given string. */ + section_not_starts_with?: Maybe; + /** All values starting with the given string. */ + section_starts_with?: Maybe; }; -export type MotionProposalArgumentUpdateWithWhereUniqueWithoutMotionInput = { - data: MotionProposalArgumentUpdateWithoutMotionDataInput, - where: MotionProposalArgumentWhereUniqueInput, +export type PreimageWhereUniqueInput = { + id?: Maybe; }; -export type MotionProposalArgumentUpsertWithWhereUniqueWithoutMotionInput = { - create: MotionProposalArgumentCreateWithoutMotionInput, - update: MotionProposalArgumentUpdateWithoutMotionDataInput, - where: MotionProposalArgumentWhereUniqueInput, +export type Proposal = { + __typename?: 'Proposal'; + author: Scalars['String']; + depositAmount: Scalars['String']; + id: Scalars['Int']; + preimage?: Maybe; + preimageHash: Scalars['String']; + proposalId: Scalars['Int']; + proposalStatus?: Maybe>; }; -export type MotionProposalArgumentWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - motion?: Maybe, - name?: Maybe, - name_contains?: Maybe, - name_ends_with?: Maybe, - name_gt?: Maybe, - name_gte?: Maybe, - name_in?: Maybe>, - name_lt?: Maybe, - name_lte?: Maybe, - name_not?: Maybe, - name_not_contains?: Maybe, - name_not_ends_with?: Maybe, - name_not_in?: Maybe>, - name_not_starts_with?: Maybe, - name_starts_with?: Maybe, - value?: Maybe, - value_contains?: Maybe, - value_ends_with?: Maybe, - value_gt?: Maybe, - value_gte?: Maybe, - value_in?: Maybe>, - value_lt?: Maybe, - value_lte?: Maybe, - value_not?: Maybe, - value_not_contains?: Maybe, - value_not_ends_with?: Maybe, - value_not_in?: Maybe>, - value_not_starts_with?: Maybe, - value_starts_with?: Maybe, -}; -export type MotionProposalArgumentWhereUniqueInput = { - id?: Maybe, +export type ProposalProposalStatusArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type MotionStatus = Node & { - __typename?: 'MotionStatus', - blockNumber: BlockNumber, - id: Scalars['ID'], - motion: Motion, - status: Scalars['String'], - uniqueStatus: Scalars['String'], +/** A connection to a list of items. */ +export type ProposalConnection = { + __typename?: 'ProposalConnection'; + aggregate: AggregateProposal; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type MotionStatusConnection = { - __typename?: 'MotionStatusConnection', - aggregate: AggregateMotionStatus, - edges: Array>, - pageInfo: PageInfo, +/** An edge in a connection. */ +export type ProposalEdge = { + __typename?: 'ProposalEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Proposal; }; -export type MotionStatusCreateInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - motion: MotionCreateOneWithoutMotionStatusInput, - status: Scalars['String'], - uniqueStatus: Scalars['String'], +export enum ProposalOrderByInput { + AuthorAsc = 'author_ASC', + AuthorDesc = 'author_DESC', + DepositAmountAsc = 'depositAmount_ASC', + DepositAmountDesc = 'depositAmount_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + PreimageHashAsc = 'preimageHash_ASC', + PreimageHashDesc = 'preimageHash_DESC', + ProposalIdAsc = 'proposalId_ASC', + ProposalIdDesc = 'proposalId_DESC' +} + +export type ProposalPreviousValues = { + __typename?: 'ProposalPreviousValues'; + author: Scalars['String']; + depositAmount: Scalars['String']; + id: Scalars['Int']; + preimageHash: Scalars['String']; + proposalId: Scalars['Int']; }; -export type MotionStatusCreateManyWithoutMotionInput = { - connect?: Maybe>, - create?: Maybe>, +export type ProposalStatus = Node & { + __typename?: 'ProposalStatus'; + blockNumber: BlockNumber; + id: Scalars['ID']; + proposal: Proposal; + status: Scalars['String']; + uniqueStatus: Scalars['String']; }; -export type MotionStatusCreateWithoutMotionInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - status: Scalars['String'], - uniqueStatus: Scalars['String'], +/** A connection to a list of items. */ +export type ProposalStatusConnection = { + __typename?: 'ProposalStatusConnection'; + aggregate: AggregateProposalStatus; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; -export type MotionStatusEdge = { - __typename?: 'MotionStatusEdge', - cursor: Scalars['String'], - node: MotionStatus, +/** An edge in a connection. */ +export type ProposalStatusEdge = { + __typename?: 'ProposalStatusEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: ProposalStatus; }; -export enum MotionStatusOrderByInput { +export enum ProposalStatusOrderByInput { IdAsc = 'id_ASC', IdDesc = 'id_DESC', StatusAsc = 'status_ASC', @@ -2151,9777 +3412,8000 @@ export enum MotionStatusOrderByInput { UniqueStatusDesc = 'uniqueStatus_DESC' } -export type MotionStatusPreviousValues = { - __typename?: 'MotionStatusPreviousValues', - id: Scalars['ID'], - status: Scalars['String'], - uniqueStatus: Scalars['String'], -}; - -export type MotionStatusScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, - uniqueStatus?: Maybe, - uniqueStatus_contains?: Maybe, - uniqueStatus_ends_with?: Maybe, - uniqueStatus_gt?: Maybe, - uniqueStatus_gte?: Maybe, - uniqueStatus_in?: Maybe>, - uniqueStatus_lt?: Maybe, - uniqueStatus_lte?: Maybe, - uniqueStatus_not?: Maybe, - uniqueStatus_not_contains?: Maybe, - uniqueStatus_not_ends_with?: Maybe, - uniqueStatus_not_in?: Maybe>, - uniqueStatus_not_starts_with?: Maybe, - uniqueStatus_starts_with?: Maybe, +export type ProposalStatusPreviousValues = { + __typename?: 'ProposalStatusPreviousValues'; + id: Scalars['ID']; + status: Scalars['String']; + uniqueStatus: Scalars['String']; }; -export type MotionStatusSubscriptionPayload = { - __typename?: 'MotionStatusSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, +export type ProposalStatusSubscriptionPayload = { + __typename?: 'ProposalStatusSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type MotionStatusSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +export type ProposalStatusSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type MotionStatusUpdateInput = { - blockNumber?: Maybe, - motion?: Maybe, - status?: Maybe, - uniqueStatus?: Maybe, +export type ProposalStatusWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + proposal?: Maybe; + status?: Maybe; + /** All values containing the given string. */ + status_contains?: Maybe; + /** All values ending with the given string. */ + status_ends_with?: Maybe; + /** All values greater than the given value. */ + status_gt?: Maybe; + /** All values greater than or equal the given value. */ + status_gte?: Maybe; + /** All values that are contained in given list. */ + status_in?: Maybe>; + /** All values less than the given value. */ + status_lt?: Maybe; + /** All values less than or equal the given value. */ + status_lte?: Maybe; + /** All values that are not equal to given value. */ + status_not?: Maybe; + /** All values not containing the given string. */ + status_not_contains?: Maybe; + /** All values not ending with the given string. */ + status_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + status_not_in?: Maybe>; + /** All values not starting with the given string. */ + status_not_starts_with?: Maybe; + /** All values starting with the given string. */ + status_starts_with?: Maybe; + uniqueStatus?: Maybe; + /** All values containing the given string. */ + uniqueStatus_contains?: Maybe; + /** All values ending with the given string. */ + uniqueStatus_ends_with?: Maybe; + /** All values greater than the given value. */ + uniqueStatus_gt?: Maybe; + /** All values greater than or equal the given value. */ + uniqueStatus_gte?: Maybe; + /** All values that are contained in given list. */ + uniqueStatus_in?: Maybe>; + /** All values less than the given value. */ + uniqueStatus_lt?: Maybe; + /** All values less than or equal the given value. */ + uniqueStatus_lte?: Maybe; + /** All values that are not equal to given value. */ + uniqueStatus_not?: Maybe; + /** All values not containing the given string. */ + uniqueStatus_not_contains?: Maybe; + /** All values not ending with the given string. */ + uniqueStatus_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + uniqueStatus_not_in?: Maybe>; + /** All values not starting with the given string. */ + uniqueStatus_not_starts_with?: Maybe; + /** All values starting with the given string. */ + uniqueStatus_starts_with?: Maybe; }; -export type MotionStatusUpdateManyDataInput = { - status?: Maybe, - uniqueStatus?: Maybe, +export type ProposalStatusWhereUniqueInput = { + id?: Maybe; + uniqueStatus?: Maybe; }; -export type MotionStatusUpdateManyMutationInput = { - status?: Maybe, - uniqueStatus?: Maybe, +export type ProposalSubscriptionPayload = { + __typename?: 'ProposalSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; -export type MotionStatusUpdateManyWithoutMotionInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - updateMany?: Maybe>, - upsert?: Maybe>, +export type ProposalSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; -export type MotionStatusUpdateManyWithWhereNestedInput = { - data: MotionStatusUpdateManyDataInput, - where: MotionStatusScalarWhereInput, +export type ProposalWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + author?: Maybe; + /** All values containing the given string. */ + author_contains?: Maybe; + /** All values ending with the given string. */ + author_ends_with?: Maybe; + /** All values greater than the given value. */ + author_gt?: Maybe; + /** All values greater than or equal the given value. */ + author_gte?: Maybe; + /** All values that are contained in given list. */ + author_in?: Maybe>; + /** All values less than the given value. */ + author_lt?: Maybe; + /** All values less than or equal the given value. */ + author_lte?: Maybe; + /** All values that are not equal to given value. */ + author_not?: Maybe; + /** All values not containing the given string. */ + author_not_contains?: Maybe; + /** All values not ending with the given string. */ + author_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + author_not_in?: Maybe>; + /** All values not starting with the given string. */ + author_not_starts_with?: Maybe; + /** All values starting with the given string. */ + author_starts_with?: Maybe; + depositAmount?: Maybe; + /** All values containing the given string. */ + depositAmount_contains?: Maybe; + /** All values ending with the given string. */ + depositAmount_ends_with?: Maybe; + /** All values greater than the given value. */ + depositAmount_gt?: Maybe; + /** All values greater than or equal the given value. */ + depositAmount_gte?: Maybe; + /** All values that are contained in given list. */ + depositAmount_in?: Maybe>; + /** All values less than the given value. */ + depositAmount_lt?: Maybe; + /** All values less than or equal the given value. */ + depositAmount_lte?: Maybe; + /** All values that are not equal to given value. */ + depositAmount_not?: Maybe; + /** All values not containing the given string. */ + depositAmount_not_contains?: Maybe; + /** All values not ending with the given string. */ + depositAmount_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + depositAmount_not_in?: Maybe>; + /** All values not starting with the given string. */ + depositAmount_not_starts_with?: Maybe; + /** All values starting with the given string. */ + depositAmount_starts_with?: Maybe; + id?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + preimage?: Maybe; + preimageHash?: Maybe; + /** All values containing the given string. */ + preimageHash_contains?: Maybe; + /** All values ending with the given string. */ + preimageHash_ends_with?: Maybe; + /** All values greater than the given value. */ + preimageHash_gt?: Maybe; + /** All values greater than or equal the given value. */ + preimageHash_gte?: Maybe; + /** All values that are contained in given list. */ + preimageHash_in?: Maybe>; + /** All values less than the given value. */ + preimageHash_lt?: Maybe; + /** All values less than or equal the given value. */ + preimageHash_lte?: Maybe; + /** All values that are not equal to given value. */ + preimageHash_not?: Maybe; + /** All values not containing the given string. */ + preimageHash_not_contains?: Maybe; + /** All values not ending with the given string. */ + preimageHash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + preimageHash_not_in?: Maybe>; + /** All values not starting with the given string. */ + preimageHash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + preimageHash_starts_with?: Maybe; + proposalId?: Maybe; + /** All values greater than the given value. */ + proposalId_gt?: Maybe; + /** All values greater than or equal the given value. */ + proposalId_gte?: Maybe; + /** All values that are contained in given list. */ + proposalId_in?: Maybe>; + /** All values less than the given value. */ + proposalId_lt?: Maybe; + /** All values less than or equal the given value. */ + proposalId_lte?: Maybe; + /** All values that are not equal to given value. */ + proposalId_not?: Maybe; + /** All values that are not contained in given list. */ + proposalId_not_in?: Maybe>; + proposalStatus_every?: Maybe; + proposalStatus_none?: Maybe; + proposalStatus_some?: Maybe; }; -export type MotionStatusUpdateWithoutMotionDataInput = { - blockNumber?: Maybe, - status?: Maybe, - uniqueStatus?: Maybe, +export type ProposalWhereInput_Remote_Rel_Public_Onchain_Linksonchain_Proposal = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + author?: Maybe; + /** All values containing the given string. */ + author_contains?: Maybe; + /** All values ending with the given string. */ + author_ends_with?: Maybe; + /** All values greater than the given value. */ + author_gt?: Maybe; + /** All values greater than or equal the given value. */ + author_gte?: Maybe; + /** All values that are contained in given list. */ + author_in?: Maybe>; + /** All values less than the given value. */ + author_lt?: Maybe; + /** All values less than or equal the given value. */ + author_lte?: Maybe; + /** All values that are not equal to given value. */ + author_not?: Maybe; + /** All values not containing the given string. */ + author_not_contains?: Maybe; + /** All values not ending with the given string. */ + author_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + author_not_in?: Maybe>; + /** All values not starting with the given string. */ + author_not_starts_with?: Maybe; + /** All values starting with the given string. */ + author_starts_with?: Maybe; + depositAmount?: Maybe; + /** All values containing the given string. */ + depositAmount_contains?: Maybe; + /** All values ending with the given string. */ + depositAmount_ends_with?: Maybe; + /** All values greater than the given value. */ + depositAmount_gt?: Maybe; + /** All values greater than or equal the given value. */ + depositAmount_gte?: Maybe; + /** All values that are contained in given list. */ + depositAmount_in?: Maybe>; + /** All values less than the given value. */ + depositAmount_lt?: Maybe; + /** All values less than or equal the given value. */ + depositAmount_lte?: Maybe; + /** All values that are not equal to given value. */ + depositAmount_not?: Maybe; + /** All values not containing the given string. */ + depositAmount_not_contains?: Maybe; + /** All values not ending with the given string. */ + depositAmount_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + depositAmount_not_in?: Maybe>; + /** All values not starting with the given string. */ + depositAmount_not_starts_with?: Maybe; + /** All values starting with the given string. */ + depositAmount_starts_with?: Maybe; + id?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + preimage?: Maybe; + preimageHash?: Maybe; + /** All values containing the given string. */ + preimageHash_contains?: Maybe; + /** All values ending with the given string. */ + preimageHash_ends_with?: Maybe; + /** All values greater than the given value. */ + preimageHash_gt?: Maybe; + /** All values greater than or equal the given value. */ + preimageHash_gte?: Maybe; + /** All values that are contained in given list. */ + preimageHash_in?: Maybe>; + /** All values less than the given value. */ + preimageHash_lt?: Maybe; + /** All values less than or equal the given value. */ + preimageHash_lte?: Maybe; + /** All values that are not equal to given value. */ + preimageHash_not?: Maybe; + /** All values not containing the given string. */ + preimageHash_not_contains?: Maybe; + /** All values not ending with the given string. */ + preimageHash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + preimageHash_not_in?: Maybe>; + /** All values not starting with the given string. */ + preimageHash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + preimageHash_starts_with?: Maybe; + /** All values greater than the given value. */ + proposalId_gt?: Maybe; + /** All values greater than or equal the given value. */ + proposalId_gte?: Maybe; + /** All values that are contained in given list. */ + proposalId_in?: Maybe>; + /** All values less than the given value. */ + proposalId_lt?: Maybe; + /** All values less than or equal the given value. */ + proposalId_lte?: Maybe; + /** All values that are not equal to given value. */ + proposalId_not?: Maybe; + /** All values that are not contained in given list. */ + proposalId_not_in?: Maybe>; + proposalStatus_every?: Maybe; + proposalStatus_none?: Maybe; + proposalStatus_some?: Maybe; }; -export type MotionStatusUpdateWithWhereUniqueWithoutMotionInput = { - data: MotionStatusUpdateWithoutMotionDataInput, - where: MotionStatusWhereUniqueInput, +export type ProposalWhereUniqueInput = { + id?: Maybe; + proposalId?: Maybe; }; -export type MotionStatusUpsertWithWhereUniqueWithoutMotionInput = { - create: MotionStatusCreateWithoutMotionInput, - update: MotionStatusUpdateWithoutMotionDataInput, - where: MotionStatusWhereUniqueInput, +export type PublicUser = { + __typename?: 'PublicUser'; + id?: Maybe; + username?: Maybe; }; -export type MotionStatusWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - motion?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, - uniqueStatus?: Maybe, - uniqueStatus_contains?: Maybe, - uniqueStatus_ends_with?: Maybe, - uniqueStatus_gt?: Maybe, - uniqueStatus_gte?: Maybe, - uniqueStatus_in?: Maybe>, - uniqueStatus_lt?: Maybe, - uniqueStatus_lte?: Maybe, - uniqueStatus_not?: Maybe, - uniqueStatus_not_contains?: Maybe, - uniqueStatus_not_ends_with?: Maybe, - uniqueStatus_not_in?: Maybe>, - uniqueStatus_not_starts_with?: Maybe, - uniqueStatus_starts_with?: Maybe, +export type Query = { + __typename?: 'Query'; + subscription?: Maybe; + token?: Maybe; + user?: Maybe; }; -export type MotionStatusWhereUniqueInput = { - id?: Maybe, - uniqueStatus?: Maybe, -}; -export type MotionSubscriptionPayload = { - __typename?: 'MotionSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, +export type QuerySubscriptionArgs = { + post_id: Scalars['Int']; }; -export type MotionSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type MotionUpdateInput = { - author?: Maybe, - memberCount?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motionProposalArguments?: Maybe, - motionProposalHash?: Maybe, - motionProposalId?: Maybe, - motionStatus?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - section?: Maybe, - treasurySpendProposal?: Maybe, -}; - -export type MotionUpdateManyMutationInput = { - author?: Maybe, - memberCount?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motionProposalHash?: Maybe, - motionProposalId?: Maybe, - preimageHash?: Maybe, - section?: Maybe, -}; - -export type MotionUpdateOneRequiredWithoutMotionProposalArgumentsInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type MotionUpdateOneRequiredWithoutMotionStatusInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type MotionUpdateOneWithoutPreimageInput = { - connect?: Maybe, - create?: Maybe, - delete?: Maybe, - disconnect?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type MotionUpdateOneWithoutTreasurySpendProposalInput = { - connect?: Maybe, - create?: Maybe, - delete?: Maybe, - disconnect?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type MotionUpdateWithoutMotionProposalArgumentsDataInput = { - author?: Maybe, - memberCount?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motionProposalHash?: Maybe, - motionProposalId?: Maybe, - motionStatus?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - section?: Maybe, - treasurySpendProposal?: Maybe, -}; - -export type MotionUpdateWithoutMotionStatusDataInput = { - author?: Maybe, - memberCount?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motionProposalArguments?: Maybe, - motionProposalHash?: Maybe, - motionProposalId?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - section?: Maybe, - treasurySpendProposal?: Maybe, -}; - -export type MotionUpdateWithoutPreimageDataInput = { - author?: Maybe, - memberCount?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motionProposalArguments?: Maybe, - motionProposalHash?: Maybe, - motionProposalId?: Maybe, - motionStatus?: Maybe, - preimageHash?: Maybe, - section?: Maybe, - treasurySpendProposal?: Maybe, -}; - -export type MotionUpdateWithoutTreasurySpendProposalDataInput = { - author?: Maybe, - memberCount?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motionProposalArguments?: Maybe, - motionProposalHash?: Maybe, - motionProposalId?: Maybe, - motionStatus?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - section?: Maybe, -}; - -export type MotionUpsertWithoutMotionProposalArgumentsInput = { - create: MotionCreateWithoutMotionProposalArgumentsInput, - update: MotionUpdateWithoutMotionProposalArgumentsDataInput, -}; - -export type MotionUpsertWithoutMotionStatusInput = { - create: MotionCreateWithoutMotionStatusInput, - update: MotionUpdateWithoutMotionStatusDataInput, -}; - -export type MotionUpsertWithoutPreimageInput = { - create: MotionCreateWithoutPreimageInput, - update: MotionUpdateWithoutPreimageDataInput, -}; - -export type MotionUpsertWithoutTreasurySpendProposalInput = { - create: MotionCreateWithoutTreasurySpendProposalInput, - update: MotionUpdateWithoutTreasurySpendProposalDataInput, -}; -export type MotionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - author?: Maybe, - author_contains?: Maybe, - author_ends_with?: Maybe, - author_gt?: Maybe, - author_gte?: Maybe, - author_in?: Maybe>, - author_lt?: Maybe, - author_lte?: Maybe, - author_not?: Maybe, - author_not_contains?: Maybe, - author_not_ends_with?: Maybe, - author_not_in?: Maybe>, - author_not_starts_with?: Maybe, - author_starts_with?: Maybe, - id?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_in?: Maybe>, - memberCount?: Maybe, - memberCount_gt?: Maybe, - memberCount_gte?: Maybe, - memberCount_in?: Maybe>, - memberCount_lt?: Maybe, - memberCount_lte?: Maybe, - memberCount_not?: Maybe, - memberCount_not_in?: Maybe>, - metaDescription?: Maybe, - metaDescription_contains?: Maybe, - metaDescription_ends_with?: Maybe, - metaDescription_gt?: Maybe, - metaDescription_gte?: Maybe, - metaDescription_in?: Maybe>, - metaDescription_lt?: Maybe, - metaDescription_lte?: Maybe, - metaDescription_not?: Maybe, - metaDescription_not_contains?: Maybe, - metaDescription_not_ends_with?: Maybe, - metaDescription_not_in?: Maybe>, - metaDescription_not_starts_with?: Maybe, - metaDescription_starts_with?: Maybe, - method?: Maybe, - method_contains?: Maybe, - method_ends_with?: Maybe, - method_gt?: Maybe, - method_gte?: Maybe, - method_in?: Maybe>, - method_lt?: Maybe, - method_lte?: Maybe, - method_not?: Maybe, - method_not_contains?: Maybe, - method_not_ends_with?: Maybe, - method_not_in?: Maybe>, - method_not_starts_with?: Maybe, - method_starts_with?: Maybe, - motionProposalArguments_every?: Maybe, - motionProposalArguments_none?: Maybe, - motionProposalArguments_some?: Maybe, - motionProposalHash?: Maybe, - motionProposalHash_contains?: Maybe, - motionProposalHash_ends_with?: Maybe, - motionProposalHash_gt?: Maybe, - motionProposalHash_gte?: Maybe, - motionProposalHash_in?: Maybe>, - motionProposalHash_lt?: Maybe, - motionProposalHash_lte?: Maybe, - motionProposalHash_not?: Maybe, - motionProposalHash_not_contains?: Maybe, - motionProposalHash_not_ends_with?: Maybe, - motionProposalHash_not_in?: Maybe>, - motionProposalHash_not_starts_with?: Maybe, - motionProposalHash_starts_with?: Maybe, - motionProposalId?: Maybe, - motionProposalId_gt?: Maybe, - motionProposalId_gte?: Maybe, - motionProposalId_in?: Maybe>, - motionProposalId_lt?: Maybe, - motionProposalId_lte?: Maybe, - motionProposalId_not?: Maybe, - motionProposalId_not_in?: Maybe>, - motionStatus_every?: Maybe, - motionStatus_none?: Maybe, - motionStatus_some?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - preimageHash_contains?: Maybe, - preimageHash_ends_with?: Maybe, - preimageHash_gt?: Maybe, - preimageHash_gte?: Maybe, - preimageHash_in?: Maybe>, - preimageHash_lt?: Maybe, - preimageHash_lte?: Maybe, - preimageHash_not?: Maybe, - preimageHash_not_contains?: Maybe, - preimageHash_not_ends_with?: Maybe, - preimageHash_not_in?: Maybe>, - preimageHash_not_starts_with?: Maybe, - preimageHash_starts_with?: Maybe, - section?: Maybe, - section_contains?: Maybe, - section_ends_with?: Maybe, - section_gt?: Maybe, - section_gte?: Maybe, - section_in?: Maybe>, - section_lt?: Maybe, - section_lte?: Maybe, - section_not?: Maybe, - section_not_contains?: Maybe, - section_not_ends_with?: Maybe, - section_not_in?: Maybe>, - section_not_starts_with?: Maybe, - section_starts_with?: Maybe, - treasurySpendProposal?: Maybe, +export type QueryUserArgs = { + id: Scalars['Int']; }; -export type MotionWhereInput_Remote_Rel_Public_Onchain_Linksonchain_Motion = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - author?: Maybe, - author_contains?: Maybe, - author_ends_with?: Maybe, - author_gt?: Maybe, - author_gte?: Maybe, - author_in?: Maybe>, - author_lt?: Maybe, - author_lte?: Maybe, - author_not?: Maybe, - author_not_contains?: Maybe, - author_not_ends_with?: Maybe, - author_not_in?: Maybe>, - author_not_starts_with?: Maybe, - author_starts_with?: Maybe, - id?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_in?: Maybe>, - memberCount?: Maybe, - memberCount_gt?: Maybe, - memberCount_gte?: Maybe, - memberCount_in?: Maybe>, - memberCount_lt?: Maybe, - memberCount_lte?: Maybe, - memberCount_not?: Maybe, - memberCount_not_in?: Maybe>, - metaDescription?: Maybe, - metaDescription_contains?: Maybe, - metaDescription_ends_with?: Maybe, - metaDescription_gt?: Maybe, - metaDescription_gte?: Maybe, - metaDescription_in?: Maybe>, - metaDescription_lt?: Maybe, - metaDescription_lte?: Maybe, - metaDescription_not?: Maybe, - metaDescription_not_contains?: Maybe, - metaDescription_not_ends_with?: Maybe, - metaDescription_not_in?: Maybe>, - metaDescription_not_starts_with?: Maybe, - metaDescription_starts_with?: Maybe, - method?: Maybe, - method_contains?: Maybe, - method_ends_with?: Maybe, - method_gt?: Maybe, - method_gte?: Maybe, - method_in?: Maybe>, - method_lt?: Maybe, - method_lte?: Maybe, - method_not?: Maybe, - method_not_contains?: Maybe, - method_not_ends_with?: Maybe, - method_not_in?: Maybe>, - method_not_starts_with?: Maybe, - method_starts_with?: Maybe, - motionProposalArguments_every?: Maybe, - motionProposalArguments_none?: Maybe, - motionProposalArguments_some?: Maybe, - motionProposalHash?: Maybe, - motionProposalHash_contains?: Maybe, - motionProposalHash_ends_with?: Maybe, - motionProposalHash_gt?: Maybe, - motionProposalHash_gte?: Maybe, - motionProposalHash_in?: Maybe>, - motionProposalHash_lt?: Maybe, - motionProposalHash_lte?: Maybe, - motionProposalHash_not?: Maybe, - motionProposalHash_not_contains?: Maybe, - motionProposalHash_not_ends_with?: Maybe, - motionProposalHash_not_in?: Maybe>, - motionProposalHash_not_starts_with?: Maybe, - motionProposalHash_starts_with?: Maybe, - motionProposalId_gt?: Maybe, - motionProposalId_gte?: Maybe, - motionProposalId_in?: Maybe>, - motionProposalId_lt?: Maybe, - motionProposalId_lte?: Maybe, - motionProposalId_not?: Maybe, - motionProposalId_not_in?: Maybe>, - motionStatus_every?: Maybe, - motionStatus_none?: Maybe, - motionStatus_some?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - preimageHash_contains?: Maybe, - preimageHash_ends_with?: Maybe, - preimageHash_gt?: Maybe, - preimageHash_gte?: Maybe, - preimageHash_in?: Maybe>, - preimageHash_lt?: Maybe, - preimageHash_lte?: Maybe, - preimageHash_not?: Maybe, - preimageHash_not_contains?: Maybe, - preimageHash_not_ends_with?: Maybe, - preimageHash_not_in?: Maybe>, - preimageHash_not_starts_with?: Maybe, - preimageHash_starts_with?: Maybe, - section?: Maybe, - section_contains?: Maybe, - section_ends_with?: Maybe, - section_gt?: Maybe, - section_gte?: Maybe, - section_in?: Maybe>, - section_lt?: Maybe, - section_lte?: Maybe, - section_not?: Maybe, - section_not_contains?: Maybe, - section_not_ends_with?: Maybe, - section_not_in?: Maybe>, - section_not_starts_with?: Maybe, - section_starts_with?: Maybe, - treasurySpendProposal?: Maybe, +export type Referendum = { + __typename?: 'Referendum'; + delay: Scalars['Int']; + end: Scalars['Int']; + id: Scalars['Int']; + preimage?: Maybe; + preimageHash: Scalars['String']; + referendumId: Scalars['Int']; + referendumStatus?: Maybe>; + voteThreshold: Scalars['String']; }; -export type MotionWhereUniqueInput = { - id?: Maybe, - motionProposalId?: Maybe, -}; -export type Mutation = { - __typename?: 'Mutation', - addressLinkConfirm?: Maybe, - addressLinkStart?: Maybe, - addressLogin?: Maybe, - addressLoginStart?: Maybe, - addressSignupConfirm?: Maybe, - addressSignupStart?: Maybe, - addressUnlink?: Maybe, - changeEmail?: Maybe, - changeNotificationPreference?: Maybe, - changePassword?: Maybe, - changeUsername?: Maybe, - login?: Maybe, - logout?: Maybe, - postSubscribe?: Maybe, - postUnsubscribe?: Maybe, - reportContent?: Maybe, - requestResetPassword?: Maybe, - resendVerifyEmailToken?: Maybe, - resetPassword?: Maybe, - setCredentialsConfirm?: Maybe, - setCredentialsStart?: Maybe, - setDefaultAddress?: Maybe, - signup?: Maybe, - undoEmailChange?: Maybe, - verifyEmail?: Maybe, +export type ReferendumReferendumStatusArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; - -export type MutationAddressLinkConfirmArgs = { - address_id: Scalars['Int'], - signature: Scalars['String'] +/** A connection to a list of items. */ +export type ReferendumConnection = { + __typename?: 'ReferendumConnection'; + aggregate: AggregateReferendum; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; - -export type MutationAddressLinkStartArgs = { - address: Scalars['String'], - network: Scalars['String'] +/** An edge in a connection. */ +export type ReferendumEdge = { + __typename?: 'ReferendumEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Referendum; }; +export enum ReferendumOrderByInput { + DelayAsc = 'delay_ASC', + DelayDesc = 'delay_DESC', + EndAsc = 'end_ASC', + EndDesc = 'end_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + PreimageHashAsc = 'preimageHash_ASC', + PreimageHashDesc = 'preimageHash_DESC', + ReferendumIdAsc = 'referendumId_ASC', + ReferendumIdDesc = 'referendumId_DESC', + VoteThresholdAsc = 'voteThreshold_ASC', + VoteThresholdDesc = 'voteThreshold_DESC' +} -export type MutationAddressLoginArgs = { - address: Scalars['String'], - signature: Scalars['String'] +export type ReferendumPreviousValues = { + __typename?: 'ReferendumPreviousValues'; + delay: Scalars['Int']; + end: Scalars['Int']; + id: Scalars['Int']; + preimageHash: Scalars['String']; + referendumId: Scalars['Int']; + voteThreshold: Scalars['String']; }; - -export type MutationAddressLoginStartArgs = { - address: Scalars['String'] +export type ReferendumStatus = Node & { + __typename?: 'ReferendumStatus'; + blockNumber: BlockNumber; + id: Scalars['ID']; + referendum: Referendum; + status: Scalars['String']; + uniqueStatus: Scalars['String']; }; - -export type MutationAddressSignupConfirmArgs = { - address: Scalars['String'], - network: Scalars['String'], - signature: Scalars['String'] +/** A connection to a list of items. */ +export type ReferendumStatusConnection = { + __typename?: 'ReferendumStatusConnection'; + aggregate: AggregateReferendumStatus; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; - -export type MutationAddressSignupStartArgs = { - address: Scalars['String'] +/** An edge in a connection. */ +export type ReferendumStatusEdge = { + __typename?: 'ReferendumStatusEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: ReferendumStatus; }; +export enum ReferendumStatusOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + StatusAsc = 'status_ASC', + StatusDesc = 'status_DESC', + UniqueStatusAsc = 'uniqueStatus_ASC', + UniqueStatusDesc = 'uniqueStatus_DESC' +} -export type MutationAddressUnlinkArgs = { - address: Scalars['String'] +export type ReferendumStatusPreviousValues = { + __typename?: 'ReferendumStatusPreviousValues'; + id: Scalars['ID']; + status: Scalars['String']; + uniqueStatus: Scalars['String']; }; - -export type MutationChangeEmailArgs = { - email: Scalars['String'], - password: Scalars['String'] +export type ReferendumStatusSubscriptionPayload = { + __typename?: 'ReferendumStatusSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; - -export type MutationChangeNotificationPreferenceArgs = { - notificationPreferences?: Maybe +export type ReferendumStatusSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; - -export type MutationChangePasswordArgs = { - newPassword: Scalars['String'], - oldPassword: Scalars['String'] +export type ReferendumStatusWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + referendum?: Maybe; + status?: Maybe; + /** All values containing the given string. */ + status_contains?: Maybe; + /** All values ending with the given string. */ + status_ends_with?: Maybe; + /** All values greater than the given value. */ + status_gt?: Maybe; + /** All values greater than or equal the given value. */ + status_gte?: Maybe; + /** All values that are contained in given list. */ + status_in?: Maybe>; + /** All values less than the given value. */ + status_lt?: Maybe; + /** All values less than or equal the given value. */ + status_lte?: Maybe; + /** All values that are not equal to given value. */ + status_not?: Maybe; + /** All values not containing the given string. */ + status_not_contains?: Maybe; + /** All values not ending with the given string. */ + status_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + status_not_in?: Maybe>; + /** All values not starting with the given string. */ + status_not_starts_with?: Maybe; + /** All values starting with the given string. */ + status_starts_with?: Maybe; + uniqueStatus?: Maybe; + /** All values containing the given string. */ + uniqueStatus_contains?: Maybe; + /** All values ending with the given string. */ + uniqueStatus_ends_with?: Maybe; + /** All values greater than the given value. */ + uniqueStatus_gt?: Maybe; + /** All values greater than or equal the given value. */ + uniqueStatus_gte?: Maybe; + /** All values that are contained in given list. */ + uniqueStatus_in?: Maybe>; + /** All values less than the given value. */ + uniqueStatus_lt?: Maybe; + /** All values less than or equal the given value. */ + uniqueStatus_lte?: Maybe; + /** All values that are not equal to given value. */ + uniqueStatus_not?: Maybe; + /** All values not containing the given string. */ + uniqueStatus_not_contains?: Maybe; + /** All values not ending with the given string. */ + uniqueStatus_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + uniqueStatus_not_in?: Maybe>; + /** All values not starting with the given string. */ + uniqueStatus_not_starts_with?: Maybe; + /** All values starting with the given string. */ + uniqueStatus_starts_with?: Maybe; }; - -export type MutationChangeUsernameArgs = { - password: Scalars['String'], - username: Scalars['String'] +export type ReferendumStatusWhereUniqueInput = { + id?: Maybe; + uniqueStatus?: Maybe; }; - -export type MutationLoginArgs = { - password: Scalars['String'], - username: Scalars['String'] +export type ReferendumSubscriptionPayload = { + __typename?: 'ReferendumSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; - -export type MutationPostSubscribeArgs = { - post_id: Scalars['Int'] +export type ReferendumSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; - -export type MutationPostUnsubscribeArgs = { - post_id: Scalars['Int'] +export type ReferendumWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + delay?: Maybe; + /** All values greater than the given value. */ + delay_gt?: Maybe; + /** All values greater than or equal the given value. */ + delay_gte?: Maybe; + /** All values that are contained in given list. */ + delay_in?: Maybe>; + /** All values less than the given value. */ + delay_lt?: Maybe; + /** All values less than or equal the given value. */ + delay_lte?: Maybe; + /** All values that are not equal to given value. */ + delay_not?: Maybe; + /** All values that are not contained in given list. */ + delay_not_in?: Maybe>; + end?: Maybe; + /** All values greater than the given value. */ + end_gt?: Maybe; + /** All values greater than or equal the given value. */ + end_gte?: Maybe; + /** All values that are contained in given list. */ + end_in?: Maybe>; + /** All values less than the given value. */ + end_lt?: Maybe; + /** All values less than or equal the given value. */ + end_lte?: Maybe; + /** All values that are not equal to given value. */ + end_not?: Maybe; + /** All values that are not contained in given list. */ + end_not_in?: Maybe>; + id?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + preimage?: Maybe; + preimageHash?: Maybe; + /** All values containing the given string. */ + preimageHash_contains?: Maybe; + /** All values ending with the given string. */ + preimageHash_ends_with?: Maybe; + /** All values greater than the given value. */ + preimageHash_gt?: Maybe; + /** All values greater than or equal the given value. */ + preimageHash_gte?: Maybe; + /** All values that are contained in given list. */ + preimageHash_in?: Maybe>; + /** All values less than the given value. */ + preimageHash_lt?: Maybe; + /** All values less than or equal the given value. */ + preimageHash_lte?: Maybe; + /** All values that are not equal to given value. */ + preimageHash_not?: Maybe; + /** All values not containing the given string. */ + preimageHash_not_contains?: Maybe; + /** All values not ending with the given string. */ + preimageHash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + preimageHash_not_in?: Maybe>; + /** All values not starting with the given string. */ + preimageHash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + preimageHash_starts_with?: Maybe; + referendumId?: Maybe; + /** All values greater than the given value. */ + referendumId_gt?: Maybe; + /** All values greater than or equal the given value. */ + referendumId_gte?: Maybe; + /** All values that are contained in given list. */ + referendumId_in?: Maybe>; + /** All values less than the given value. */ + referendumId_lt?: Maybe; + /** All values less than or equal the given value. */ + referendumId_lte?: Maybe; + /** All values that are not equal to given value. */ + referendumId_not?: Maybe; + /** All values that are not contained in given list. */ + referendumId_not_in?: Maybe>; + referendumStatus_every?: Maybe; + referendumStatus_none?: Maybe; + referendumStatus_some?: Maybe; + voteThreshold?: Maybe; + /** All values containing the given string. */ + voteThreshold_contains?: Maybe; + /** All values ending with the given string. */ + voteThreshold_ends_with?: Maybe; + /** All values greater than the given value. */ + voteThreshold_gt?: Maybe; + /** All values greater than or equal the given value. */ + voteThreshold_gte?: Maybe; + /** All values that are contained in given list. */ + voteThreshold_in?: Maybe>; + /** All values less than the given value. */ + voteThreshold_lt?: Maybe; + /** All values less than or equal the given value. */ + voteThreshold_lte?: Maybe; + /** All values that are not equal to given value. */ + voteThreshold_not?: Maybe; + /** All values not containing the given string. */ + voteThreshold_not_contains?: Maybe; + /** All values not ending with the given string. */ + voteThreshold_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + voteThreshold_not_in?: Maybe>; + /** All values not starting with the given string. */ + voteThreshold_not_starts_with?: Maybe; + /** All values starting with the given string. */ + voteThreshold_starts_with?: Maybe; }; - -export type MutationReportContentArgs = { - comments?: Maybe, - content_id: Scalars['String'], - network: Scalars['String'], - reason: Scalars['String'], - type: Scalars['String'] +export type ReferendumWhereInput_Remote_Rel_Public_Onchain_Linksonchain_Referendum = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + delay?: Maybe; + /** All values greater than the given value. */ + delay_gt?: Maybe; + /** All values greater than or equal the given value. */ + delay_gte?: Maybe; + /** All values that are contained in given list. */ + delay_in?: Maybe>; + /** All values less than the given value. */ + delay_lt?: Maybe; + /** All values less than or equal the given value. */ + delay_lte?: Maybe; + /** All values that are not equal to given value. */ + delay_not?: Maybe; + /** All values that are not contained in given list. */ + delay_not_in?: Maybe>; + end?: Maybe; + /** All values greater than the given value. */ + end_gt?: Maybe; + /** All values greater than or equal the given value. */ + end_gte?: Maybe; + /** All values that are contained in given list. */ + end_in?: Maybe>; + /** All values less than the given value. */ + end_lt?: Maybe; + /** All values less than or equal the given value. */ + end_lte?: Maybe; + /** All values that are not equal to given value. */ + end_not?: Maybe; + /** All values that are not contained in given list. */ + end_not_in?: Maybe>; + id?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + preimage?: Maybe; + preimageHash?: Maybe; + /** All values containing the given string. */ + preimageHash_contains?: Maybe; + /** All values ending with the given string. */ + preimageHash_ends_with?: Maybe; + /** All values greater than the given value. */ + preimageHash_gt?: Maybe; + /** All values greater than or equal the given value. */ + preimageHash_gte?: Maybe; + /** All values that are contained in given list. */ + preimageHash_in?: Maybe>; + /** All values less than the given value. */ + preimageHash_lt?: Maybe; + /** All values less than or equal the given value. */ + preimageHash_lte?: Maybe; + /** All values that are not equal to given value. */ + preimageHash_not?: Maybe; + /** All values not containing the given string. */ + preimageHash_not_contains?: Maybe; + /** All values not ending with the given string. */ + preimageHash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + preimageHash_not_in?: Maybe>; + /** All values not starting with the given string. */ + preimageHash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + preimageHash_starts_with?: Maybe; + /** All values greater than the given value. */ + referendumId_gt?: Maybe; + /** All values greater than or equal the given value. */ + referendumId_gte?: Maybe; + /** All values that are contained in given list. */ + referendumId_in?: Maybe>; + /** All values less than the given value. */ + referendumId_lt?: Maybe; + /** All values less than or equal the given value. */ + referendumId_lte?: Maybe; + /** All values that are not equal to given value. */ + referendumId_not?: Maybe; + /** All values that are not contained in given list. */ + referendumId_not_in?: Maybe>; + referendumStatus_every?: Maybe; + referendumStatus_none?: Maybe; + referendumStatus_some?: Maybe; + voteThreshold?: Maybe; + /** All values containing the given string. */ + voteThreshold_contains?: Maybe; + /** All values ending with the given string. */ + voteThreshold_ends_with?: Maybe; + /** All values greater than the given value. */ + voteThreshold_gt?: Maybe; + /** All values greater than or equal the given value. */ + voteThreshold_gte?: Maybe; + /** All values that are contained in given list. */ + voteThreshold_in?: Maybe>; + /** All values less than the given value. */ + voteThreshold_lt?: Maybe; + /** All values less than or equal the given value. */ + voteThreshold_lte?: Maybe; + /** All values that are not equal to given value. */ + voteThreshold_not?: Maybe; + /** All values not containing the given string. */ + voteThreshold_not_contains?: Maybe; + /** All values not ending with the given string. */ + voteThreshold_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + voteThreshold_not_in?: Maybe>; + /** All values not starting with the given string. */ + voteThreshold_not_starts_with?: Maybe; + /** All values starting with the given string. */ + voteThreshold_starts_with?: Maybe; }; - -export type MutationRequestResetPasswordArgs = { - email: Scalars['String'] +export type ReferendumWhereUniqueInput = { + id?: Maybe; + referendumId?: Maybe; }; - -export type MutationResetPasswordArgs = { - newPassword: Scalars['String'], - token: Scalars['String'], - userId: Scalars['Int'] +export type Reward = Node & { + __typename?: 'Reward'; + authoredBlock: BlockNumber; + id: Scalars['ID']; + sessionIndex: Session; + treasuryReward: Scalars['String']; + validatorReward: Scalars['String']; }; - -export type MutationSetCredentialsConfirmArgs = { - address: Scalars['String'], - email?: Maybe, - password: Scalars['String'], - signature: Scalars['String'], - username: Scalars['String'] +/** A connection to a list of items. */ +export type RewardConnection = { + __typename?: 'RewardConnection'; + aggregate: AggregateReward; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; - -export type MutationSetCredentialsStartArgs = { - address: Scalars['String'] +/** An edge in a connection. */ +export type RewardEdge = { + __typename?: 'RewardEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Reward; }; +export enum RewardOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + TreasuryRewardAsc = 'treasuryReward_ASC', + TreasuryRewardDesc = 'treasuryReward_DESC', + ValidatorRewardAsc = 'validatorReward_ASC', + ValidatorRewardDesc = 'validatorReward_DESC' +} -export type MutationSetDefaultAddressArgs = { - address: Scalars['String'] +export type RewardPreviousValues = { + __typename?: 'RewardPreviousValues'; + id: Scalars['ID']; + treasuryReward: Scalars['String']; + validatorReward: Scalars['String']; }; - -export type MutationSignupArgs = { - email?: Maybe, - password: Scalars['String'], - username: Scalars['String'] +export type RewardSubscriptionPayload = { + __typename?: 'RewardSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; - -export type MutationUndoEmailChangeArgs = { - token: Scalars['String'] +export type RewardSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; - -export type MutationVerifyEmailArgs = { - token: Scalars['String'] +export type RewardWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + authoredBlock?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + sessionIndex?: Maybe; + treasuryReward?: Maybe; + /** All values containing the given string. */ + treasuryReward_contains?: Maybe; + /** All values ending with the given string. */ + treasuryReward_ends_with?: Maybe; + /** All values greater than the given value. */ + treasuryReward_gt?: Maybe; + /** All values greater than or equal the given value. */ + treasuryReward_gte?: Maybe; + /** All values that are contained in given list. */ + treasuryReward_in?: Maybe>; + /** All values less than the given value. */ + treasuryReward_lt?: Maybe; + /** All values less than or equal the given value. */ + treasuryReward_lte?: Maybe; + /** All values that are not equal to given value. */ + treasuryReward_not?: Maybe; + /** All values not containing the given string. */ + treasuryReward_not_contains?: Maybe; + /** All values not ending with the given string. */ + treasuryReward_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + treasuryReward_not_in?: Maybe>; + /** All values not starting with the given string. */ + treasuryReward_not_starts_with?: Maybe; + /** All values starting with the given string. */ + treasuryReward_starts_with?: Maybe; + validatorReward?: Maybe; + /** All values containing the given string. */ + validatorReward_contains?: Maybe; + /** All values ending with the given string. */ + validatorReward_ends_with?: Maybe; + /** All values greater than the given value. */ + validatorReward_gt?: Maybe; + /** All values greater than or equal the given value. */ + validatorReward_gte?: Maybe; + /** All values that are contained in given list. */ + validatorReward_in?: Maybe>; + /** All values less than the given value. */ + validatorReward_lt?: Maybe; + /** All values less than or equal the given value. */ + validatorReward_lte?: Maybe; + /** All values that are not equal to given value. */ + validatorReward_not?: Maybe; + /** All values not containing the given string. */ + validatorReward_not_contains?: Maybe; + /** All values not ending with the given string. */ + validatorReward_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + validatorReward_not_in?: Maybe>; + /** All values not starting with the given string. */ + validatorReward_not_starts_with?: Maybe; + /** All values starting with the given string. */ + validatorReward_starts_with?: Maybe; }; -export type Mutation_Root = { - __typename?: 'mutation_root', - addressLinkConfirm?: Maybe, - addressLinkStart?: Maybe, - addressLogin?: Maybe, - addressLoginStart?: Maybe, - addressSignupConfirm?: Maybe, - addressSignupStart?: Maybe, - addressUnlink?: Maybe, - changeEmail?: Maybe, - changeNotificationPreference?: Maybe, - changePassword?: Maybe, - changeUsername?: Maybe, - createBlockIndex: BlockIndex, - createBlockNumber: BlockNumber, - createCouncil: Council, - createCouncilMember: CouncilMember, - createEra: Era, - createHeartBeat: HeartBeat, - createMotion: Motion, - createMotionProposalArgument: MotionProposalArgument, - createMotionStatus: MotionStatus, - createNomination: Nomination, - createOfflineValidator: OfflineValidator, - createPreimage: Preimage, - createPreimageArgument: PreimageArgument, - createPreimageStatus: PreimageStatus, - createProposal: Proposal, - createProposalStatus: ProposalStatus, - createReferendum: Referendum, - createReferendumStatus: ReferendumStatus, - createReward: Reward, - createSession: Session, - createSlashing: Slashing, - createStake: Stake, - createTotalIssuance: TotalIssuance, - createTreasurySpendProposal: TreasurySpendProposal, - createTreasuryStatus: TreasuryStatus, - createValidator: Validator, - deleteBlockIndex?: Maybe, - deleteBlockNumber?: Maybe, - deleteCouncil?: Maybe, - deleteCouncilMember?: Maybe, - deleteEra?: Maybe, - deleteHeartBeat?: Maybe, - deleteManyBlockIndexes: BatchPayload, - deleteManyBlockNumbers: BatchPayload, - deleteManyCouncilMembers: BatchPayload, - deleteManyCouncils: BatchPayload, - deleteManyEras: BatchPayload, - deleteManyHeartBeats: BatchPayload, - deleteManyMotionProposalArguments: BatchPayload, - deleteManyMotionStatuses: BatchPayload, - deleteManyMotions: BatchPayload, - deleteManyNominations: BatchPayload, - deleteManyOfflineValidators: BatchPayload, - deleteManyPreimageArguments: BatchPayload, - deleteManyPreimageStatuses: BatchPayload, - deleteManyPreimages: BatchPayload, - deleteManyProposalStatuses: BatchPayload, - deleteManyProposals: BatchPayload, - deleteManyReferendumStatuses: BatchPayload, - deleteManyReferendums: BatchPayload, - deleteManyRewards: BatchPayload, - deleteManySessions: BatchPayload, - deleteManySlashings: BatchPayload, - deleteManyStakes: BatchPayload, - deleteManyTotalIssuances: BatchPayload, - deleteManyTreasurySpendProposals: BatchPayload, - deleteManyTreasuryStatuses: BatchPayload, - deleteManyValidators: BatchPayload, - deleteMotion?: Maybe, - deleteMotionProposalArgument?: Maybe, - deleteMotionStatus?: Maybe, - deleteNomination?: Maybe, - deleteOfflineValidator?: Maybe, - deletePreimage?: Maybe, - deletePreimageArgument?: Maybe, - deletePreimageStatus?: Maybe, - deleteProposal?: Maybe, - deleteProposalStatus?: Maybe, - deleteReferendum?: Maybe, - deleteReferendumStatus?: Maybe, - deleteReward?: Maybe, - deleteSession?: Maybe, - deleteSlashing?: Maybe, - deleteStake?: Maybe, - deleteTotalIssuance?: Maybe, - deleteTreasurySpendProposal?: Maybe, - deleteTreasuryStatus?: Maybe, - deleteValidator?: Maybe, - delete_comment_reactions?: Maybe, - delete_comment_reactions_by_pk?: Maybe, - delete_comments?: Maybe, - delete_comments_by_pk?: Maybe, - delete_onchain_links?: Maybe, - delete_onchain_links_by_pk?: Maybe, - delete_poll?: Maybe, - delete_poll_by_pk?: Maybe, - delete_poll_votes?: Maybe, - delete_poll_votes_by_pk?: Maybe, - delete_post_reactions?: Maybe, - delete_post_reactions_by_pk?: Maybe, - delete_post_topics?: Maybe, - delete_post_topics_by_pk?: Maybe, - delete_post_types?: Maybe, - delete_post_types_by_pk?: Maybe, - delete_posts?: Maybe, - delete_posts_by_pk?: Maybe, - executeRaw: Scalars['Json'], - insert_comment_reactions?: Maybe, - insert_comment_reactions_one?: Maybe, - insert_comments?: Maybe, - insert_comments_one?: Maybe, - insert_onchain_links?: Maybe, - insert_onchain_links_one?: Maybe, - insert_poll?: Maybe, - insert_poll_one?: Maybe, - insert_poll_votes?: Maybe, - insert_poll_votes_one?: Maybe, - insert_post_reactions?: Maybe, - insert_post_reactions_one?: Maybe, - insert_post_topics?: Maybe, - insert_post_topics_one?: Maybe, - insert_post_types?: Maybe, - insert_post_types_one?: Maybe, - insert_posts?: Maybe, - insert_posts_one?: Maybe, - login?: Maybe, - logout?: Maybe, - postSubscribe?: Maybe, - postUnsubscribe?: Maybe, - reportContent?: Maybe, - requestResetPassword?: Maybe, - resendVerifyEmailToken?: Maybe, - resetPassword?: Maybe, - setCredentialsConfirm?: Maybe, - setCredentialsStart?: Maybe, - setDefaultAddress?: Maybe, - signup?: Maybe, - undoEmailChange?: Maybe, - updateBlockIndex?: Maybe, - updateBlockNumber?: Maybe, - updateCouncil?: Maybe, - updateCouncilMember?: Maybe, - updateEra?: Maybe, - updateHeartBeat?: Maybe, - updateManyBlockIndexes: BatchPayload, - updateManyBlockNumbers: BatchPayload, - updateManyCouncilMembers: BatchPayload, - updateManyEras: BatchPayload, - updateManyHeartBeats: BatchPayload, - updateManyMotionProposalArguments: BatchPayload, - updateManyMotionStatuses: BatchPayload, - updateManyMotions: BatchPayload, - updateManyNominations: BatchPayload, - updateManyOfflineValidators: BatchPayload, - updateManyPreimageArguments: BatchPayload, - updateManyPreimageStatuses: BatchPayload, - updateManyPreimages: BatchPayload, - updateManyProposalStatuses: BatchPayload, - updateManyProposals: BatchPayload, - updateManyReferendumStatuses: BatchPayload, - updateManyReferendums: BatchPayload, - updateManyRewards: BatchPayload, - updateManySessions: BatchPayload, - updateManySlashings: BatchPayload, - updateManyStakes: BatchPayload, - updateManyTotalIssuances: BatchPayload, - updateManyTreasurySpendProposals: BatchPayload, - updateManyTreasuryStatuses: BatchPayload, - updateManyValidators: BatchPayload, - updateMotion?: Maybe, - updateMotionProposalArgument?: Maybe, - updateMotionStatus?: Maybe, - updateNomination?: Maybe, - updateOfflineValidator?: Maybe, - updatePreimage?: Maybe, - updatePreimageArgument?: Maybe, - updatePreimageStatus?: Maybe, - updateProposal?: Maybe, - updateProposalStatus?: Maybe, - updateReferendum?: Maybe, - updateReferendumStatus?: Maybe, - updateReward?: Maybe, - updateSession?: Maybe, - updateSlashing?: Maybe, - updateStake?: Maybe, - updateTotalIssuance?: Maybe, - updateTreasurySpendProposal?: Maybe, - updateTreasuryStatus?: Maybe, - updateValidator?: Maybe, - update_comment_reactions?: Maybe, - update_comment_reactions_by_pk?: Maybe, - update_comments?: Maybe, - update_comments_by_pk?: Maybe, - update_onchain_links?: Maybe, - update_onchain_links_by_pk?: Maybe, - update_poll?: Maybe, - update_poll_by_pk?: Maybe, - update_poll_votes?: Maybe, - update_poll_votes_by_pk?: Maybe, - update_post_reactions?: Maybe, - update_post_reactions_by_pk?: Maybe, - update_post_topics?: Maybe, - update_post_topics_by_pk?: Maybe, - update_post_types?: Maybe, - update_post_types_by_pk?: Maybe, - update_posts?: Maybe, - update_posts_by_pk?: Maybe, - upsertBlockIndex: BlockIndex, - upsertBlockNumber: BlockNumber, - upsertCouncil: Council, - upsertCouncilMember: CouncilMember, - upsertEra: Era, - upsertHeartBeat: HeartBeat, - upsertMotion: Motion, - upsertMotionProposalArgument: MotionProposalArgument, - upsertMotionStatus: MotionStatus, - upsertNomination: Nomination, - upsertOfflineValidator: OfflineValidator, - upsertPreimage: Preimage, - upsertPreimageArgument: PreimageArgument, - upsertPreimageStatus: PreimageStatus, - upsertProposal: Proposal, - upsertProposalStatus: ProposalStatus, - upsertReferendum: Referendum, - upsertReferendumStatus: ReferendumStatus, - upsertReward: Reward, - upsertSession: Session, - upsertSlashing: Slashing, - upsertStake: Stake, - upsertTotalIssuance: TotalIssuance, - upsertTreasurySpendProposal: TreasurySpendProposal, - upsertTreasuryStatus: TreasuryStatus, - upsertValidator: Validator, - verifyEmail?: Maybe, +export type RewardWhereUniqueInput = { + id?: Maybe; }; - -export type Mutation_RootAddressLinkConfirmArgs = { - address_id: Scalars['Int'], - signature: Scalars['String'] +export type Session = Node & { + __typename?: 'Session'; + id: Scalars['ID']; + index: Scalars['Int']; + start: BlockNumber; }; - -export type Mutation_RootAddressLinkStartArgs = { - address: Scalars['String'], - network: Scalars['String'] +/** A connection to a list of items. */ +export type SessionConnection = { + __typename?: 'SessionConnection'; + aggregate: AggregateSession; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; - -export type Mutation_RootAddressLoginArgs = { - address: Scalars['String'], - signature: Scalars['String'] +/** An edge in a connection. */ +export type SessionEdge = { + __typename?: 'SessionEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Session; }; +export enum SessionOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + IndexAsc = 'index_ASC', + IndexDesc = 'index_DESC' +} -export type Mutation_RootAddressLoginStartArgs = { - address: Scalars['String'] +export type SessionPreviousValues = { + __typename?: 'SessionPreviousValues'; + id: Scalars['ID']; + index: Scalars['Int']; }; - -export type Mutation_RootAddressSignupConfirmArgs = { - address: Scalars['String'], - network: Scalars['String'], - signature: Scalars['String'] +export type SessionSubscriptionPayload = { + __typename?: 'SessionSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; - -export type Mutation_RootAddressSignupStartArgs = { - address: Scalars['String'] +export type SessionSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; - -export type Mutation_RootAddressUnlinkArgs = { - address: Scalars['String'] +export type SessionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + index?: Maybe; + /** All values greater than the given value. */ + index_gt?: Maybe; + /** All values greater than or equal the given value. */ + index_gte?: Maybe; + /** All values that are contained in given list. */ + index_in?: Maybe>; + /** All values less than the given value. */ + index_lt?: Maybe; + /** All values less than or equal the given value. */ + index_lte?: Maybe; + /** All values that are not equal to given value. */ + index_not?: Maybe; + /** All values that are not contained in given list. */ + index_not_in?: Maybe>; + start?: Maybe; }; - -export type Mutation_RootChangeEmailArgs = { - email: Scalars['String'], - password: Scalars['String'] +export type SessionWhereUniqueInput = { + id?: Maybe; + index?: Maybe; }; - -export type Mutation_RootChangeNotificationPreferenceArgs = { - notificationPreferences?: Maybe +export type Slashing = Node & { + __typename?: 'Slashing'; + amount: Scalars['String']; + blockNumber: BlockNumber; + id: Scalars['ID']; + who: Scalars['String']; }; - -export type Mutation_RootChangePasswordArgs = { - newPassword: Scalars['String'], - oldPassword: Scalars['String'] +/** A connection to a list of items. */ +export type SlashingConnection = { + __typename?: 'SlashingConnection'; + aggregate: AggregateSlashing; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; - -export type Mutation_RootChangeUsernameArgs = { - password: Scalars['String'], - username: Scalars['String'] +/** An edge in a connection. */ +export type SlashingEdge = { + __typename?: 'SlashingEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Slashing; }; +export enum SlashingOrderByInput { + AmountAsc = 'amount_ASC', + AmountDesc = 'amount_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + WhoAsc = 'who_ASC', + WhoDesc = 'who_DESC' +} -export type Mutation_RootCreateBlockIndexArgs = { - data: BlockIndexCreateInput +export type SlashingPreviousValues = { + __typename?: 'SlashingPreviousValues'; + amount: Scalars['String']; + id: Scalars['ID']; + who: Scalars['String']; }; - -export type Mutation_RootCreateBlockNumberArgs = { - data: BlockNumberCreateInput +export type SlashingSubscriptionPayload = { + __typename?: 'SlashingSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; - -export type Mutation_RootCreateCouncilArgs = { - data: CouncilCreateInput +export type SlashingSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; - -export type Mutation_RootCreateCouncilMemberArgs = { - data: CouncilMemberCreateInput +export type SlashingWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + amount?: Maybe; + /** All values containing the given string. */ + amount_contains?: Maybe; + /** All values ending with the given string. */ + amount_ends_with?: Maybe; + /** All values greater than the given value. */ + amount_gt?: Maybe; + /** All values greater than or equal the given value. */ + amount_gte?: Maybe; + /** All values that are contained in given list. */ + amount_in?: Maybe>; + /** All values less than the given value. */ + amount_lt?: Maybe; + /** All values less than or equal the given value. */ + amount_lte?: Maybe; + /** All values that are not equal to given value. */ + amount_not?: Maybe; + /** All values not containing the given string. */ + amount_not_contains?: Maybe; + /** All values not ending with the given string. */ + amount_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + amount_not_in?: Maybe>; + /** All values not starting with the given string. */ + amount_not_starts_with?: Maybe; + /** All values starting with the given string. */ + amount_starts_with?: Maybe; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + who?: Maybe; + /** All values containing the given string. */ + who_contains?: Maybe; + /** All values ending with the given string. */ + who_ends_with?: Maybe; + /** All values greater than the given value. */ + who_gt?: Maybe; + /** All values greater than or equal the given value. */ + who_gte?: Maybe; + /** All values that are contained in given list. */ + who_in?: Maybe>; + /** All values less than the given value. */ + who_lt?: Maybe; + /** All values less than or equal the given value. */ + who_lte?: Maybe; + /** All values that are not equal to given value. */ + who_not?: Maybe; + /** All values not containing the given string. */ + who_not_contains?: Maybe; + /** All values not ending with the given string. */ + who_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + who_not_in?: Maybe>; + /** All values not starting with the given string. */ + who_not_starts_with?: Maybe; + /** All values starting with the given string. */ + who_starts_with?: Maybe; }; - -export type Mutation_RootCreateEraArgs = { - data: EraCreateInput +export type SlashingWhereUniqueInput = { + id?: Maybe; + who?: Maybe; }; - -export type Mutation_RootCreateHeartBeatArgs = { - data: HeartBeatCreateInput +export type Stake = Node & { + __typename?: 'Stake'; + blockNumber: BlockNumber; + id: Scalars['ID']; + totalStake: Scalars['String']; }; - -export type Mutation_RootCreateMotionArgs = { - data: MotionCreateInput +/** A connection to a list of items. */ +export type StakeConnection = { + __typename?: 'StakeConnection'; + aggregate: AggregateStake; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; - -export type Mutation_RootCreateMotionProposalArgumentArgs = { - data: MotionProposalArgumentCreateInput +/** An edge in a connection. */ +export type StakeEdge = { + __typename?: 'StakeEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Stake; }; +export enum StakeOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + TotalStakeAsc = 'totalStake_ASC', + TotalStakeDesc = 'totalStake_DESC' +} -export type Mutation_RootCreateMotionStatusArgs = { - data: MotionStatusCreateInput +export type StakePreviousValues = { + __typename?: 'StakePreviousValues'; + id: Scalars['ID']; + totalStake: Scalars['String']; }; - -export type Mutation_RootCreateNominationArgs = { - data: NominationCreateInput +export type StakeSubscriptionPayload = { + __typename?: 'StakeSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; - -export type Mutation_RootCreateOfflineValidatorArgs = { - data: OfflineValidatorCreateInput +export type StakeSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; - -export type Mutation_RootCreatePreimageArgs = { - data: PreimageCreateInput +export type StakeWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + totalStake?: Maybe; + /** All values containing the given string. */ + totalStake_contains?: Maybe; + /** All values ending with the given string. */ + totalStake_ends_with?: Maybe; + /** All values greater than the given value. */ + totalStake_gt?: Maybe; + /** All values greater than or equal the given value. */ + totalStake_gte?: Maybe; + /** All values that are contained in given list. */ + totalStake_in?: Maybe>; + /** All values less than the given value. */ + totalStake_lt?: Maybe; + /** All values less than or equal the given value. */ + totalStake_lte?: Maybe; + /** All values that are not equal to given value. */ + totalStake_not?: Maybe; + /** All values not containing the given string. */ + totalStake_not_contains?: Maybe; + /** All values not ending with the given string. */ + totalStake_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + totalStake_not_in?: Maybe>; + /** All values not starting with the given string. */ + totalStake_not_starts_with?: Maybe; + /** All values starting with the given string. */ + totalStake_starts_with?: Maybe; }; - -export type Mutation_RootCreatePreimageArgumentArgs = { - data: PreimageArgumentCreateInput +export type StakeWhereUniqueInput = { + id?: Maybe; }; - -export type Mutation_RootCreatePreimageStatusArgs = { - data: PreimageStatusCreateInput +/** expression to compare columns of type String. All fields are combined with logical 'AND'. */ +export type String_Comparison_Exp = { + _eq?: Maybe; + _gt?: Maybe; + _gte?: Maybe; + _ilike?: Maybe; + _in?: Maybe>; + _is_null?: Maybe; + _like?: Maybe; + _lt?: Maybe; + _lte?: Maybe; + _neq?: Maybe; + _nilike?: Maybe; + _nin?: Maybe>; + _nlike?: Maybe; + _nsimilar?: Maybe; + _similar?: Maybe; }; - -export type Mutation_RootCreateProposalArgs = { - data: ProposalCreateInput +export type Subscription = { + __typename?: 'Subscription'; + subscribed?: Maybe; }; - -export type Mutation_RootCreateProposalStatusArgs = { - data: ProposalStatusCreateInput +export type Token = { + __typename?: 'Token'; + token?: Maybe; }; - -export type Mutation_RootCreateReferendumArgs = { - data: ReferendumCreateInput +export type TotalIssuance = Node & { + __typename?: 'TotalIssuance'; + amount: Scalars['String']; + blockNumber: BlockNumber; + id: Scalars['ID']; }; - -export type Mutation_RootCreateReferendumStatusArgs = { - data: ReferendumStatusCreateInput +/** A connection to a list of items. */ +export type TotalIssuanceConnection = { + __typename?: 'TotalIssuanceConnection'; + aggregate: AggregateTotalIssuance; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; }; - -export type Mutation_RootCreateRewardArgs = { - data: RewardCreateInput +/** An edge in a connection. */ +export type TotalIssuanceEdge = { + __typename?: 'TotalIssuanceEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: TotalIssuance; }; +export enum TotalIssuanceOrderByInput { + AmountAsc = 'amount_ASC', + AmountDesc = 'amount_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC' +} -export type Mutation_RootCreateSessionArgs = { - data: SessionCreateInput +export type TotalIssuancePreviousValues = { + __typename?: 'TotalIssuancePreviousValues'; + amount: Scalars['String']; + id: Scalars['ID']; }; - -export type Mutation_RootCreateSlashingArgs = { - data: SlashingCreateInput +export type TotalIssuanceSubscriptionPayload = { + __typename?: 'TotalIssuanceSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; }; - -export type Mutation_RootCreateStakeArgs = { - data: StakeCreateInput +export type TotalIssuanceSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; - -export type Mutation_RootCreateTotalIssuanceArgs = { - data: TotalIssuanceCreateInput +export type TotalIssuanceWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + amount?: Maybe; + /** All values containing the given string. */ + amount_contains?: Maybe; + /** All values ending with the given string. */ + amount_ends_with?: Maybe; + /** All values greater than the given value. */ + amount_gt?: Maybe; + /** All values greater than or equal the given value. */ + amount_gte?: Maybe; + /** All values that are contained in given list. */ + amount_in?: Maybe>; + /** All values less than the given value. */ + amount_lt?: Maybe; + /** All values less than or equal the given value. */ + amount_lte?: Maybe; + /** All values that are not equal to given value. */ + amount_not?: Maybe; + /** All values not containing the given string. */ + amount_not_contains?: Maybe; + /** All values not ending with the given string. */ + amount_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + amount_not_in?: Maybe>; + /** All values not starting with the given string. */ + amount_not_starts_with?: Maybe; + /** All values starting with the given string. */ + amount_starts_with?: Maybe; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; }; - -export type Mutation_RootCreateTreasurySpendProposalArgs = { - data: TreasurySpendProposalCreateInput +export type TotalIssuanceWhereUniqueInput = { + id?: Maybe; }; - -export type Mutation_RootCreateTreasuryStatusArgs = { - data: TreasuryStatusCreateInput +export type TreasurySpendProposal = { + __typename?: 'TreasurySpendProposal'; + beneficiary: Scalars['String']; + bond: Scalars['String']; + id: Scalars['Int']; + motion?: Maybe; + proposer: Scalars['String']; + treasuryProposalId: Scalars['Int']; + treasuryStatus?: Maybe>; + value: Scalars['String']; }; -export type Mutation_RootCreateValidatorArgs = { - data: ValidatorCreateInput +export type TreasurySpendProposalTreasuryStatusArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; - -export type Mutation_RootDeleteBlockIndexArgs = { - where: BlockIndexWhereUniqueInput +/** A connection to a list of items. */ +export type TreasurySpendProposalConnection = { + __typename?: 'TreasurySpendProposalConnection'; + aggregate: AggregateTreasurySpendProposal; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type TreasurySpendProposalEdge = { + __typename?: 'TreasurySpendProposalEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: TreasurySpendProposal; +}; + +export enum TreasurySpendProposalOrderByInput { + BeneficiaryAsc = 'beneficiary_ASC', + BeneficiaryDesc = 'beneficiary_DESC', + BondAsc = 'bond_ASC', + BondDesc = 'bond_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + ProposerAsc = 'proposer_ASC', + ProposerDesc = 'proposer_DESC', + TreasuryProposalIdAsc = 'treasuryProposalId_ASC', + TreasuryProposalIdDesc = 'treasuryProposalId_DESC', + ValueAsc = 'value_ASC', + ValueDesc = 'value_DESC' +} + +export type TreasurySpendProposalPreviousValues = { + __typename?: 'TreasurySpendProposalPreviousValues'; + beneficiary: Scalars['String']; + bond: Scalars['String']; + id: Scalars['Int']; + proposer: Scalars['String']; + treasuryProposalId: Scalars['Int']; + value: Scalars['String']; +}; + +export type TreasurySpendProposalSubscriptionPayload = { + __typename?: 'TreasurySpendProposalSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; +}; + +export type TreasurySpendProposalSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; +}; + +export type TreasurySpendProposalWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + beneficiary?: Maybe; + /** All values containing the given string. */ + beneficiary_contains?: Maybe; + /** All values ending with the given string. */ + beneficiary_ends_with?: Maybe; + /** All values greater than the given value. */ + beneficiary_gt?: Maybe; + /** All values greater than or equal the given value. */ + beneficiary_gte?: Maybe; + /** All values that are contained in given list. */ + beneficiary_in?: Maybe>; + /** All values less than the given value. */ + beneficiary_lt?: Maybe; + /** All values less than or equal the given value. */ + beneficiary_lte?: Maybe; + /** All values that are not equal to given value. */ + beneficiary_not?: Maybe; + /** All values not containing the given string. */ + beneficiary_not_contains?: Maybe; + /** All values not ending with the given string. */ + beneficiary_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + beneficiary_not_in?: Maybe>; + /** All values not starting with the given string. */ + beneficiary_not_starts_with?: Maybe; + /** All values starting with the given string. */ + beneficiary_starts_with?: Maybe; + bond?: Maybe; + /** All values containing the given string. */ + bond_contains?: Maybe; + /** All values ending with the given string. */ + bond_ends_with?: Maybe; + /** All values greater than the given value. */ + bond_gt?: Maybe; + /** All values greater than or equal the given value. */ + bond_gte?: Maybe; + /** All values that are contained in given list. */ + bond_in?: Maybe>; + /** All values less than the given value. */ + bond_lt?: Maybe; + /** All values less than or equal the given value. */ + bond_lte?: Maybe; + /** All values that are not equal to given value. */ + bond_not?: Maybe; + /** All values not containing the given string. */ + bond_not_contains?: Maybe; + /** All values not ending with the given string. */ + bond_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + bond_not_in?: Maybe>; + /** All values not starting with the given string. */ + bond_not_starts_with?: Maybe; + /** All values starting with the given string. */ + bond_starts_with?: Maybe; + id?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + motion?: Maybe; + proposer?: Maybe; + /** All values containing the given string. */ + proposer_contains?: Maybe; + /** All values ending with the given string. */ + proposer_ends_with?: Maybe; + /** All values greater than the given value. */ + proposer_gt?: Maybe; + /** All values greater than or equal the given value. */ + proposer_gte?: Maybe; + /** All values that are contained in given list. */ + proposer_in?: Maybe>; + /** All values less than the given value. */ + proposer_lt?: Maybe; + /** All values less than or equal the given value. */ + proposer_lte?: Maybe; + /** All values that are not equal to given value. */ + proposer_not?: Maybe; + /** All values not containing the given string. */ + proposer_not_contains?: Maybe; + /** All values not ending with the given string. */ + proposer_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + proposer_not_in?: Maybe>; + /** All values not starting with the given string. */ + proposer_not_starts_with?: Maybe; + /** All values starting with the given string. */ + proposer_starts_with?: Maybe; + treasuryProposalId?: Maybe; + /** All values greater than the given value. */ + treasuryProposalId_gt?: Maybe; + /** All values greater than or equal the given value. */ + treasuryProposalId_gte?: Maybe; + /** All values that are contained in given list. */ + treasuryProposalId_in?: Maybe>; + /** All values less than the given value. */ + treasuryProposalId_lt?: Maybe; + /** All values less than or equal the given value. */ + treasuryProposalId_lte?: Maybe; + /** All values that are not equal to given value. */ + treasuryProposalId_not?: Maybe; + /** All values that are not contained in given list. */ + treasuryProposalId_not_in?: Maybe>; + treasuryStatus_every?: Maybe; + treasuryStatus_none?: Maybe; + treasuryStatus_some?: Maybe; + value?: Maybe; + /** All values containing the given string. */ + value_contains?: Maybe; + /** All values ending with the given string. */ + value_ends_with?: Maybe; + /** All values greater than the given value. */ + value_gt?: Maybe; + /** All values greater than or equal the given value. */ + value_gte?: Maybe; + /** All values that are contained in given list. */ + value_in?: Maybe>; + /** All values less than the given value. */ + value_lt?: Maybe; + /** All values less than or equal the given value. */ + value_lte?: Maybe; + /** All values that are not equal to given value. */ + value_not?: Maybe; + /** All values not containing the given string. */ + value_not_contains?: Maybe; + /** All values not ending with the given string. */ + value_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + value_not_in?: Maybe>; + /** All values not starting with the given string. */ + value_not_starts_with?: Maybe; + /** All values starting with the given string. */ + value_starts_with?: Maybe; +}; + +export type TreasurySpendProposalWhereInput_Remote_Rel_Public_Onchain_Linksonchain_Treasury_Spend_Proposal = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + beneficiary?: Maybe; + /** All values containing the given string. */ + beneficiary_contains?: Maybe; + /** All values ending with the given string. */ + beneficiary_ends_with?: Maybe; + /** All values greater than the given value. */ + beneficiary_gt?: Maybe; + /** All values greater than or equal the given value. */ + beneficiary_gte?: Maybe; + /** All values that are contained in given list. */ + beneficiary_in?: Maybe>; + /** All values less than the given value. */ + beneficiary_lt?: Maybe; + /** All values less than or equal the given value. */ + beneficiary_lte?: Maybe; + /** All values that are not equal to given value. */ + beneficiary_not?: Maybe; + /** All values not containing the given string. */ + beneficiary_not_contains?: Maybe; + /** All values not ending with the given string. */ + beneficiary_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + beneficiary_not_in?: Maybe>; + /** All values not starting with the given string. */ + beneficiary_not_starts_with?: Maybe; + /** All values starting with the given string. */ + beneficiary_starts_with?: Maybe; + bond?: Maybe; + /** All values containing the given string. */ + bond_contains?: Maybe; + /** All values ending with the given string. */ + bond_ends_with?: Maybe; + /** All values greater than the given value. */ + bond_gt?: Maybe; + /** All values greater than or equal the given value. */ + bond_gte?: Maybe; + /** All values that are contained in given list. */ + bond_in?: Maybe>; + /** All values less than the given value. */ + bond_lt?: Maybe; + /** All values less than or equal the given value. */ + bond_lte?: Maybe; + /** All values that are not equal to given value. */ + bond_not?: Maybe; + /** All values not containing the given string. */ + bond_not_contains?: Maybe; + /** All values not ending with the given string. */ + bond_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + bond_not_in?: Maybe>; + /** All values not starting with the given string. */ + bond_not_starts_with?: Maybe; + /** All values starting with the given string. */ + bond_starts_with?: Maybe; + id?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + motion?: Maybe; + proposer?: Maybe; + /** All values containing the given string. */ + proposer_contains?: Maybe; + /** All values ending with the given string. */ + proposer_ends_with?: Maybe; + /** All values greater than the given value. */ + proposer_gt?: Maybe; + /** All values greater than or equal the given value. */ + proposer_gte?: Maybe; + /** All values that are contained in given list. */ + proposer_in?: Maybe>; + /** All values less than the given value. */ + proposer_lt?: Maybe; + /** All values less than or equal the given value. */ + proposer_lte?: Maybe; + /** All values that are not equal to given value. */ + proposer_not?: Maybe; + /** All values not containing the given string. */ + proposer_not_contains?: Maybe; + /** All values not ending with the given string. */ + proposer_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + proposer_not_in?: Maybe>; + /** All values not starting with the given string. */ + proposer_not_starts_with?: Maybe; + /** All values starting with the given string. */ + proposer_starts_with?: Maybe; + /** All values greater than the given value. */ + treasuryProposalId_gt?: Maybe; + /** All values greater than or equal the given value. */ + treasuryProposalId_gte?: Maybe; + /** All values that are contained in given list. */ + treasuryProposalId_in?: Maybe>; + /** All values less than the given value. */ + treasuryProposalId_lt?: Maybe; + /** All values less than or equal the given value. */ + treasuryProposalId_lte?: Maybe; + /** All values that are not equal to given value. */ + treasuryProposalId_not?: Maybe; + /** All values that are not contained in given list. */ + treasuryProposalId_not_in?: Maybe>; + treasuryStatus_every?: Maybe; + treasuryStatus_none?: Maybe; + treasuryStatus_some?: Maybe; + value?: Maybe; + /** All values containing the given string. */ + value_contains?: Maybe; + /** All values ending with the given string. */ + value_ends_with?: Maybe; + /** All values greater than the given value. */ + value_gt?: Maybe; + /** All values greater than or equal the given value. */ + value_gte?: Maybe; + /** All values that are contained in given list. */ + value_in?: Maybe>; + /** All values less than the given value. */ + value_lt?: Maybe; + /** All values less than or equal the given value. */ + value_lte?: Maybe; + /** All values that are not equal to given value. */ + value_not?: Maybe; + /** All values not containing the given string. */ + value_not_contains?: Maybe; + /** All values not ending with the given string. */ + value_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + value_not_in?: Maybe>; + /** All values not starting with the given string. */ + value_not_starts_with?: Maybe; + /** All values starting with the given string. */ + value_starts_with?: Maybe; +}; + +export type TreasurySpendProposalWhereUniqueInput = { + id?: Maybe; + treasuryProposalId?: Maybe; +}; + +export type TreasuryStatus = Node & { + __typename?: 'TreasuryStatus'; + blockNumber: BlockNumber; + id: Scalars['ID']; + status: Scalars['String']; + treasurySpendProposal: TreasurySpendProposal; + uniqueStatus: Scalars['String']; +}; + +/** A connection to a list of items. */ +export type TreasuryStatusConnection = { + __typename?: 'TreasuryStatusConnection'; + aggregate: AggregateTreasuryStatus; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; + +/** An edge in a connection. */ +export type TreasuryStatusEdge = { + __typename?: 'TreasuryStatusEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: TreasuryStatus; +}; + +export enum TreasuryStatusOrderByInput { + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + StatusAsc = 'status_ASC', + StatusDesc = 'status_DESC', + UniqueStatusAsc = 'uniqueStatus_ASC', + UniqueStatusDesc = 'uniqueStatus_DESC' +} + +export type TreasuryStatusPreviousValues = { + __typename?: 'TreasuryStatusPreviousValues'; + id: Scalars['ID']; + status: Scalars['String']; + uniqueStatus: Scalars['String']; +}; + +export type TreasuryStatusSubscriptionPayload = { + __typename?: 'TreasuryStatusSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; +}; + +export type TreasuryStatusSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; +}; + +export type TreasuryStatusWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + blockNumber?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + status?: Maybe; + /** All values containing the given string. */ + status_contains?: Maybe; + /** All values ending with the given string. */ + status_ends_with?: Maybe; + /** All values greater than the given value. */ + status_gt?: Maybe; + /** All values greater than or equal the given value. */ + status_gte?: Maybe; + /** All values that are contained in given list. */ + status_in?: Maybe>; + /** All values less than the given value. */ + status_lt?: Maybe; + /** All values less than or equal the given value. */ + status_lte?: Maybe; + /** All values that are not equal to given value. */ + status_not?: Maybe; + /** All values not containing the given string. */ + status_not_contains?: Maybe; + /** All values not ending with the given string. */ + status_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + status_not_in?: Maybe>; + /** All values not starting with the given string. */ + status_not_starts_with?: Maybe; + /** All values starting with the given string. */ + status_starts_with?: Maybe; + treasurySpendProposal?: Maybe; + uniqueStatus?: Maybe; + /** All values containing the given string. */ + uniqueStatus_contains?: Maybe; + /** All values ending with the given string. */ + uniqueStatus_ends_with?: Maybe; + /** All values greater than the given value. */ + uniqueStatus_gt?: Maybe; + /** All values greater than or equal the given value. */ + uniqueStatus_gte?: Maybe; + /** All values that are contained in given list. */ + uniqueStatus_in?: Maybe>; + /** All values less than the given value. */ + uniqueStatus_lt?: Maybe; + /** All values less than or equal the given value. */ + uniqueStatus_lte?: Maybe; + /** All values that are not equal to given value. */ + uniqueStatus_not?: Maybe; + /** All values not containing the given string. */ + uniqueStatus_not_contains?: Maybe; + /** All values not ending with the given string. */ + uniqueStatus_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + uniqueStatus_not_in?: Maybe>; + /** All values not starting with the given string. */ + uniqueStatus_not_starts_with?: Maybe; + /** All values starting with the given string. */ + uniqueStatus_starts_with?: Maybe; +}; + +export type TreasuryStatusWhereUniqueInput = { + id?: Maybe; + uniqueStatus?: Maybe; +}; + +export type UndoEmailChangeResponse = { + __typename?: 'UndoEmailChangeResponse'; + email?: Maybe; + message?: Maybe; + token?: Maybe; }; -export type Mutation_RootDeleteBlockNumberArgs = { - where: BlockNumberWhereUniqueInput +export type User = { + __typename?: 'User'; + email?: Maybe; + email_verified?: Maybe; + id?: Maybe; + kusama_default_address?: Maybe; + polkadot_default_address?: Maybe; + username?: Maybe; + web3signup?: Maybe; +}; + +export type Validator = Node & { + __typename?: 'Validator'; + controller: Scalars['String']; + id: Scalars['ID']; + preferences: Scalars['String']; + session: Session; + stash: Scalars['String']; }; +/** A connection to a list of items. */ +export type ValidatorConnection = { + __typename?: 'ValidatorConnection'; + aggregate: AggregateValidator; + /** A list of edges. */ + edges: Array>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; +}; -export type Mutation_RootDeleteCouncilArgs = { - where: CouncilWhereUniqueInput +/** An edge in a connection. */ +export type ValidatorEdge = { + __typename?: 'ValidatorEdge'; + /** A cursor for use in pagination. */ + cursor: Scalars['String']; + /** The item at the end of the edge. */ + node: Validator; }; +export enum ValidatorOrderByInput { + ControllerAsc = 'controller_ASC', + ControllerDesc = 'controller_DESC', + IdAsc = 'id_ASC', + IdDesc = 'id_DESC', + PreferencesAsc = 'preferences_ASC', + PreferencesDesc = 'preferences_DESC', + StashAsc = 'stash_ASC', + StashDesc = 'stash_DESC' +} -export type Mutation_RootDeleteCouncilMemberArgs = { - where: CouncilMemberWhereUniqueInput +export type ValidatorPreviousValues = { + __typename?: 'ValidatorPreviousValues'; + controller: Scalars['String']; + id: Scalars['ID']; + preferences: Scalars['String']; + stash: Scalars['String']; }; +export type ValidatorSubscriptionPayload = { + __typename?: 'ValidatorSubscriptionPayload'; + mutation: MutationType; + node?: Maybe; + previousValues?: Maybe; + updatedFields?: Maybe>; +}; -export type Mutation_RootDeleteEraArgs = { - where: EraWhereUniqueInput +export type ValidatorSubscriptionWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + /** The subscription event gets dispatched when it's listed in mutation_in */ + mutation_in?: Maybe>; + node?: Maybe; + /** The subscription event gets only dispatched when one of the updated fields names is included in this list */ + updatedFields_contains?: Maybe; + /** The subscription event gets only dispatched when all of the field names included in this list have been updated */ + updatedFields_contains_every?: Maybe>; + /** The subscription event gets only dispatched when some of the field names included in this list have been updated */ + updatedFields_contains_some?: Maybe>; }; +export type ValidatorWhereInput = { + /** Logical AND on all given filters. */ + AND?: Maybe>; + /** Logical NOT on all given filters combined by AND. */ + NOT?: Maybe>; + /** Logical OR on all given filters. */ + OR?: Maybe>; + controller?: Maybe; + /** All values containing the given string. */ + controller_contains?: Maybe; + /** All values ending with the given string. */ + controller_ends_with?: Maybe; + /** All values greater than the given value. */ + controller_gt?: Maybe; + /** All values greater than or equal the given value. */ + controller_gte?: Maybe; + /** All values that are contained in given list. */ + controller_in?: Maybe>; + /** All values less than the given value. */ + controller_lt?: Maybe; + /** All values less than or equal the given value. */ + controller_lte?: Maybe; + /** All values that are not equal to given value. */ + controller_not?: Maybe; + /** All values not containing the given string. */ + controller_not_contains?: Maybe; + /** All values not ending with the given string. */ + controller_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + controller_not_in?: Maybe>; + /** All values not starting with the given string. */ + controller_not_starts_with?: Maybe; + /** All values starting with the given string. */ + controller_starts_with?: Maybe; + id?: Maybe; + /** All values containing the given string. */ + id_contains?: Maybe; + /** All values ending with the given string. */ + id_ends_with?: Maybe; + /** All values greater than the given value. */ + id_gt?: Maybe; + /** All values greater than or equal the given value. */ + id_gte?: Maybe; + /** All values that are contained in given list. */ + id_in?: Maybe>; + /** All values less than the given value. */ + id_lt?: Maybe; + /** All values less than or equal the given value. */ + id_lte?: Maybe; + /** All values that are not equal to given value. */ + id_not?: Maybe; + /** All values not containing the given string. */ + id_not_contains?: Maybe; + /** All values not ending with the given string. */ + id_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + id_not_in?: Maybe>; + /** All values not starting with the given string. */ + id_not_starts_with?: Maybe; + /** All values starting with the given string. */ + id_starts_with?: Maybe; + preferences?: Maybe; + /** All values containing the given string. */ + preferences_contains?: Maybe; + /** All values ending with the given string. */ + preferences_ends_with?: Maybe; + /** All values greater than the given value. */ + preferences_gt?: Maybe; + /** All values greater than or equal the given value. */ + preferences_gte?: Maybe; + /** All values that are contained in given list. */ + preferences_in?: Maybe>; + /** All values less than the given value. */ + preferences_lt?: Maybe; + /** All values less than or equal the given value. */ + preferences_lte?: Maybe; + /** All values that are not equal to given value. */ + preferences_not?: Maybe; + /** All values not containing the given string. */ + preferences_not_contains?: Maybe; + /** All values not ending with the given string. */ + preferences_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + preferences_not_in?: Maybe>; + /** All values not starting with the given string. */ + preferences_not_starts_with?: Maybe; + /** All values starting with the given string. */ + preferences_starts_with?: Maybe; + session?: Maybe; + stash?: Maybe; + /** All values containing the given string. */ + stash_contains?: Maybe; + /** All values ending with the given string. */ + stash_ends_with?: Maybe; + /** All values greater than the given value. */ + stash_gt?: Maybe; + /** All values greater than or equal the given value. */ + stash_gte?: Maybe; + /** All values that are contained in given list. */ + stash_in?: Maybe>; + /** All values less than the given value. */ + stash_lt?: Maybe; + /** All values less than or equal the given value. */ + stash_lte?: Maybe; + /** All values that are not equal to given value. */ + stash_not?: Maybe; + /** All values not containing the given string. */ + stash_not_contains?: Maybe; + /** All values not ending with the given string. */ + stash_not_ends_with?: Maybe; + /** All values that are not contained in given list. */ + stash_not_in?: Maybe>; + /** All values not starting with the given string. */ + stash_not_starts_with?: Maybe; + /** All values starting with the given string. */ + stash_starts_with?: Maybe; +}; -export type Mutation_RootDeleteHeartBeatArgs = { - where: HeartBeatWhereUniqueInput +export type ValidatorWhereUniqueInput = { + id?: Maybe; }; -export type Mutation_RootDeleteManyBlockIndexesArgs = { - where?: Maybe +/** expression to compare columns of type bpchar. All fields are combined with logical 'AND'. */ +export type Bpchar_Comparison_Exp = { + _eq?: Maybe; + _gt?: Maybe; + _gte?: Maybe; + _in?: Maybe>; + _is_null?: Maybe; + _lt?: Maybe; + _lte?: Maybe; + _neq?: Maybe; + _nin?: Maybe>; +}; + +/** columns and relationships of "comment_reactions" */ +export type Comment_Reactions = { + __typename?: 'comment_reactions'; + /** An object relationship */ + comment: Comments; + comment_id: Scalars['uuid']; + created_at: Scalars['timestamp']; + id: Scalars['Int']; + /** Remote relationship field */ + reacting_user?: Maybe; + reaction: Scalars['bpchar']; + updated_at: Scalars['timestamp']; + user_id: Scalars['Int']; +}; + +/** aggregated selection of "comment_reactions" */ +export type Comment_Reactions_Aggregate = { + __typename?: 'comment_reactions_aggregate'; + aggregate?: Maybe; + nodes: Array; }; +/** aggregate fields of "comment_reactions" */ +export type Comment_Reactions_Aggregate_Fields = { + __typename?: 'comment_reactions_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "comment_reactions" */ +export type Comment_Reactions_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; +}; -export type Mutation_RootDeleteManyBlockNumbersArgs = { - where?: Maybe +/** order by aggregate values of table "comment_reactions" */ +export type Comment_Reactions_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "comment_reactions" */ +export type Comment_Reactions_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; }; +/** aggregate avg on columns */ +export type Comment_Reactions_Avg_Fields = { + __typename?: 'comment_reactions_avg_fields'; + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyCouncilMembersArgs = { - where?: Maybe +/** order by avg() on columns of table "comment_reactions" */ +export type Comment_Reactions_Avg_Order_By = { + id?: Maybe; + user_id?: Maybe; }; +/** Boolean expression to filter rows from the table "comment_reactions". All fields are combined with a logical 'AND'. */ +export type Comment_Reactions_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + comment?: Maybe; + comment_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + reaction?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; + +/** unique or primary key constraints on table "comment_reactions" */ +export enum Comment_Reactions_Constraint { + /** unique or primary key constraint */ + CommentReactionsPkey = 'comment_reactions_pkey' +} -export type Mutation_RootDeleteManyCouncilsArgs = { - where?: Maybe +/** input type for incrementing integer columne in table "comment_reactions" */ +export type Comment_Reactions_Inc_Input = { + id?: Maybe; + user_id?: Maybe; }; +/** input type for inserting data into table "comment_reactions" */ +export type Comment_Reactions_Insert_Input = { + comment?: Maybe; + comment_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + reaction?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyErasArgs = { - where?: Maybe +/** aggregate max on columns */ +export type Comment_Reactions_Max_Fields = { + __typename?: 'comment_reactions_max_fields'; + comment_id?: Maybe; + id?: Maybe; + user_id?: Maybe; }; +/** order by max() on columns of table "comment_reactions" */ +export type Comment_Reactions_Max_Order_By = { + comment_id?: Maybe; + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyHeartBeatsArgs = { - where?: Maybe +/** aggregate min on columns */ +export type Comment_Reactions_Min_Fields = { + __typename?: 'comment_reactions_min_fields'; + comment_id?: Maybe; + id?: Maybe; + user_id?: Maybe; }; +/** order by min() on columns of table "comment_reactions" */ +export type Comment_Reactions_Min_Order_By = { + comment_id?: Maybe; + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyMotionProposalArgumentsArgs = { - where?: Maybe +/** response of any mutation on the table "comment_reactions" */ +export type Comment_Reactions_Mutation_Response = { + __typename?: 'comment_reactions_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; }; +/** input type for inserting object relation for remote table "comment_reactions" */ +export type Comment_Reactions_Obj_Rel_Insert_Input = { + data: Comment_Reactions_Insert_Input; + on_conflict?: Maybe; +}; -export type Mutation_RootDeleteManyMotionStatusesArgs = { - where?: Maybe +/** on conflict condition type for table "comment_reactions" */ +export type Comment_Reactions_On_Conflict = { + constraint: Comment_Reactions_Constraint; + update_columns: Array; + where?: Maybe; }; +/** ordering options when selecting data from "comment_reactions" */ +export type Comment_Reactions_Order_By = { + comment?: Maybe; + comment_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + reaction?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyMotionsArgs = { - where?: Maybe +/** primary key columns input for table: "comment_reactions" */ +export type Comment_Reactions_Pk_Columns_Input = { + id: Scalars['Int']; }; +/** select columns of table "comment_reactions" */ +export enum Comment_Reactions_Select_Column { + /** column name */ + CommentId = 'comment_id', + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + Reaction = 'reaction', + /** column name */ + UpdatedAt = 'updated_at', + /** column name */ + UserId = 'user_id' +} -export type Mutation_RootDeleteManyNominationsArgs = { - where?: Maybe +/** input type for updating data in table "comment_reactions" */ +export type Comment_Reactions_Set_Input = { + comment_id?: Maybe; + created_at?: Maybe; + id?: Maybe; + reaction?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; +/** aggregate stddev on columns */ +export type Comment_Reactions_Stddev_Fields = { + __typename?: 'comment_reactions_stddev_fields'; + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyOfflineValidatorsArgs = { - where?: Maybe +/** order by stddev() on columns of table "comment_reactions" */ +export type Comment_Reactions_Stddev_Order_By = { + id?: Maybe; + user_id?: Maybe; }; +/** aggregate stddev_pop on columns */ +export type Comment_Reactions_Stddev_Pop_Fields = { + __typename?: 'comment_reactions_stddev_pop_fields'; + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyPreimageArgumentsArgs = { - where?: Maybe +/** order by stddev_pop() on columns of table "comment_reactions" */ +export type Comment_Reactions_Stddev_Pop_Order_By = { + id?: Maybe; + user_id?: Maybe; }; +/** aggregate stddev_samp on columns */ +export type Comment_Reactions_Stddev_Samp_Fields = { + __typename?: 'comment_reactions_stddev_samp_fields'; + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyPreimageStatusesArgs = { - where?: Maybe +/** order by stddev_samp() on columns of table "comment_reactions" */ +export type Comment_Reactions_Stddev_Samp_Order_By = { + id?: Maybe; + user_id?: Maybe; }; +/** aggregate sum on columns */ +export type Comment_Reactions_Sum_Fields = { + __typename?: 'comment_reactions_sum_fields'; + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyPreimagesArgs = { - where?: Maybe +/** order by sum() on columns of table "comment_reactions" */ +export type Comment_Reactions_Sum_Order_By = { + id?: Maybe; + user_id?: Maybe; }; +/** update columns of table "comment_reactions" */ +export enum Comment_Reactions_Update_Column { + /** column name */ + CommentId = 'comment_id', + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + Reaction = 'reaction', + /** column name */ + UpdatedAt = 'updated_at', + /** column name */ + UserId = 'user_id' +} -export type Mutation_RootDeleteManyProposalStatusesArgs = { - where?: Maybe +/** aggregate var_pop on columns */ +export type Comment_Reactions_Var_Pop_Fields = { + __typename?: 'comment_reactions_var_pop_fields'; + id?: Maybe; + user_id?: Maybe; }; +/** order by var_pop() on columns of table "comment_reactions" */ +export type Comment_Reactions_Var_Pop_Order_By = { + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyProposalsArgs = { - where?: Maybe +/** aggregate var_samp on columns */ +export type Comment_Reactions_Var_Samp_Fields = { + __typename?: 'comment_reactions_var_samp_fields'; + id?: Maybe; + user_id?: Maybe; }; +/** order by var_samp() on columns of table "comment_reactions" */ +export type Comment_Reactions_Var_Samp_Order_By = { + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyReferendumStatusesArgs = { - where?: Maybe +/** aggregate variance on columns */ +export type Comment_Reactions_Variance_Fields = { + __typename?: 'comment_reactions_variance_fields'; + id?: Maybe; + user_id?: Maybe; }; +/** order by variance() on columns of table "comment_reactions" */ +export type Comment_Reactions_Variance_Order_By = { + id?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootDeleteManyReferendumsArgs = { - where?: Maybe +/** columns and relationships of "comments" */ +export type Comments = { + __typename?: 'comments'; + /** Remote relationship field */ + author?: Maybe; + author_id: Scalars['Int']; + /** An array relationship */ + comment_reactions: Array; + /** An aggregated array relationship */ + comment_reactions_aggregate: Comment_Reactions_Aggregate; + content: Scalars['String']; + created_at: Scalars['timestamptz']; + id: Scalars['uuid']; + /** An object relationship */ + post: Posts; + post_id: Scalars['Int']; + updated_at: Scalars['timestamptz']; +}; + + +/** columns and relationships of "comments" */ +export type CommentsComment_ReactionsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Mutation_RootDeleteManyRewardsArgs = { - where?: Maybe +/** columns and relationships of "comments" */ +export type CommentsComment_Reactions_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; +}; + +/** aggregated selection of "comments" */ +export type Comments_Aggregate = { + __typename?: 'comments_aggregate'; + aggregate?: Maybe; + nodes: Array; }; +/** aggregate fields of "comments" */ +export type Comments_Aggregate_Fields = { + __typename?: 'comments_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "comments" */ +export type Comments_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; +}; -export type Mutation_RootDeleteManySessionsArgs = { - where?: Maybe +/** order by aggregate values of table "comments" */ +export type Comments_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "comments" */ +export type Comments_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; }; +/** aggregate avg on columns */ +export type Comments_Avg_Fields = { + __typename?: 'comments_avg_fields'; + author_id?: Maybe; + post_id?: Maybe; +}; -export type Mutation_RootDeleteManySlashingsArgs = { - where?: Maybe +/** order by avg() on columns of table "comments" */ +export type Comments_Avg_Order_By = { + author_id?: Maybe; + post_id?: Maybe; }; +/** Boolean expression to filter rows from the table "comments". All fields are combined with a logical 'AND'. */ +export type Comments_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + author_id?: Maybe; + comment_reactions?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + post?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; +}; + +/** unique or primary key constraints on table "comments" */ +export enum Comments_Constraint { + /** unique or primary key constraint */ + CommentsPkey = 'comments_pkey' +} -export type Mutation_RootDeleteManyStakesArgs = { - where?: Maybe +/** input type for incrementing integer columne in table "comments" */ +export type Comments_Inc_Input = { + author_id?: Maybe; + post_id?: Maybe; }; +/** input type for inserting data into table "comments" */ +export type Comments_Insert_Input = { + author_id?: Maybe; + comment_reactions?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + post?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; +}; -export type Mutation_RootDeleteManyTotalIssuancesArgs = { - where?: Maybe +/** aggregate max on columns */ +export type Comments_Max_Fields = { + __typename?: 'comments_max_fields'; + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; +/** order by max() on columns of table "comments" */ +export type Comments_Max_Order_By = { + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; +}; -export type Mutation_RootDeleteManyTreasurySpendProposalsArgs = { - where?: Maybe +/** aggregate min on columns */ +export type Comments_Min_Fields = { + __typename?: 'comments_min_fields'; + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; +/** order by min() on columns of table "comments" */ +export type Comments_Min_Order_By = { + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; +}; -export type Mutation_RootDeleteManyTreasuryStatusesArgs = { - where?: Maybe +/** response of any mutation on the table "comments" */ +export type Comments_Mutation_Response = { + __typename?: 'comments_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; }; +/** input type for inserting object relation for remote table "comments" */ +export type Comments_Obj_Rel_Insert_Input = { + data: Comments_Insert_Input; + on_conflict?: Maybe; +}; -export type Mutation_RootDeleteManyValidatorsArgs = { - where?: Maybe +/** on conflict condition type for table "comments" */ +export type Comments_On_Conflict = { + constraint: Comments_Constraint; + update_columns: Array; + where?: Maybe; }; +/** ordering options when selecting data from "comments" */ +export type Comments_Order_By = { + author_id?: Maybe; + comment_reactions_aggregate?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + post?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; +}; -export type Mutation_RootDeleteMotionArgs = { - where: MotionWhereUniqueInput +/** primary key columns input for table: "comments" */ +export type Comments_Pk_Columns_Input = { + id: Scalars['uuid']; }; +/** select columns of table "comments" */ +export enum Comments_Select_Column { + /** column name */ + AuthorId = 'author_id', + /** column name */ + Content = 'content', + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + PostId = 'post_id', + /** column name */ + UpdatedAt = 'updated_at' +} -export type Mutation_RootDeleteMotionProposalArgumentArgs = { - where: MotionProposalArgumentWhereUniqueInput +/** input type for updating data in table "comments" */ +export type Comments_Set_Input = { + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; +/** aggregate stddev on columns */ +export type Comments_Stddev_Fields = { + __typename?: 'comments_stddev_fields'; + author_id?: Maybe; + post_id?: Maybe; +}; -export type Mutation_RootDeleteMotionStatusArgs = { - where: MotionStatusWhereUniqueInput +/** order by stddev() on columns of table "comments" */ +export type Comments_Stddev_Order_By = { + author_id?: Maybe; + post_id?: Maybe; }; +/** aggregate stddev_pop on columns */ +export type Comments_Stddev_Pop_Fields = { + __typename?: 'comments_stddev_pop_fields'; + author_id?: Maybe; + post_id?: Maybe; +}; -export type Mutation_RootDeleteNominationArgs = { - where: NominationWhereUniqueInput +/** order by stddev_pop() on columns of table "comments" */ +export type Comments_Stddev_Pop_Order_By = { + author_id?: Maybe; + post_id?: Maybe; }; +/** aggregate stddev_samp on columns */ +export type Comments_Stddev_Samp_Fields = { + __typename?: 'comments_stddev_samp_fields'; + author_id?: Maybe; + post_id?: Maybe; +}; -export type Mutation_RootDeleteOfflineValidatorArgs = { - where: OfflineValidatorWhereUniqueInput +/** order by stddev_samp() on columns of table "comments" */ +export type Comments_Stddev_Samp_Order_By = { + author_id?: Maybe; + post_id?: Maybe; }; +/** aggregate sum on columns */ +export type Comments_Sum_Fields = { + __typename?: 'comments_sum_fields'; + author_id?: Maybe; + post_id?: Maybe; +}; -export type Mutation_RootDeletePreimageArgs = { - where: PreimageWhereUniqueInput +/** order by sum() on columns of table "comments" */ +export type Comments_Sum_Order_By = { + author_id?: Maybe; + post_id?: Maybe; }; +/** update columns of table "comments" */ +export enum Comments_Update_Column { + /** column name */ + AuthorId = 'author_id', + /** column name */ + Content = 'content', + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + PostId = 'post_id', + /** column name */ + UpdatedAt = 'updated_at' +} -export type Mutation_RootDeletePreimageArgumentArgs = { - where: PreimageArgumentWhereUniqueInput +/** aggregate var_pop on columns */ +export type Comments_Var_Pop_Fields = { + __typename?: 'comments_var_pop_fields'; + author_id?: Maybe; + post_id?: Maybe; }; +/** order by var_pop() on columns of table "comments" */ +export type Comments_Var_Pop_Order_By = { + author_id?: Maybe; + post_id?: Maybe; +}; -export type Mutation_RootDeletePreimageStatusArgs = { - where: PreimageStatusWhereUniqueInput +/** aggregate var_samp on columns */ +export type Comments_Var_Samp_Fields = { + __typename?: 'comments_var_samp_fields'; + author_id?: Maybe; + post_id?: Maybe; }; +/** order by var_samp() on columns of table "comments" */ +export type Comments_Var_Samp_Order_By = { + author_id?: Maybe; + post_id?: Maybe; +}; -export type Mutation_RootDeleteProposalArgs = { - where: ProposalWhereUniqueInput +/** aggregate variance on columns */ +export type Comments_Variance_Fields = { + __typename?: 'comments_variance_fields'; + author_id?: Maybe; + post_id?: Maybe; }; +/** order by variance() on columns of table "comments" */ +export type Comments_Variance_Order_By = { + author_id?: Maybe; + post_id?: Maybe; +}; -export type Mutation_RootDeleteProposalStatusArgs = { - where: ProposalStatusWhereUniqueInput +/** mutation root */ +export type Mutation_Root = { + __typename?: 'mutation_root'; + addressLinkConfirm?: Maybe; + addressLinkStart?: Maybe; + addressLogin?: Maybe; + addressLoginStart?: Maybe; + addressSignupConfirm?: Maybe; + addressSignupStart?: Maybe; + addressUnlink?: Maybe; + changeEmail?: Maybe; + changeNotificationPreference?: Maybe; + changePassword?: Maybe; + changeUsername?: Maybe; + /** delete data from the table: "comment_reactions" */ + delete_comment_reactions?: Maybe; + /** delete single row from the table: "comment_reactions" */ + delete_comment_reactions_by_pk?: Maybe; + /** delete data from the table: "comments" */ + delete_comments?: Maybe; + /** delete single row from the table: "comments" */ + delete_comments_by_pk?: Maybe; + /** delete data from the table: "onchain_links" */ + delete_onchain_links?: Maybe; + /** delete single row from the table: "onchain_links" */ + delete_onchain_links_by_pk?: Maybe; + /** delete data from the table: "poll" */ + delete_poll?: Maybe; + /** delete single row from the table: "poll" */ + delete_poll_by_pk?: Maybe; + /** delete data from the table: "poll_votes" */ + delete_poll_votes?: Maybe; + /** delete single row from the table: "poll_votes" */ + delete_poll_votes_by_pk?: Maybe; + /** delete data from the table: "post_reactions" */ + delete_post_reactions?: Maybe; + /** delete single row from the table: "post_reactions" */ + delete_post_reactions_by_pk?: Maybe; + /** delete data from the table: "post_topics" */ + delete_post_topics?: Maybe; + /** delete single row from the table: "post_topics" */ + delete_post_topics_by_pk?: Maybe; + /** delete data from the table: "post_types" */ + delete_post_types?: Maybe; + /** delete single row from the table: "post_types" */ + delete_post_types_by_pk?: Maybe; + /** delete data from the table: "posts" */ + delete_posts?: Maybe; + /** delete single row from the table: "posts" */ + delete_posts_by_pk?: Maybe; + /** insert data into the table: "comment_reactions" */ + insert_comment_reactions?: Maybe; + /** insert a single row into the table: "comment_reactions" */ + insert_comment_reactions_one?: Maybe; + /** insert data into the table: "comments" */ + insert_comments?: Maybe; + /** insert a single row into the table: "comments" */ + insert_comments_one?: Maybe; + /** insert data into the table: "onchain_links" */ + insert_onchain_links?: Maybe; + /** insert a single row into the table: "onchain_links" */ + insert_onchain_links_one?: Maybe; + /** insert data into the table: "poll" */ + insert_poll?: Maybe; + /** insert a single row into the table: "poll" */ + insert_poll_one?: Maybe; + /** insert data into the table: "poll_votes" */ + insert_poll_votes?: Maybe; + /** insert a single row into the table: "poll_votes" */ + insert_poll_votes_one?: Maybe; + /** insert data into the table: "post_reactions" */ + insert_post_reactions?: Maybe; + /** insert a single row into the table: "post_reactions" */ + insert_post_reactions_one?: Maybe; + /** insert data into the table: "post_topics" */ + insert_post_topics?: Maybe; + /** insert a single row into the table: "post_topics" */ + insert_post_topics_one?: Maybe; + /** insert data into the table: "post_types" */ + insert_post_types?: Maybe; + /** insert a single row into the table: "post_types" */ + insert_post_types_one?: Maybe; + /** insert data into the table: "posts" */ + insert_posts?: Maybe; + /** insert a single row into the table: "posts" */ + insert_posts_one?: Maybe; + login?: Maybe; + logout?: Maybe; + postSubscribe?: Maybe; + postUnsubscribe?: Maybe; + reportContent?: Maybe; + requestResetPassword?: Maybe; + resendVerifyEmailToken?: Maybe; + resetPassword?: Maybe; + setCredentialsConfirm?: Maybe; + setCredentialsStart?: Maybe; + setDefaultAddress?: Maybe; + signup?: Maybe; + undoEmailChange?: Maybe; + /** update data of the table: "comment_reactions" */ + update_comment_reactions?: Maybe; + /** update single row of the table: "comment_reactions" */ + update_comment_reactions_by_pk?: Maybe; + /** update data of the table: "comments" */ + update_comments?: Maybe; + /** update single row of the table: "comments" */ + update_comments_by_pk?: Maybe; + /** update data of the table: "onchain_links" */ + update_onchain_links?: Maybe; + /** update single row of the table: "onchain_links" */ + update_onchain_links_by_pk?: Maybe; + /** update data of the table: "poll" */ + update_poll?: Maybe; + /** update single row of the table: "poll" */ + update_poll_by_pk?: Maybe; + /** update data of the table: "poll_votes" */ + update_poll_votes?: Maybe; + /** update single row of the table: "poll_votes" */ + update_poll_votes_by_pk?: Maybe; + /** update data of the table: "post_reactions" */ + update_post_reactions?: Maybe; + /** update single row of the table: "post_reactions" */ + update_post_reactions_by_pk?: Maybe; + /** update data of the table: "post_topics" */ + update_post_topics?: Maybe; + /** update single row of the table: "post_topics" */ + update_post_topics_by_pk?: Maybe; + /** update data of the table: "post_types" */ + update_post_types?: Maybe; + /** update single row of the table: "post_types" */ + update_post_types_by_pk?: Maybe; + /** update data of the table: "posts" */ + update_posts?: Maybe; + /** update single row of the table: "posts" */ + update_posts_by_pk?: Maybe; + verifyEmail?: Maybe; +}; + + +/** mutation root */ +export type Mutation_RootAddressLinkConfirmArgs = { + address_id: Scalars['Int']; + signature: Scalars['String']; }; -export type Mutation_RootDeleteReferendumArgs = { - where: ReferendumWhereUniqueInput +/** mutation root */ +export type Mutation_RootAddressLinkStartArgs = { + address: Scalars['String']; + network: Scalars['String']; }; -export type Mutation_RootDeleteReferendumStatusArgs = { - where: ReferendumStatusWhereUniqueInput +/** mutation root */ +export type Mutation_RootAddressLoginArgs = { + address: Scalars['String']; + signature: Scalars['String']; }; -export type Mutation_RootDeleteRewardArgs = { - where: RewardWhereUniqueInput +/** mutation root */ +export type Mutation_RootAddressLoginStartArgs = { + address: Scalars['String']; }; -export type Mutation_RootDeleteSessionArgs = { - where: SessionWhereUniqueInput +/** mutation root */ +export type Mutation_RootAddressSignupConfirmArgs = { + address: Scalars['String']; + network: Scalars['String']; + signature: Scalars['String']; }; -export type Mutation_RootDeleteSlashingArgs = { - where: SlashingWhereUniqueInput +/** mutation root */ +export type Mutation_RootAddressSignupStartArgs = { + address: Scalars['String']; }; -export type Mutation_RootDeleteStakeArgs = { - where: StakeWhereUniqueInput +/** mutation root */ +export type Mutation_RootAddressUnlinkArgs = { + address: Scalars['String']; }; -export type Mutation_RootDeleteTotalIssuanceArgs = { - where: TotalIssuanceWhereUniqueInput +/** mutation root */ +export type Mutation_RootChangeEmailArgs = { + email: Scalars['String']; + password: Scalars['String']; }; -export type Mutation_RootDeleteTreasurySpendProposalArgs = { - where: TreasurySpendProposalWhereUniqueInput +/** mutation root */ +export type Mutation_RootChangeNotificationPreferenceArgs = { + notificationPreferences?: Maybe; }; -export type Mutation_RootDeleteTreasuryStatusArgs = { - where: TreasuryStatusWhereUniqueInput +/** mutation root */ +export type Mutation_RootChangePasswordArgs = { + newPassword: Scalars['String']; + oldPassword: Scalars['String']; }; -export type Mutation_RootDeleteValidatorArgs = { - where: ValidatorWhereUniqueInput +/** mutation root */ +export type Mutation_RootChangeUsernameArgs = { + password: Scalars['String']; + username: Scalars['String']; }; +/** mutation root */ export type Mutation_RootDelete_Comment_ReactionsArgs = { - where: Comment_Reactions_Bool_Exp + where: Comment_Reactions_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Comment_Reactions_By_PkArgs = { - id: Scalars['Int'] + id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootDelete_CommentsArgs = { - where: Comments_Bool_Exp + where: Comments_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Comments_By_PkArgs = { - id: Scalars['uuid'] + id: Scalars['uuid']; }; +/** mutation root */ export type Mutation_RootDelete_Onchain_LinksArgs = { - where: Onchain_Links_Bool_Exp + where: Onchain_Links_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Onchain_Links_By_PkArgs = { - id: Scalars['Int'] + id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootDelete_PollArgs = { - where: Poll_Bool_Exp + where: Poll_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Poll_By_PkArgs = { - id: Scalars['Int'] + id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootDelete_Poll_VotesArgs = { - where: Poll_Votes_Bool_Exp + where: Poll_Votes_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Poll_Votes_By_PkArgs = { - id: Scalars['Int'] + id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootDelete_Post_ReactionsArgs = { - where: Post_Reactions_Bool_Exp + where: Post_Reactions_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Post_Reactions_By_PkArgs = { - id: Scalars['Int'] + id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootDelete_Post_TopicsArgs = { - where: Post_Topics_Bool_Exp + where: Post_Topics_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Post_Topics_By_PkArgs = { - id: Scalars['Int'] + id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootDelete_Post_TypesArgs = { - where: Post_Types_Bool_Exp + where: Post_Types_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Post_Types_By_PkArgs = { - id: Scalars['Int'] + id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootDelete_PostsArgs = { - where: Posts_Bool_Exp + where: Posts_Bool_Exp; }; +/** mutation root */ export type Mutation_RootDelete_Posts_By_PkArgs = { - id: Scalars['Int'] -}; - - -export type Mutation_RootExecuteRawArgs = { - database?: Maybe, - query: Scalars['String'] + id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootInsert_Comment_ReactionsArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Comment_Reactions_OneArgs = { - object: Comment_Reactions_Insert_Input, - on_conflict?: Maybe + object: Comment_Reactions_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_CommentsArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Comments_OneArgs = { - object: Comments_Insert_Input, - on_conflict?: Maybe + object: Comments_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Onchain_LinksArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Onchain_Links_OneArgs = { - object: Onchain_Links_Insert_Input, - on_conflict?: Maybe + object: Onchain_Links_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_PollArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Poll_OneArgs = { - object: Poll_Insert_Input, - on_conflict?: Maybe + object: Poll_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Poll_VotesArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Poll_Votes_OneArgs = { - object: Poll_Votes_Insert_Input, - on_conflict?: Maybe + object: Poll_Votes_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Post_ReactionsArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Post_Reactions_OneArgs = { - object: Post_Reactions_Insert_Input, - on_conflict?: Maybe + object: Post_Reactions_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Post_TopicsArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Post_Topics_OneArgs = { - object: Post_Topics_Insert_Input, - on_conflict?: Maybe + object: Post_Topics_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Post_TypesArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Post_Types_OneArgs = { - object: Post_Types_Insert_Input, - on_conflict?: Maybe + object: Post_Types_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_PostsArgs = { - objects: Array, - on_conflict?: Maybe + objects: Array; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootInsert_Posts_OneArgs = { - object: Posts_Insert_Input, - on_conflict?: Maybe + object: Posts_Insert_Input; + on_conflict?: Maybe; }; +/** mutation root */ export type Mutation_RootLoginArgs = { - password: Scalars['String'], - username: Scalars['String'] + password: Scalars['String']; + username: Scalars['String']; }; +/** mutation root */ export type Mutation_RootPostSubscribeArgs = { - post_id: Scalars['Int'] + post_id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootPostUnsubscribeArgs = { - post_id: Scalars['Int'] + post_id: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootReportContentArgs = { - comments?: Maybe, - content_id: Scalars['String'], - network: Scalars['String'], - reason: Scalars['String'], - type: Scalars['String'] + comments?: Maybe; + content_id: Scalars['String']; + network: Scalars['String']; + reason: Scalars['String']; + type: Scalars['String']; }; +/** mutation root */ export type Mutation_RootRequestResetPasswordArgs = { - email: Scalars['String'] + email: Scalars['String']; }; +/** mutation root */ export type Mutation_RootResetPasswordArgs = { - newPassword: Scalars['String'], - token: Scalars['String'], - userId: Scalars['Int'] + newPassword: Scalars['String']; + token: Scalars['String']; + userId: Scalars['Int']; }; +/** mutation root */ export type Mutation_RootSetCredentialsConfirmArgs = { - address: Scalars['String'], - email?: Maybe, - password: Scalars['String'], - signature: Scalars['String'], - username: Scalars['String'] + address: Scalars['String']; + email?: Maybe; + password: Scalars['String']; + signature: Scalars['String']; + username: Scalars['String']; }; +/** mutation root */ export type Mutation_RootSetCredentialsStartArgs = { - address: Scalars['String'] + address: Scalars['String']; }; +/** mutation root */ export type Mutation_RootSetDefaultAddressArgs = { - address: Scalars['String'] + address: Scalars['String']; }; +/** mutation root */ export type Mutation_RootSignupArgs = { - email?: Maybe, - password: Scalars['String'], - username: Scalars['String'] + email?: Maybe; + password: Scalars['String']; + username: Scalars['String']; }; +/** mutation root */ export type Mutation_RootUndoEmailChangeArgs = { - token: Scalars['String'] + token: Scalars['String']; }; -export type Mutation_RootUpdateBlockIndexArgs = { - data: BlockIndexUpdateInput, - where: BlockIndexWhereUniqueInput +/** mutation root */ +export type Mutation_RootUpdate_Comment_ReactionsArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Comment_Reactions_Bool_Exp; }; -export type Mutation_RootUpdateBlockNumberArgs = { - data: BlockNumberUpdateInput, - where: BlockNumberWhereUniqueInput +/** mutation root */ +export type Mutation_RootUpdate_Comment_Reactions_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Comment_Reactions_Pk_Columns_Input; }; -export type Mutation_RootUpdateCouncilArgs = { - data: CouncilUpdateInput, - where: CouncilWhereUniqueInput +/** mutation root */ +export type Mutation_RootUpdate_CommentsArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Comments_Bool_Exp; }; -export type Mutation_RootUpdateCouncilMemberArgs = { - data: CouncilMemberUpdateInput, - where: CouncilMemberWhereUniqueInput +/** mutation root */ +export type Mutation_RootUpdate_Comments_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Comments_Pk_Columns_Input; }; -export type Mutation_RootUpdateEraArgs = { - data: EraUpdateInput, - where: EraWhereUniqueInput +/** mutation root */ +export type Mutation_RootUpdate_Onchain_LinksArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Onchain_Links_Bool_Exp; }; -export type Mutation_RootUpdateHeartBeatArgs = { - data: HeartBeatUpdateInput, - where: HeartBeatWhereUniqueInput +/** mutation root */ +export type Mutation_RootUpdate_Onchain_Links_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Onchain_Links_Pk_Columns_Input; }; -export type Mutation_RootUpdateManyBlockIndexesArgs = { - data: BlockIndexUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_PollArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Poll_Bool_Exp; }; -export type Mutation_RootUpdateManyBlockNumbersArgs = { - data: BlockNumberUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Poll_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Poll_Pk_Columns_Input; }; -export type Mutation_RootUpdateManyCouncilMembersArgs = { - data: CouncilMemberUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Poll_VotesArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Poll_Votes_Bool_Exp; }; -export type Mutation_RootUpdateManyErasArgs = { - data: EraUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Poll_Votes_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Poll_Votes_Pk_Columns_Input; }; -export type Mutation_RootUpdateManyHeartBeatsArgs = { - data: HeartBeatUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Post_ReactionsArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Post_Reactions_Bool_Exp; }; -export type Mutation_RootUpdateManyMotionProposalArgumentsArgs = { - data: MotionProposalArgumentUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Post_Reactions_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Post_Reactions_Pk_Columns_Input; }; -export type Mutation_RootUpdateManyMotionStatusesArgs = { - data: MotionStatusUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Post_TopicsArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Post_Topics_Bool_Exp; }; -export type Mutation_RootUpdateManyMotionsArgs = { - data: MotionUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Post_Topics_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Post_Topics_Pk_Columns_Input; }; -export type Mutation_RootUpdateManyNominationsArgs = { - data: NominationUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Post_TypesArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Post_Types_Bool_Exp; }; -export type Mutation_RootUpdateManyOfflineValidatorsArgs = { - data: OfflineValidatorUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Post_Types_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Post_Types_Pk_Columns_Input; }; -export type Mutation_RootUpdateManyPreimageArgumentsArgs = { - data: PreimageArgumentUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_PostsArgs = { + _inc?: Maybe; + _set?: Maybe; + where: Posts_Bool_Exp; }; -export type Mutation_RootUpdateManyPreimageStatusesArgs = { - data: PreimageStatusUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootUpdate_Posts_By_PkArgs = { + _inc?: Maybe; + _set?: Maybe; + pk_columns: Posts_Pk_Columns_Input; }; -export type Mutation_RootUpdateManyPreimagesArgs = { - data: PreimageUpdateManyMutationInput, - where?: Maybe +/** mutation root */ +export type Mutation_RootVerifyEmailArgs = { + token: Scalars['String']; }; - -export type Mutation_RootUpdateManyProposalStatusesArgs = { - data: ProposalStatusUpdateManyMutationInput, - where?: Maybe +/** + * on chain proposal created automatically by chain-db-watcher + * + * + * columns and relationships of "onchain_links" + */ +export type Onchain_Links = { + __typename?: 'onchain_links'; + created_at: Scalars['timestamptz']; + id: Scalars['Int']; + /** Remote relationship field */ + onchain_motion: Array>; + onchain_motion_id?: Maybe; + /** Remote relationship field */ + onchain_proposal: Array>; + onchain_proposal_id?: Maybe; + /** Remote relationship field */ + onchain_referendum: Array>; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + /** Remote relationship field */ + onchain_treasury_spend_proposal: Array>; + /** An object relationship */ + post: Posts; + post_id: Scalars['Int']; + proposer_address: Scalars['String']; }; -export type Mutation_RootUpdateManyProposalsArgs = { - data: ProposalUpdateManyMutationInput, - where?: Maybe +/** + * on chain proposal created automatically by chain-db-watcher + * + * + * columns and relationships of "onchain_links" + */ +export type Onchain_LinksOnchain_MotionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Mutation_RootUpdateManyReferendumStatusesArgs = { - data: ReferendumStatusUpdateManyMutationInput, - where?: Maybe +/** + * on chain proposal created automatically by chain-db-watcher + * + * + * columns and relationships of "onchain_links" + */ +export type Onchain_LinksOnchain_ProposalArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Mutation_RootUpdateManyReferendumsArgs = { - data: ReferendumUpdateManyMutationInput, - where?: Maybe +/** + * on chain proposal created automatically by chain-db-watcher + * + * + * columns and relationships of "onchain_links" + */ +export type Onchain_LinksOnchain_ReferendumArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Mutation_RootUpdateManyRewardsArgs = { - data: RewardUpdateManyMutationInput, - where?: Maybe +/** + * on chain proposal created automatically by chain-db-watcher + * + * + * columns and relationships of "onchain_links" + */ +export type Onchain_LinksOnchain_Treasury_Spend_ProposalArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; - -export type Mutation_RootUpdateManySessionsArgs = { - data: SessionUpdateManyMutationInput, - where?: Maybe +/** aggregated selection of "onchain_links" */ +export type Onchain_Links_Aggregate = { + __typename?: 'onchain_links_aggregate'; + aggregate?: Maybe; + nodes: Array; }; - -export type Mutation_RootUpdateManySlashingsArgs = { - data: SlashingUpdateManyMutationInput, - where?: Maybe +/** aggregate fields of "onchain_links" */ +export type Onchain_Links_Aggregate_Fields = { + __typename?: 'onchain_links_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "onchain_links" */ +export type Onchain_Links_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; }; - -export type Mutation_RootUpdateManyStakesArgs = { - data: StakeUpdateManyMutationInput, - where?: Maybe +/** order by aggregate values of table "onchain_links" */ +export type Onchain_Links_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "onchain_links" */ +export type Onchain_Links_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; }; - -export type Mutation_RootUpdateManyTotalIssuancesArgs = { - data: TotalIssuanceUpdateManyMutationInput, - where?: Maybe +/** aggregate avg on columns */ +export type Onchain_Links_Avg_Fields = { + __typename?: 'onchain_links_avg_fields'; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateManyTreasurySpendProposalsArgs = { - data: TreasurySpendProposalUpdateManyMutationInput, - where?: Maybe +/** order by avg() on columns of table "onchain_links" */ +export type Onchain_Links_Avg_Order_By = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; +/** Boolean expression to filter rows from the table "onchain_links". All fields are combined with a logical 'AND'. */ +export type Onchain_Links_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + created_at?: Maybe; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post?: Maybe; + post_id?: Maybe; + proposer_address?: Maybe; +}; + +/** unique or primary key constraints on table "onchain_links" */ +export enum Onchain_Links_Constraint { + /** unique or primary key constraint */ + OnchainLinksOnchainMotionIdKey = 'onchain_links_onchain_motion_id_key', + /** unique or primary key constraint */ + OnchainLinksOnchainReferendumIdKey = 'onchain_links_onchain_referendum_id_key', + /** unique or primary key constraint */ + OnchainProposalsChainDbIdKey = 'onchain_proposals_chain_db_id_key', + /** unique or primary key constraint */ + ProposalsPkey = 'proposals_pkey', + /** unique or primary key constraint */ + ProposalsPostIdKey = 'proposals_post_id_key' +} -export type Mutation_RootUpdateManyTreasuryStatusesArgs = { - data: TreasuryStatusUpdateManyMutationInput, - where?: Maybe +/** input type for incrementing integer columne in table "onchain_links" */ +export type Onchain_Links_Inc_Input = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateManyValidatorsArgs = { - data: ValidatorUpdateManyMutationInput, - where?: Maybe +/** input type for inserting data into table "onchain_links" */ +export type Onchain_Links_Insert_Input = { + created_at?: Maybe; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post?: Maybe; + post_id?: Maybe; + proposer_address?: Maybe; +}; + +/** aggregate max on columns */ +export type Onchain_Links_Max_Fields = { + __typename?: 'onchain_links_max_fields'; + created_at?: Maybe; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; + proposer_address?: Maybe; +}; + +/** order by max() on columns of table "onchain_links" */ +export type Onchain_Links_Max_Order_By = { + created_at?: Maybe; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; + proposer_address?: Maybe; }; - -export type Mutation_RootUpdateMotionArgs = { - data: MotionUpdateInput, - where: MotionWhereUniqueInput +/** aggregate min on columns */ +export type Onchain_Links_Min_Fields = { + __typename?: 'onchain_links_min_fields'; + created_at?: Maybe; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; + proposer_address?: Maybe; +}; + +/** order by min() on columns of table "onchain_links" */ +export type Onchain_Links_Min_Order_By = { + created_at?: Maybe; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; + proposer_address?: Maybe; }; - -export type Mutation_RootUpdateMotionProposalArgumentArgs = { - data: MotionProposalArgumentUpdateInput, - where: MotionProposalArgumentWhereUniqueInput +/** response of any mutation on the table "onchain_links" */ +export type Onchain_Links_Mutation_Response = { + __typename?: 'onchain_links_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; }; - -export type Mutation_RootUpdateMotionStatusArgs = { - data: MotionStatusUpdateInput, - where: MotionStatusWhereUniqueInput +/** input type for inserting object relation for remote table "onchain_links" */ +export type Onchain_Links_Obj_Rel_Insert_Input = { + data: Onchain_Links_Insert_Input; + on_conflict?: Maybe; }; - -export type Mutation_RootUpdateNominationArgs = { - data: NominationUpdateInput, - where: NominationWhereUniqueInput +/** on conflict condition type for table "onchain_links" */ +export type Onchain_Links_On_Conflict = { + constraint: Onchain_Links_Constraint; + update_columns: Array; + where?: Maybe; }; - -export type Mutation_RootUpdateOfflineValidatorArgs = { - data: OfflineValidatorUpdateInput, - where: OfflineValidatorWhereUniqueInput +/** ordering options when selecting data from "onchain_links" */ +export type Onchain_Links_Order_By = { + created_at?: Maybe; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post?: Maybe; + post_id?: Maybe; + proposer_address?: Maybe; +}; + +/** primary key columns input for table: "onchain_links" */ +export type Onchain_Links_Pk_Columns_Input = { + id: Scalars['Int']; }; +/** select columns of table "onchain_links" */ +export enum Onchain_Links_Select_Column { + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + OnchainMotionId = 'onchain_motion_id', + /** column name */ + OnchainProposalId = 'onchain_proposal_id', + /** column name */ + OnchainReferendumId = 'onchain_referendum_id', + /** column name */ + OnchainTreasuryProposalId = 'onchain_treasury_proposal_id', + /** column name */ + PostId = 'post_id', + /** column name */ + ProposerAddress = 'proposer_address' +} -export type Mutation_RootUpdatePreimageArgs = { - data: PreimageUpdateInput, - where: PreimageWhereUniqueInput +/** input type for updating data in table "onchain_links" */ +export type Onchain_Links_Set_Input = { + created_at?: Maybe; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; + proposer_address?: Maybe; }; - -export type Mutation_RootUpdatePreimageArgumentArgs = { - data: PreimageArgumentUpdateInput, - where: PreimageArgumentWhereUniqueInput +/** aggregate stddev on columns */ +export type Onchain_Links_Stddev_Fields = { + __typename?: 'onchain_links_stddev_fields'; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdatePreimageStatusArgs = { - data: PreimageStatusUpdateInput, - where: PreimageStatusWhereUniqueInput +/** order by stddev() on columns of table "onchain_links" */ +export type Onchain_Links_Stddev_Order_By = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateProposalArgs = { - data: ProposalUpdateInput, - where: ProposalWhereUniqueInput +/** aggregate stddev_pop on columns */ +export type Onchain_Links_Stddev_Pop_Fields = { + __typename?: 'onchain_links_stddev_pop_fields'; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateProposalStatusArgs = { - data: ProposalStatusUpdateInput, - where: ProposalStatusWhereUniqueInput +/** order by stddev_pop() on columns of table "onchain_links" */ +export type Onchain_Links_Stddev_Pop_Order_By = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateReferendumArgs = { - data: ReferendumUpdateInput, - where: ReferendumWhereUniqueInput +/** aggregate stddev_samp on columns */ +export type Onchain_Links_Stddev_Samp_Fields = { + __typename?: 'onchain_links_stddev_samp_fields'; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateReferendumStatusArgs = { - data: ReferendumStatusUpdateInput, - where: ReferendumStatusWhereUniqueInput +/** order by stddev_samp() on columns of table "onchain_links" */ +export type Onchain_Links_Stddev_Samp_Order_By = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateRewardArgs = { - data: RewardUpdateInput, - where: RewardWhereUniqueInput +/** aggregate sum on columns */ +export type Onchain_Links_Sum_Fields = { + __typename?: 'onchain_links_sum_fields'; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateSessionArgs = { - data: SessionUpdateInput, - where: SessionWhereUniqueInput +/** order by sum() on columns of table "onchain_links" */ +export type Onchain_Links_Sum_Order_By = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; +/** update columns of table "onchain_links" */ +export enum Onchain_Links_Update_Column { + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + OnchainMotionId = 'onchain_motion_id', + /** column name */ + OnchainProposalId = 'onchain_proposal_id', + /** column name */ + OnchainReferendumId = 'onchain_referendum_id', + /** column name */ + OnchainTreasuryProposalId = 'onchain_treasury_proposal_id', + /** column name */ + PostId = 'post_id', + /** column name */ + ProposerAddress = 'proposer_address' +} -export type Mutation_RootUpdateSlashingArgs = { - data: SlashingUpdateInput, - where: SlashingWhereUniqueInput +/** aggregate var_pop on columns */ +export type Onchain_Links_Var_Pop_Fields = { + __typename?: 'onchain_links_var_pop_fields'; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateStakeArgs = { - data: StakeUpdateInput, - where: StakeWhereUniqueInput +/** order by var_pop() on columns of table "onchain_links" */ +export type Onchain_Links_Var_Pop_Order_By = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateTotalIssuanceArgs = { - data: TotalIssuanceUpdateInput, - where: TotalIssuanceWhereUniqueInput +/** aggregate var_samp on columns */ +export type Onchain_Links_Var_Samp_Fields = { + __typename?: 'onchain_links_var_samp_fields'; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateTreasurySpendProposalArgs = { - data: TreasurySpendProposalUpdateInput, - where: TreasurySpendProposalWhereUniqueInput +/** order by var_samp() on columns of table "onchain_links" */ +export type Onchain_Links_Var_Samp_Order_By = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateTreasuryStatusArgs = { - data: TreasuryStatusUpdateInput, - where: TreasuryStatusWhereUniqueInput +/** aggregate variance on columns */ +export type Onchain_Links_Variance_Fields = { + __typename?: 'onchain_links_variance_fields'; + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdateValidatorArgs = { - data: ValidatorUpdateInput, - where: ValidatorWhereUniqueInput +/** order by variance() on columns of table "onchain_links" */ +export type Onchain_Links_Variance_Order_By = { + id?: Maybe; + onchain_motion_id?: Maybe; + onchain_proposal_id?: Maybe; + onchain_referendum_id?: Maybe; + onchain_treasury_proposal_id?: Maybe; + post_id?: Maybe; }; +/** column ordering options */ +export enum Order_By { + /** in the ascending order, nulls last */ + Asc = 'asc', + /** in the ascending order, nulls first */ + AscNullsFirst = 'asc_nulls_first', + /** in the ascending order, nulls last */ + AscNullsLast = 'asc_nulls_last', + /** in the descending order, nulls first */ + Desc = 'desc', + /** in the descending order, nulls first */ + DescNullsFirst = 'desc_nulls_first', + /** in the descending order, nulls last */ + DescNullsLast = 'desc_nulls_last' +} -export type Mutation_RootUpdate_Comment_ReactionsArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Comment_Reactions_Bool_Exp +/** columns and relationships of "poll" */ +export type Poll = { + __typename?: 'poll'; + block_end: Scalars['Int']; + created_at: Scalars['timestamp']; + id: Scalars['Int']; + /** An array relationship */ + poll_votes: Array; + /** An aggregated array relationship */ + poll_votes_aggregate: Poll_Votes_Aggregate; + /** An object relationship */ + post: Posts; + post_id: Scalars['Int']; + updated_at?: Maybe; +}; + + +/** columns and relationships of "poll" */ +export type PollPoll_VotesArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Mutation_RootUpdate_Comment_Reactions_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Comment_Reactions_Pk_Columns_Input +/** columns and relationships of "poll" */ +export type PollPoll_Votes_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; - -export type Mutation_RootUpdate_CommentsArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Comments_Bool_Exp +/** aggregated selection of "poll" */ +export type Poll_Aggregate = { + __typename?: 'poll_aggregate'; + aggregate?: Maybe; + nodes: Array; }; - -export type Mutation_RootUpdate_Comments_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Comments_Pk_Columns_Input +/** aggregate fields of "poll" */ +export type Poll_Aggregate_Fields = { + __typename?: 'poll_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "poll" */ +export type Poll_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; }; - -export type Mutation_RootUpdate_Onchain_LinksArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Onchain_Links_Bool_Exp +/** order by aggregate values of table "poll" */ +export type Poll_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "poll" */ +export type Poll_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; }; - -export type Mutation_RootUpdate_Onchain_Links_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Onchain_Links_Pk_Columns_Input +/** aggregate avg on columns */ +export type Poll_Avg_Fields = { + __typename?: 'poll_avg_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdate_PollArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Poll_Bool_Exp +/** order by avg() on columns of table "poll" */ +export type Poll_Avg_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; +/** Boolean expression to filter rows from the table "poll". All fields are combined with a logical 'AND'. */ +export type Poll_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + block_end?: Maybe; + created_at?: Maybe; + id?: Maybe; + poll_votes?: Maybe; + post?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; +}; + +/** unique or primary key constraints on table "poll" */ +export enum Poll_Constraint { + /** unique or primary key constraint */ + PollPkey = 'poll_pkey' +} -export type Mutation_RootUpdate_Poll_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Poll_Pk_Columns_Input +/** input type for incrementing integer columne in table "poll" */ +export type Poll_Inc_Input = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpdate_Poll_VotesArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Poll_Votes_Bool_Exp +/** input type for inserting data into table "poll" */ +export type Poll_Insert_Input = { + block_end?: Maybe; + created_at?: Maybe; + id?: Maybe; + poll_votes?: Maybe; + post?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; - -export type Mutation_RootUpdate_Poll_Votes_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Poll_Votes_Pk_Columns_Input +/** aggregate max on columns */ +export type Poll_Max_Fields = { + __typename?: 'poll_max_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; - -export type Mutation_RootUpdate_Post_ReactionsArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Post_Reactions_Bool_Exp +/** order by max() on columns of table "poll" */ +export type Poll_Max_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; - -export type Mutation_RootUpdate_Post_Reactions_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Post_Reactions_Pk_Columns_Input +/** aggregate min on columns */ +export type Poll_Min_Fields = { + __typename?: 'poll_min_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; - -export type Mutation_RootUpdate_Post_TopicsArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Post_Topics_Bool_Exp +/** order by min() on columns of table "poll" */ +export type Poll_Min_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; - -export type Mutation_RootUpdate_Post_Topics_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Post_Topics_Pk_Columns_Input +/** response of any mutation on the table "poll" */ +export type Poll_Mutation_Response = { + __typename?: 'poll_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; }; - -export type Mutation_RootUpdate_Post_TypesArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Post_Types_Bool_Exp +/** input type for inserting object relation for remote table "poll" */ +export type Poll_Obj_Rel_Insert_Input = { + data: Poll_Insert_Input; + on_conflict?: Maybe; }; - -export type Mutation_RootUpdate_Post_Types_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Post_Types_Pk_Columns_Input +/** on conflict condition type for table "poll" */ +export type Poll_On_Conflict = { + constraint: Poll_Constraint; + update_columns: Array; + where?: Maybe; }; - -export type Mutation_RootUpdate_PostsArgs = { - _inc?: Maybe, - _set?: Maybe, - where: Posts_Bool_Exp +/** ordering options when selecting data from "poll" */ +export type Poll_Order_By = { + block_end?: Maybe; + created_at?: Maybe; + id?: Maybe; + poll_votes_aggregate?: Maybe; + post?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; - -export type Mutation_RootUpdate_Posts_By_PkArgs = { - _inc?: Maybe, - _set?: Maybe, - pk_columns: Posts_Pk_Columns_Input +/** primary key columns input for table: "poll" */ +export type Poll_Pk_Columns_Input = { + id: Scalars['Int']; }; +/** select columns of table "poll" */ +export enum Poll_Select_Column { + /** column name */ + BlockEnd = 'block_end', + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + PostId = 'post_id', + /** column name */ + UpdatedAt = 'updated_at' +} -export type Mutation_RootUpsertBlockIndexArgs = { - create: BlockIndexCreateInput, - update: BlockIndexUpdateInput, - where: BlockIndexWhereUniqueInput +/** input type for updating data in table "poll" */ +export type Poll_Set_Input = { + block_end?: Maybe; + created_at?: Maybe; + id?: Maybe; + post_id?: Maybe; + updated_at?: Maybe; }; - -export type Mutation_RootUpsertBlockNumberArgs = { - create: BlockNumberCreateInput, - update: BlockNumberUpdateInput, - where: BlockNumberWhereUniqueInput +/** aggregate stddev on columns */ +export type Poll_Stddev_Fields = { + __typename?: 'poll_stddev_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertCouncilArgs = { - create: CouncilCreateInput, - update: CouncilUpdateInput, - where: CouncilWhereUniqueInput +/** order by stddev() on columns of table "poll" */ +export type Poll_Stddev_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertCouncilMemberArgs = { - create: CouncilMemberCreateInput, - update: CouncilMemberUpdateInput, - where: CouncilMemberWhereUniqueInput +/** aggregate stddev_pop on columns */ +export type Poll_Stddev_Pop_Fields = { + __typename?: 'poll_stddev_pop_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertEraArgs = { - create: EraCreateInput, - update: EraUpdateInput, - where: EraWhereUniqueInput +/** order by stddev_pop() on columns of table "poll" */ +export type Poll_Stddev_Pop_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertHeartBeatArgs = { - create: HeartBeatCreateInput, - update: HeartBeatUpdateInput, - where: HeartBeatWhereUniqueInput +/** aggregate stddev_samp on columns */ +export type Poll_Stddev_Samp_Fields = { + __typename?: 'poll_stddev_samp_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertMotionArgs = { - create: MotionCreateInput, - update: MotionUpdateInput, - where: MotionWhereUniqueInput +/** order by stddev_samp() on columns of table "poll" */ +export type Poll_Stddev_Samp_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertMotionProposalArgumentArgs = { - create: MotionProposalArgumentCreateInput, - update: MotionProposalArgumentUpdateInput, - where: MotionProposalArgumentWhereUniqueInput +/** aggregate sum on columns */ +export type Poll_Sum_Fields = { + __typename?: 'poll_sum_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertMotionStatusArgs = { - create: MotionStatusCreateInput, - update: MotionStatusUpdateInput, - where: MotionStatusWhereUniqueInput +/** order by sum() on columns of table "poll" */ +export type Poll_Sum_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; +/** update columns of table "poll" */ +export enum Poll_Update_Column { + /** column name */ + BlockEnd = 'block_end', + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + PostId = 'post_id', + /** column name */ + UpdatedAt = 'updated_at' +} -export type Mutation_RootUpsertNominationArgs = { - create: NominationCreateInput, - update: NominationUpdateInput, - where: NominationWhereUniqueInput +/** aggregate var_pop on columns */ +export type Poll_Var_Pop_Fields = { + __typename?: 'poll_var_pop_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertOfflineValidatorArgs = { - create: OfflineValidatorCreateInput, - update: OfflineValidatorUpdateInput, - where: OfflineValidatorWhereUniqueInput +/** order by var_pop() on columns of table "poll" */ +export type Poll_Var_Pop_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertPreimageArgs = { - create: PreimageCreateInput, - update: PreimageUpdateInput, - where: PreimageWhereUniqueInput +/** aggregate var_samp on columns */ +export type Poll_Var_Samp_Fields = { + __typename?: 'poll_var_samp_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertPreimageArgumentArgs = { - create: PreimageArgumentCreateInput, - update: PreimageArgumentUpdateInput, - where: PreimageArgumentWhereUniqueInput +/** order by var_samp() on columns of table "poll" */ +export type Poll_Var_Samp_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertPreimageStatusArgs = { - create: PreimageStatusCreateInput, - update: PreimageStatusUpdateInput, - where: PreimageStatusWhereUniqueInput +/** aggregate variance on columns */ +export type Poll_Variance_Fields = { + __typename?: 'poll_variance_fields'; + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertProposalArgs = { - create: ProposalCreateInput, - update: ProposalUpdateInput, - where: ProposalWhereUniqueInput +/** order by variance() on columns of table "poll" */ +export type Poll_Variance_Order_By = { + block_end?: Maybe; + id?: Maybe; + post_id?: Maybe; }; - -export type Mutation_RootUpsertProposalStatusArgs = { - create: ProposalStatusCreateInput, - update: ProposalStatusUpdateInput, - where: ProposalStatusWhereUniqueInput +/** columns and relationships of "poll_votes" */ +export type Poll_Votes = { + __typename?: 'poll_votes'; + created_at: Scalars['timestamp']; + id: Scalars['Int']; + /** An object relationship */ + poll: Poll; + poll_id: Scalars['Int']; + updated_at?: Maybe; + user_id: Scalars['Int']; + vote: Scalars['bpchar']; + /** Remote relationship field */ + voter?: Maybe; +}; + +/** aggregated selection of "poll_votes" */ +export type Poll_Votes_Aggregate = { + __typename?: 'poll_votes_aggregate'; + aggregate?: Maybe; + nodes: Array; }; - -export type Mutation_RootUpsertReferendumArgs = { - create: ReferendumCreateInput, - update: ReferendumUpdateInput, - where: ReferendumWhereUniqueInput +/** aggregate fields of "poll_votes" */ +export type Poll_Votes_Aggregate_Fields = { + __typename?: 'poll_votes_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "poll_votes" */ +export type Poll_Votes_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; }; - -export type Mutation_RootUpsertReferendumStatusArgs = { - create: ReferendumStatusCreateInput, - update: ReferendumStatusUpdateInput, - where: ReferendumStatusWhereUniqueInput +/** order by aggregate values of table "poll_votes" */ +export type Poll_Votes_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "poll_votes" */ +export type Poll_Votes_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; }; - -export type Mutation_RootUpsertRewardArgs = { - create: RewardCreateInput, - update: RewardUpdateInput, - where: RewardWhereUniqueInput +/** aggregate avg on columns */ +export type Poll_Votes_Avg_Fields = { + __typename?: 'poll_votes_avg_fields'; + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; - -export type Mutation_RootUpsertSessionArgs = { - create: SessionCreateInput, - update: SessionUpdateInput, - where: SessionWhereUniqueInput +/** order by avg() on columns of table "poll_votes" */ +export type Poll_Votes_Avg_Order_By = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; +/** Boolean expression to filter rows from the table "poll_votes". All fields are combined with a logical 'AND'. */ +export type Poll_Votes_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + created_at?: Maybe; + id?: Maybe; + poll?: Maybe; + poll_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; + vote?: Maybe; +}; + +/** unique or primary key constraints on table "poll_votes" */ +export enum Poll_Votes_Constraint { + /** unique or primary key constraint */ + PollVotesPkey = 'poll_votes_pkey' +} -export type Mutation_RootUpsertSlashingArgs = { - create: SlashingCreateInput, - update: SlashingUpdateInput, - where: SlashingWhereUniqueInput +/** input type for incrementing integer columne in table "poll_votes" */ +export type Poll_Votes_Inc_Input = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; - -export type Mutation_RootUpsertStakeArgs = { - create: StakeCreateInput, - update: StakeUpdateInput, - where: StakeWhereUniqueInput +/** input type for inserting data into table "poll_votes" */ +export type Poll_Votes_Insert_Input = { + created_at?: Maybe; + id?: Maybe; + poll?: Maybe; + poll_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; + vote?: Maybe; }; +/** aggregate max on columns */ +export type Poll_Votes_Max_Fields = { + __typename?: 'poll_votes_max_fields'; + id?: Maybe; + poll_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootUpsertTotalIssuanceArgs = { - create: TotalIssuanceCreateInput, - update: TotalIssuanceUpdateInput, - where: TotalIssuanceWhereUniqueInput +/** order by max() on columns of table "poll_votes" */ +export type Poll_Votes_Max_Order_By = { + id?: Maybe; + poll_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; +/** aggregate min on columns */ +export type Poll_Votes_Min_Fields = { + __typename?: 'poll_votes_min_fields'; + id?: Maybe; + poll_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; -export type Mutation_RootUpsertTreasurySpendProposalArgs = { - create: TreasurySpendProposalCreateInput, - update: TreasurySpendProposalUpdateInput, - where: TreasurySpendProposalWhereUniqueInput +/** order by min() on columns of table "poll_votes" */ +export type Poll_Votes_Min_Order_By = { + id?: Maybe; + poll_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; +/** response of any mutation on the table "poll_votes" */ +export type Poll_Votes_Mutation_Response = { + __typename?: 'poll_votes_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; +}; -export type Mutation_RootUpsertTreasuryStatusArgs = { - create: TreasuryStatusCreateInput, - update: TreasuryStatusUpdateInput, - where: TreasuryStatusWhereUniqueInput +/** input type for inserting object relation for remote table "poll_votes" */ +export type Poll_Votes_Obj_Rel_Insert_Input = { + data: Poll_Votes_Insert_Input; + on_conflict?: Maybe; }; +/** on conflict condition type for table "poll_votes" */ +export type Poll_Votes_On_Conflict = { + constraint: Poll_Votes_Constraint; + update_columns: Array; + where?: Maybe; +}; -export type Mutation_RootUpsertValidatorArgs = { - create: ValidatorCreateInput, - update: ValidatorUpdateInput, - where: ValidatorWhereUniqueInput +/** ordering options when selecting data from "poll_votes" */ +export type Poll_Votes_Order_By = { + created_at?: Maybe; + id?: Maybe; + poll?: Maybe; + poll_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; + vote?: Maybe; }; - -export type Mutation_RootVerifyEmailArgs = { - token: Scalars['String'] -}; - -export enum MutationType { - Created = 'CREATED', - Deleted = 'DELETED', - Updated = 'UPDATED' -} - -export type Node = { - id: Scalars['ID'], -}; - -export type Nomination = Node & { - __typename?: 'Nomination', - id: Scalars['ID'], - nominatorController: Scalars['String'], - nominatorStash: Scalars['String'], - session: Session, - stakedAmount: Scalars['String'], - validatorController: Scalars['String'], - validatorStash: Scalars['String'], -}; - -export type NominationConnection = { - __typename?: 'NominationConnection', - aggregate: AggregateNomination, - edges: Array>, - pageInfo: PageInfo, -}; - -export type NominationCreateInput = { - id?: Maybe, - nominatorController: Scalars['String'], - nominatorStash: Scalars['String'], - session: SessionCreateOneInput, - stakedAmount: Scalars['String'], - validatorController: Scalars['String'], - validatorStash: Scalars['String'], -}; - -export type NominationEdge = { - __typename?: 'NominationEdge', - cursor: Scalars['String'], - node: Nomination, -}; - -export enum NominationOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - NominatorControllerAsc = 'nominatorController_ASC', - NominatorControllerDesc = 'nominatorController_DESC', - NominatorStashAsc = 'nominatorStash_ASC', - NominatorStashDesc = 'nominatorStash_DESC', - StakedAmountAsc = 'stakedAmount_ASC', - StakedAmountDesc = 'stakedAmount_DESC', - ValidatorControllerAsc = 'validatorController_ASC', - ValidatorControllerDesc = 'validatorController_DESC', - ValidatorStashAsc = 'validatorStash_ASC', - ValidatorStashDesc = 'validatorStash_DESC' -} - -export type NominationPreviousValues = { - __typename?: 'NominationPreviousValues', - id: Scalars['ID'], - nominatorController: Scalars['String'], - nominatorStash: Scalars['String'], - stakedAmount: Scalars['String'], - validatorController: Scalars['String'], - validatorStash: Scalars['String'], -}; - -export type NominationSubscriptionPayload = { - __typename?: 'NominationSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; - -export type NominationSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type NominationUpdateInput = { - nominatorController?: Maybe, - nominatorStash?: Maybe, - session?: Maybe, - stakedAmount?: Maybe, - validatorController?: Maybe, - validatorStash?: Maybe, -}; - -export type NominationUpdateManyMutationInput = { - nominatorController?: Maybe, - nominatorStash?: Maybe, - stakedAmount?: Maybe, - validatorController?: Maybe, - validatorStash?: Maybe, -}; - -export type NominationWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - nominatorController?: Maybe, - nominatorController_contains?: Maybe, - nominatorController_ends_with?: Maybe, - nominatorController_gt?: Maybe, - nominatorController_gte?: Maybe, - nominatorController_in?: Maybe>, - nominatorController_lt?: Maybe, - nominatorController_lte?: Maybe, - nominatorController_not?: Maybe, - nominatorController_not_contains?: Maybe, - nominatorController_not_ends_with?: Maybe, - nominatorController_not_in?: Maybe>, - nominatorController_not_starts_with?: Maybe, - nominatorController_starts_with?: Maybe, - nominatorStash?: Maybe, - nominatorStash_contains?: Maybe, - nominatorStash_ends_with?: Maybe, - nominatorStash_gt?: Maybe, - nominatorStash_gte?: Maybe, - nominatorStash_in?: Maybe>, - nominatorStash_lt?: Maybe, - nominatorStash_lte?: Maybe, - nominatorStash_not?: Maybe, - nominatorStash_not_contains?: Maybe, - nominatorStash_not_ends_with?: Maybe, - nominatorStash_not_in?: Maybe>, - nominatorStash_not_starts_with?: Maybe, - nominatorStash_starts_with?: Maybe, - session?: Maybe, - stakedAmount?: Maybe, - stakedAmount_contains?: Maybe, - stakedAmount_ends_with?: Maybe, - stakedAmount_gt?: Maybe, - stakedAmount_gte?: Maybe, - stakedAmount_in?: Maybe>, - stakedAmount_lt?: Maybe, - stakedAmount_lte?: Maybe, - stakedAmount_not?: Maybe, - stakedAmount_not_contains?: Maybe, - stakedAmount_not_ends_with?: Maybe, - stakedAmount_not_in?: Maybe>, - stakedAmount_not_starts_with?: Maybe, - stakedAmount_starts_with?: Maybe, - validatorController?: Maybe, - validatorController_contains?: Maybe, - validatorController_ends_with?: Maybe, - validatorController_gt?: Maybe, - validatorController_gte?: Maybe, - validatorController_in?: Maybe>, - validatorController_lt?: Maybe, - validatorController_lte?: Maybe, - validatorController_not?: Maybe, - validatorController_not_contains?: Maybe, - validatorController_not_ends_with?: Maybe, - validatorController_not_in?: Maybe>, - validatorController_not_starts_with?: Maybe, - validatorController_starts_with?: Maybe, - validatorStash?: Maybe, - validatorStash_contains?: Maybe, - validatorStash_ends_with?: Maybe, - validatorStash_gt?: Maybe, - validatorStash_gte?: Maybe, - validatorStash_in?: Maybe>, - validatorStash_lt?: Maybe, - validatorStash_lte?: Maybe, - validatorStash_not?: Maybe, - validatorStash_not_contains?: Maybe, - validatorStash_not_ends_with?: Maybe, - validatorStash_not_in?: Maybe>, - validatorStash_not_starts_with?: Maybe, - validatorStash_starts_with?: Maybe, -}; - -export type NominationWhereUniqueInput = { - id?: Maybe, -}; - -export type NotificationPreferences = { - __typename?: 'NotificationPreferences', - newProposal?: Maybe, - ownProposal?: Maybe, - postCreated?: Maybe, - postParticipated?: Maybe, -}; - -export type NotificationPreferencesInput = { - newProposal?: Maybe, - ownProposal?: Maybe, - postCreated?: Maybe, - postParticipated?: Maybe, -}; - -export type OfflineValidator = Node & { - __typename?: 'OfflineValidator', - id: Scalars['ID'], - others: Array, - own: Scalars['String'], - sessionIndex: Session, - total: Scalars['String'], - validatorId: Scalars['String'], -}; - -export type OfflineValidatorConnection = { - __typename?: 'OfflineValidatorConnection', - aggregate: AggregateOfflineValidator, - edges: Array>, - pageInfo: PageInfo, -}; - -export type OfflineValidatorCreateInput = { - id?: Maybe, - others?: Maybe, - own: Scalars['String'], - sessionIndex: SessionCreateOneInput, - total: Scalars['String'], - validatorId: Scalars['String'], -}; - -export type OfflineValidatorCreateothersInput = { - set?: Maybe>, -}; - -export type OfflineValidatorEdge = { - __typename?: 'OfflineValidatorEdge', - cursor: Scalars['String'], - node: OfflineValidator, -}; - -export enum OfflineValidatorOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - OwnAsc = 'own_ASC', - OwnDesc = 'own_DESC', - TotalAsc = 'total_ASC', - TotalDesc = 'total_DESC', - ValidatorIdAsc = 'validatorId_ASC', - ValidatorIdDesc = 'validatorId_DESC' -} - -export type OfflineValidatorPreviousValues = { - __typename?: 'OfflineValidatorPreviousValues', - id: Scalars['ID'], - others: Array, - own: Scalars['String'], - total: Scalars['String'], - validatorId: Scalars['String'], -}; - -export type OfflineValidatorSubscriptionPayload = { - __typename?: 'OfflineValidatorSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; - -export type OfflineValidatorSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type OfflineValidatorUpdateInput = { - others?: Maybe, - own?: Maybe, - sessionIndex?: Maybe, - total?: Maybe, - validatorId?: Maybe, -}; - -export type OfflineValidatorUpdateManyMutationInput = { - others?: Maybe, - own?: Maybe, - total?: Maybe, - validatorId?: Maybe, -}; - -export type OfflineValidatorUpdateothersInput = { - set?: Maybe>, -}; - -export type OfflineValidatorWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - own?: Maybe, - own_contains?: Maybe, - own_ends_with?: Maybe, - own_gt?: Maybe, - own_gte?: Maybe, - own_in?: Maybe>, - own_lt?: Maybe, - own_lte?: Maybe, - own_not?: Maybe, - own_not_contains?: Maybe, - own_not_ends_with?: Maybe, - own_not_in?: Maybe>, - own_not_starts_with?: Maybe, - own_starts_with?: Maybe, - sessionIndex?: Maybe, - total?: Maybe, - total_contains?: Maybe, - total_ends_with?: Maybe, - total_gt?: Maybe, - total_gte?: Maybe, - total_in?: Maybe>, - total_lt?: Maybe, - total_lte?: Maybe, - total_not?: Maybe, - total_not_contains?: Maybe, - total_not_ends_with?: Maybe, - total_not_in?: Maybe>, - total_not_starts_with?: Maybe, - total_starts_with?: Maybe, - validatorId?: Maybe, - validatorId_contains?: Maybe, - validatorId_ends_with?: Maybe, - validatorId_gt?: Maybe, - validatorId_gte?: Maybe, - validatorId_in?: Maybe>, - validatorId_lt?: Maybe, - validatorId_lte?: Maybe, - validatorId_not?: Maybe, - validatorId_not_contains?: Maybe, - validatorId_not_ends_with?: Maybe, - validatorId_not_in?: Maybe>, - validatorId_not_starts_with?: Maybe, - validatorId_starts_with?: Maybe, -}; - -export type OfflineValidatorWhereUniqueInput = { - id?: Maybe, -}; - -export type Onchain_Links = { - __typename?: 'onchain_links', - created_at: Scalars['timestamptz'], - id: Scalars['Int'], - onchain_motion: Array>, - onchain_motion_id?: Maybe, - onchain_proposal: Array>, - onchain_proposal_id?: Maybe, - onchain_referendum: Array>, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - onchain_treasury_spend_proposal: Array>, - post: Posts, - post_id: Scalars['Int'], - proposer_address: Scalars['String'], -}; - - -export type Onchain_LinksOnchain_MotionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Onchain_LinksOnchain_ProposalArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Onchain_LinksOnchain_ReferendumArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Onchain_LinksOnchain_Treasury_Spend_ProposalArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - -export type Onchain_Links_Aggregate = { - __typename?: 'onchain_links_aggregate', - aggregate?: Maybe, - nodes: Array, -}; - -export type Onchain_Links_Aggregate_Fields = { - __typename?: 'onchain_links_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - - -export type Onchain_Links_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe -}; - -export type Onchain_Links_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - -export type Onchain_Links_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, -}; - -export type Onchain_Links_Avg_Fields = { - __typename?: 'onchain_links_avg_fields', - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, -}; - -export type Onchain_Links_Avg_Order_By = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, -}; - -export type Onchain_Links_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - created_at?: Maybe, - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post?: Maybe, - post_id?: Maybe, - proposer_address?: Maybe, -}; - -export enum Onchain_Links_Constraint { - OnchainLinksOnchainMotionIdKey = 'onchain_links_onchain_motion_id_key', - OnchainLinksOnchainReferendumIdKey = 'onchain_links_onchain_referendum_id_key', - OnchainProposalsChainDbIdKey = 'onchain_proposals_chain_db_id_key', - ProposalsPkey = 'proposals_pkey', - ProposalsPostIdKey = 'proposals_post_id_key' -} - -export type Onchain_Links_Inc_Input = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, -}; - -export type Onchain_Links_Insert_Input = { - created_at?: Maybe, - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post?: Maybe, - post_id?: Maybe, - proposer_address?: Maybe, -}; - -export type Onchain_Links_Max_Fields = { - __typename?: 'onchain_links_max_fields', - created_at?: Maybe, - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, - proposer_address?: Maybe, -}; - -export type Onchain_Links_Max_Order_By = { - created_at?: Maybe, - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, - proposer_address?: Maybe, -}; - -export type Onchain_Links_Min_Fields = { - __typename?: 'onchain_links_min_fields', - created_at?: Maybe, - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, - proposer_address?: Maybe, -}; - -export type Onchain_Links_Min_Order_By = { - created_at?: Maybe, - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, - proposer_address?: Maybe, -}; - -export type Onchain_Links_Mutation_Response = { - __typename?: 'onchain_links_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, -}; - -export type Onchain_Links_Obj_Rel_Insert_Input = { - data: Onchain_Links_Insert_Input, - on_conflict?: Maybe, -}; - -export type Onchain_Links_On_Conflict = { - constraint: Onchain_Links_Constraint, - update_columns: Array, - where?: Maybe, -}; - -export type Onchain_Links_Order_By = { - created_at?: Maybe, - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post?: Maybe, - post_id?: Maybe, - proposer_address?: Maybe, -}; - -export type Onchain_Links_Pk_Columns_Input = { - id: Scalars['Int'], +/** primary key columns input for table: "poll_votes" */ +export type Poll_Votes_Pk_Columns_Input = { + id: Scalars['Int']; }; -export enum Onchain_Links_Select_Column { +/** select columns of table "poll_votes" */ +export enum Poll_Votes_Select_Column { + /** column name */ CreatedAt = 'created_at', + /** column name */ Id = 'id', - OnchainMotionId = 'onchain_motion_id', - OnchainProposalId = 'onchain_proposal_id', - OnchainReferendumId = 'onchain_referendum_id', - OnchainTreasuryProposalId = 'onchain_treasury_proposal_id', - PostId = 'post_id', - ProposerAddress = 'proposer_address' + /** column name */ + PollId = 'poll_id', + /** column name */ + UpdatedAt = 'updated_at', + /** column name */ + UserId = 'user_id', + /** column name */ + Vote = 'vote' } -export type Onchain_Links_Set_Input = { - created_at?: Maybe, - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, - proposer_address?: Maybe, +/** input type for updating data in table "poll_votes" */ +export type Poll_Votes_Set_Input = { + created_at?: Maybe; + id?: Maybe; + poll_id?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; + vote?: Maybe; }; -export type Onchain_Links_Stddev_Fields = { - __typename?: 'onchain_links_stddev_fields', - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** aggregate stddev on columns */ +export type Poll_Votes_Stddev_Fields = { + __typename?: 'poll_votes_stddev_fields'; + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Stddev_Order_By = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** order by stddev() on columns of table "poll_votes" */ +export type Poll_Votes_Stddev_Order_By = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Stddev_Pop_Fields = { - __typename?: 'onchain_links_stddev_pop_fields', - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** aggregate stddev_pop on columns */ +export type Poll_Votes_Stddev_Pop_Fields = { + __typename?: 'poll_votes_stddev_pop_fields'; + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Stddev_Pop_Order_By = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** order by stddev_pop() on columns of table "poll_votes" */ +export type Poll_Votes_Stddev_Pop_Order_By = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Stddev_Samp_Fields = { - __typename?: 'onchain_links_stddev_samp_fields', - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** aggregate stddev_samp on columns */ +export type Poll_Votes_Stddev_Samp_Fields = { + __typename?: 'poll_votes_stddev_samp_fields'; + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Stddev_Samp_Order_By = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** order by stddev_samp() on columns of table "poll_votes" */ +export type Poll_Votes_Stddev_Samp_Order_By = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Sum_Fields = { - __typename?: 'onchain_links_sum_fields', - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** aggregate sum on columns */ +export type Poll_Votes_Sum_Fields = { + __typename?: 'poll_votes_sum_fields'; + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Sum_Order_By = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** order by sum() on columns of table "poll_votes" */ +export type Poll_Votes_Sum_Order_By = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export enum Onchain_Links_Update_Column { +/** update columns of table "poll_votes" */ +export enum Poll_Votes_Update_Column { + /** column name */ CreatedAt = 'created_at', + /** column name */ Id = 'id', - OnchainMotionId = 'onchain_motion_id', - OnchainProposalId = 'onchain_proposal_id', - OnchainReferendumId = 'onchain_referendum_id', - OnchainTreasuryProposalId = 'onchain_treasury_proposal_id', - PostId = 'post_id', - ProposerAddress = 'proposer_address' + /** column name */ + PollId = 'poll_id', + /** column name */ + UpdatedAt = 'updated_at', + /** column name */ + UserId = 'user_id', + /** column name */ + Vote = 'vote' } -export type Onchain_Links_Var_Pop_Fields = { - __typename?: 'onchain_links_var_pop_fields', - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** aggregate var_pop on columns */ +export type Poll_Votes_Var_Pop_Fields = { + __typename?: 'poll_votes_var_pop_fields'; + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Var_Pop_Order_By = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** order by var_pop() on columns of table "poll_votes" */ +export type Poll_Votes_Var_Pop_Order_By = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Var_Samp_Fields = { - __typename?: 'onchain_links_var_samp_fields', - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** aggregate var_samp on columns */ +export type Poll_Votes_Var_Samp_Fields = { + __typename?: 'poll_votes_var_samp_fields'; + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Var_Samp_Order_By = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** order by var_samp() on columns of table "poll_votes" */ +export type Poll_Votes_Var_Samp_Order_By = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Variance_Fields = { - __typename?: 'onchain_links_variance_fields', - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** aggregate variance on columns */ +export type Poll_Votes_Variance_Fields = { + __typename?: 'poll_votes_variance_fields'; + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export type Onchain_Links_Variance_Order_By = { - id?: Maybe, - onchain_motion_id?: Maybe, - onchain_proposal_id?: Maybe, - onchain_referendum_id?: Maybe, - onchain_treasury_proposal_id?: Maybe, - post_id?: Maybe, +/** order by variance() on columns of table "poll_votes" */ +export type Poll_Votes_Variance_Order_By = { + id?: Maybe; + poll_id?: Maybe; + user_id?: Maybe; }; -export enum Order_By { - Asc = 'asc', - AscNullsFirst = 'asc_nulls_first', - AscNullsLast = 'asc_nulls_last', - Desc = 'desc', - DescNullsFirst = 'desc_nulls_first', - DescNullsLast = 'desc_nulls_last' -} - -export type PageInfo = { - __typename?: 'PageInfo', - endCursor?: Maybe, - hasNextPage: Scalars['Boolean'], - hasPreviousPage: Scalars['Boolean'], - startCursor?: Maybe, -}; - -export type Poll = { - __typename?: 'poll', - block_end: Scalars['Int'], - created_at: Scalars['timestamp'], - id: Scalars['Int'], - poll_votes: Array, - poll_votes_aggregate: Poll_Votes_Aggregate, - post: Posts, - post_id: Scalars['Int'], - updated_at: Scalars['timestamp'], -}; - - -export type PollPoll_VotesArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type PollPoll_Votes_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - -export type Poll_Aggregate = { - __typename?: 'poll_aggregate', - aggregate?: Maybe, - nodes: Array, -}; - -export type Poll_Aggregate_Fields = { - __typename?: 'poll_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - - -export type Poll_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe -}; - -export type Poll_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - -export type Poll_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, -}; - -export type Poll_Avg_Fields = { - __typename?: 'poll_avg_fields', - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Avg_Order_By = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - block_end?: Maybe, - created_at?: Maybe, - id?: Maybe, - poll_votes?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, -}; - -export enum Poll_Constraint { - PollPkey = 'poll_pkey' -} - -export type Poll_Inc_Input = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Insert_Input = { - block_end?: Maybe, - created_at?: Maybe, - id?: Maybe, - poll_votes?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, -}; - -export type Poll_Max_Fields = { - __typename?: 'poll_max_fields', - block_end?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, -}; - -export type Poll_Max_Order_By = { - block_end?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, -}; - -export type Poll_Min_Fields = { - __typename?: 'poll_min_fields', - block_end?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, -}; - -export type Poll_Min_Order_By = { - block_end?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, -}; - -export type Poll_Mutation_Response = { - __typename?: 'poll_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, -}; - -export type Poll_Obj_Rel_Insert_Input = { - data: Poll_Insert_Input, - on_conflict?: Maybe, -}; - -export type Poll_On_Conflict = { - constraint: Poll_Constraint, - update_columns: Array, - where?: Maybe, -}; - -export type Poll_Order_By = { - block_end?: Maybe, - created_at?: Maybe, - id?: Maybe, - poll_votes_aggregate?: Maybe, - post?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, -}; - -export type Poll_Pk_Columns_Input = { - id: Scalars['Int'], -}; - -export enum Poll_Select_Column { - BlockEnd = 'block_end', - CreatedAt = 'created_at', - Id = 'id', - PostId = 'post_id', - UpdatedAt = 'updated_at' -} - -export type Poll_Set_Input = { - block_end?: Maybe, - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, -}; - -export type Poll_Stddev_Fields = { - __typename?: 'poll_stddev_fields', - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Stddev_Order_By = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Stddev_Pop_Fields = { - __typename?: 'poll_stddev_pop_fields', - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Stddev_Pop_Order_By = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Stddev_Samp_Fields = { - __typename?: 'poll_stddev_samp_fields', - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Stddev_Samp_Order_By = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Sum_Fields = { - __typename?: 'poll_sum_fields', - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Sum_Order_By = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export enum Poll_Update_Column { - BlockEnd = 'block_end', - CreatedAt = 'created_at', - Id = 'id', - PostId = 'post_id', - UpdatedAt = 'updated_at' -} - -export type Poll_Var_Pop_Fields = { - __typename?: 'poll_var_pop_fields', - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Var_Pop_Order_By = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Var_Samp_Fields = { - __typename?: 'poll_var_samp_fields', - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Var_Samp_Order_By = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Variance_Fields = { - __typename?: 'poll_variance_fields', - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Variance_Order_By = { - block_end?: Maybe, - id?: Maybe, - post_id?: Maybe, -}; - -export type Poll_Votes = { - __typename?: 'poll_votes', - created_at: Scalars['timestamp'], - id: Scalars['Int'], - poll: Poll, - poll_id: Scalars['Int'], - updated_at: Scalars['timestamp'], - user_id: Scalars['Int'], - vote: Scalars['bpchar'], - voter?: Maybe, -}; - -export type Poll_Votes_Aggregate = { - __typename?: 'poll_votes_aggregate', - aggregate?: Maybe, - nodes: Array, -}; - -export type Poll_Votes_Aggregate_Fields = { - __typename?: 'poll_votes_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - - -export type Poll_Votes_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe -}; - -export type Poll_Votes_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - -export type Poll_Votes_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, -}; - -export type Poll_Votes_Avg_Fields = { - __typename?: 'poll_votes_avg_fields', - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Avg_Order_By = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - created_at?: Maybe, - id?: Maybe, - poll?: Maybe, - poll_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, - vote?: Maybe, -}; - -export enum Poll_Votes_Constraint { - PollVotesPkey = 'poll_votes_pkey' -} - -export type Poll_Votes_Inc_Input = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Insert_Input = { - created_at?: Maybe, - id?: Maybe, - poll?: Maybe, - poll_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, - vote?: Maybe, -}; - -export type Poll_Votes_Max_Fields = { - __typename?: 'poll_votes_max_fields', - created_at?: Maybe, - id?: Maybe, - poll_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Max_Order_By = { - created_at?: Maybe, - id?: Maybe, - poll_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Min_Fields = { - __typename?: 'poll_votes_min_fields', - created_at?: Maybe, - id?: Maybe, - poll_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Min_Order_By = { - created_at?: Maybe, - id?: Maybe, - poll_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Mutation_Response = { - __typename?: 'poll_votes_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, -}; - -export type Poll_Votes_Obj_Rel_Insert_Input = { - data: Poll_Votes_Insert_Input, - on_conflict?: Maybe, -}; - -export type Poll_Votes_On_Conflict = { - constraint: Poll_Votes_Constraint, - update_columns: Array, - where?: Maybe, -}; - -export type Poll_Votes_Order_By = { - created_at?: Maybe, - id?: Maybe, - poll?: Maybe, - poll_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, - vote?: Maybe, -}; - -export type Poll_Votes_Pk_Columns_Input = { - id: Scalars['Int'], -}; - -export enum Poll_Votes_Select_Column { - CreatedAt = 'created_at', - Id = 'id', - PollId = 'poll_id', - UpdatedAt = 'updated_at', - UserId = 'user_id', - Vote = 'vote' -} - -export type Poll_Votes_Set_Input = { - created_at?: Maybe, - id?: Maybe, - poll_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, - vote?: Maybe, -}; - -export type Poll_Votes_Stddev_Fields = { - __typename?: 'poll_votes_stddev_fields', - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Stddev_Order_By = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Stddev_Pop_Fields = { - __typename?: 'poll_votes_stddev_pop_fields', - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Stddev_Pop_Order_By = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Stddev_Samp_Fields = { - __typename?: 'poll_votes_stddev_samp_fields', - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Stddev_Samp_Order_By = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Sum_Fields = { - __typename?: 'poll_votes_sum_fields', - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Sum_Order_By = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export enum Poll_Votes_Update_Column { - CreatedAt = 'created_at', - Id = 'id', - PollId = 'poll_id', - UpdatedAt = 'updated_at', - UserId = 'user_id', - Vote = 'vote' -} - -export type Poll_Votes_Var_Pop_Fields = { - __typename?: 'poll_votes_var_pop_fields', - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Var_Pop_Order_By = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Var_Samp_Fields = { - __typename?: 'poll_votes_var_samp_fields', - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Var_Samp_Order_By = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Variance_Fields = { - __typename?: 'poll_votes_variance_fields', - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Poll_Votes_Variance_Order_By = { - id?: Maybe, - poll_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions = { - __typename?: 'post_reactions', - created_at: Scalars['timestamp'], - id: Scalars['Int'], - post: Posts, - post_id: Scalars['Int'], - reacting_user?: Maybe, - reaction: Scalars['bpchar'], - updated_at: Scalars['timestamp'], - user_id: Scalars['Int'], -}; - -export type Post_Reactions_Aggregate = { - __typename?: 'post_reactions_aggregate', - aggregate?: Maybe, - nodes: Array, -}; - -export type Post_Reactions_Aggregate_Fields = { - __typename?: 'post_reactions_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - - -export type Post_Reactions_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe -}; - -export type Post_Reactions_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - -export type Post_Reactions_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, -}; - -export type Post_Reactions_Avg_Fields = { - __typename?: 'post_reactions_avg_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Avg_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - created_at?: Maybe, - id?: Maybe, - post?: Maybe, - post_id?: Maybe, - reaction?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export enum Post_Reactions_Constraint { - PostReactionsPkey = 'post_reactions_pkey' -} - -export type Post_Reactions_Inc_Input = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Insert_Input = { - created_at?: Maybe, - id?: Maybe, - post?: Maybe, - post_id?: Maybe, - reaction?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Max_Fields = { - __typename?: 'post_reactions_max_fields', - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Max_Order_By = { - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Min_Fields = { - __typename?: 'post_reactions_min_fields', - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Min_Order_By = { - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Mutation_Response = { - __typename?: 'post_reactions_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, -}; - -export type Post_Reactions_Obj_Rel_Insert_Input = { - data: Post_Reactions_Insert_Input, - on_conflict?: Maybe, -}; - -export type Post_Reactions_On_Conflict = { - constraint: Post_Reactions_Constraint, - update_columns: Array, - where?: Maybe, -}; - -export type Post_Reactions_Order_By = { - created_at?: Maybe, - id?: Maybe, - post?: Maybe, - post_id?: Maybe, - reaction?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Pk_Columns_Input = { - id: Scalars['Int'], -}; - -export enum Post_Reactions_Select_Column { - CreatedAt = 'created_at', - Id = 'id', - PostId = 'post_id', - Reaction = 'reaction', - UpdatedAt = 'updated_at', - UserId = 'user_id' -} - -export type Post_Reactions_Set_Input = { - created_at?: Maybe, - id?: Maybe, - post_id?: Maybe, - reaction?: Maybe, - updated_at?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Stddev_Fields = { - __typename?: 'post_reactions_stddev_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Stddev_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Stddev_Pop_Fields = { - __typename?: 'post_reactions_stddev_pop_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Stddev_Pop_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Stddev_Samp_Fields = { - __typename?: 'post_reactions_stddev_samp_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Stddev_Samp_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Sum_Fields = { - __typename?: 'post_reactions_sum_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Sum_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export enum Post_Reactions_Update_Column { - CreatedAt = 'created_at', - Id = 'id', - PostId = 'post_id', - Reaction = 'reaction', - UpdatedAt = 'updated_at', - UserId = 'user_id' -} - -export type Post_Reactions_Var_Pop_Fields = { - __typename?: 'post_reactions_var_pop_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Var_Pop_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Var_Samp_Fields = { - __typename?: 'post_reactions_var_samp_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Var_Samp_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Variance_Fields = { - __typename?: 'post_reactions_variance_fields', - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Reactions_Variance_Order_By = { - id?: Maybe, - post_id?: Maybe, - user_id?: Maybe, -}; - -export type Post_Topics = { - __typename?: 'post_topics', - id: Scalars['Int'], - name: Scalars['String'], - posts: Array, - posts_aggregate: Posts_Aggregate, -}; - - -export type Post_TopicsPostsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Post_TopicsPosts_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - -export type Post_Topics_Aggregate = { - __typename?: 'post_topics_aggregate', - aggregate?: Maybe, - nodes: Array, -}; - -export type Post_Topics_Aggregate_Fields = { - __typename?: 'post_topics_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - - -export type Post_Topics_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe -}; - -export type Post_Topics_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - -export type Post_Topics_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, -}; - -export type Post_Topics_Avg_Fields = { - __typename?: 'post_topics_avg_fields', - id?: Maybe, -}; - -export type Post_Topics_Avg_Order_By = { - id?: Maybe, -}; - -export type Post_Topics_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - id?: Maybe, - name?: Maybe, - posts?: Maybe, -}; - -export enum Post_Topics_Constraint { - CategoriesNameKey = 'categories_name_key', - CategoriesPkey = 'categories_pkey' -} - -export type Post_Topics_Inc_Input = { - id?: Maybe, -}; - -export type Post_Topics_Insert_Input = { - id?: Maybe, - name?: Maybe, - posts?: Maybe, -}; - -export type Post_Topics_Max_Fields = { - __typename?: 'post_topics_max_fields', - id?: Maybe, - name?: Maybe, -}; - -export type Post_Topics_Max_Order_By = { - id?: Maybe, - name?: Maybe, -}; - -export type Post_Topics_Min_Fields = { - __typename?: 'post_topics_min_fields', - id?: Maybe, - name?: Maybe, -}; - -export type Post_Topics_Min_Order_By = { - id?: Maybe, - name?: Maybe, -}; - -export type Post_Topics_Mutation_Response = { - __typename?: 'post_topics_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, -}; - -export type Post_Topics_Obj_Rel_Insert_Input = { - data: Post_Topics_Insert_Input, - on_conflict?: Maybe, -}; - -export type Post_Topics_On_Conflict = { - constraint: Post_Topics_Constraint, - update_columns: Array, - where?: Maybe, -}; - -export type Post_Topics_Order_By = { - id?: Maybe, - name?: Maybe, - posts_aggregate?: Maybe, -}; - -export type Post_Topics_Pk_Columns_Input = { - id: Scalars['Int'], -}; - -export enum Post_Topics_Select_Column { - Id = 'id', - Name = 'name' -} - -export type Post_Topics_Set_Input = { - id?: Maybe, - name?: Maybe, -}; - -export type Post_Topics_Stddev_Fields = { - __typename?: 'post_topics_stddev_fields', - id?: Maybe, -}; - -export type Post_Topics_Stddev_Order_By = { - id?: Maybe, -}; - -export type Post_Topics_Stddev_Pop_Fields = { - __typename?: 'post_topics_stddev_pop_fields', - id?: Maybe, -}; - -export type Post_Topics_Stddev_Pop_Order_By = { - id?: Maybe, -}; - -export type Post_Topics_Stddev_Samp_Fields = { - __typename?: 'post_topics_stddev_samp_fields', - id?: Maybe, -}; - -export type Post_Topics_Stddev_Samp_Order_By = { - id?: Maybe, -}; - -export type Post_Topics_Sum_Fields = { - __typename?: 'post_topics_sum_fields', - id?: Maybe, -}; - -export type Post_Topics_Sum_Order_By = { - id?: Maybe, -}; - -export enum Post_Topics_Update_Column { - Id = 'id', - Name = 'name' -} - -export type Post_Topics_Var_Pop_Fields = { - __typename?: 'post_topics_var_pop_fields', - id?: Maybe, -}; - -export type Post_Topics_Var_Pop_Order_By = { - id?: Maybe, -}; - -export type Post_Topics_Var_Samp_Fields = { - __typename?: 'post_topics_var_samp_fields', - id?: Maybe, -}; - -export type Post_Topics_Var_Samp_Order_By = { - id?: Maybe, -}; - -export type Post_Topics_Variance_Fields = { - __typename?: 'post_topics_variance_fields', - id?: Maybe, -}; - -export type Post_Topics_Variance_Order_By = { - id?: Maybe, -}; - -export type Post_Types = { - __typename?: 'post_types', - id: Scalars['Int'], - name: Scalars['String'], - posts: Array, - posts_aggregate: Posts_Aggregate, -}; - - -export type Post_TypesPostsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Post_TypesPosts_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - -export type Post_Types_Aggregate = { - __typename?: 'post_types_aggregate', - aggregate?: Maybe, - nodes: Array, -}; - -export type Post_Types_Aggregate_Fields = { - __typename?: 'post_types_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - - -export type Post_Types_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe -}; - -export type Post_Types_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - -export type Post_Types_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, -}; - -export type Post_Types_Avg_Fields = { - __typename?: 'post_types_avg_fields', - id?: Maybe, -}; - -export type Post_Types_Avg_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - id?: Maybe, - name?: Maybe, - posts?: Maybe, -}; - -export enum Post_Types_Constraint { - PostTypesNameKey = 'post_types_name_key', - PostTypesPkey = 'post_types_pkey' -} - -export type Post_Types_Inc_Input = { - id?: Maybe, -}; - -export type Post_Types_Insert_Input = { - id?: Maybe, - name?: Maybe, - posts?: Maybe, -}; - -export type Post_Types_Max_Fields = { - __typename?: 'post_types_max_fields', - id?: Maybe, - name?: Maybe, -}; - -export type Post_Types_Max_Order_By = { - id?: Maybe, - name?: Maybe, -}; - -export type Post_Types_Min_Fields = { - __typename?: 'post_types_min_fields', - id?: Maybe, - name?: Maybe, -}; - -export type Post_Types_Min_Order_By = { - id?: Maybe, - name?: Maybe, -}; - -export type Post_Types_Mutation_Response = { - __typename?: 'post_types_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, -}; - -export type Post_Types_Obj_Rel_Insert_Input = { - data: Post_Types_Insert_Input, - on_conflict?: Maybe, -}; - -export type Post_Types_On_Conflict = { - constraint: Post_Types_Constraint, - update_columns: Array, - where?: Maybe, -}; - -export type Post_Types_Order_By = { - id?: Maybe, - name?: Maybe, - posts_aggregate?: Maybe, -}; - -export type Post_Types_Pk_Columns_Input = { - id: Scalars['Int'], -}; - -export enum Post_Types_Select_Column { - Id = 'id', - Name = 'name' -} - -export type Post_Types_Set_Input = { - id?: Maybe, - name?: Maybe, -}; - -export type Post_Types_Stddev_Fields = { - __typename?: 'post_types_stddev_fields', - id?: Maybe, -}; - -export type Post_Types_Stddev_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Stddev_Pop_Fields = { - __typename?: 'post_types_stddev_pop_fields', - id?: Maybe, -}; - -export type Post_Types_Stddev_Pop_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Stddev_Samp_Fields = { - __typename?: 'post_types_stddev_samp_fields', - id?: Maybe, -}; - -export type Post_Types_Stddev_Samp_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Sum_Fields = { - __typename?: 'post_types_sum_fields', - id?: Maybe, -}; - -export type Post_Types_Sum_Order_By = { - id?: Maybe, -}; - -export enum Post_Types_Update_Column { - Id = 'id', - Name = 'name' -} - -export type Post_Types_Var_Pop_Fields = { - __typename?: 'post_types_var_pop_fields', - id?: Maybe, -}; - -export type Post_Types_Var_Pop_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Var_Samp_Fields = { - __typename?: 'post_types_var_samp_fields', - id?: Maybe, -}; - -export type Post_Types_Var_Samp_Order_By = { - id?: Maybe, -}; - -export type Post_Types_Variance_Fields = { - __typename?: 'post_types_variance_fields', - id?: Maybe, -}; - -export type Post_Types_Variance_Order_By = { - id?: Maybe, -}; - -export type Posts = { - __typename?: 'posts', - author?: Maybe, - author_id: Scalars['Int'], - comments: Array, - comments_aggregate: Comments_Aggregate, - content?: Maybe, - created_at: Scalars['timestamptz'], - id: Scalars['Int'], - onchain_link?: Maybe, - poll?: Maybe, - post_reactions: Array, - post_reactions_aggregate: Post_Reactions_Aggregate, - title?: Maybe, - topic: Post_Topics, - topic_id: Scalars['Int'], - type: Post_Types, - type_id: Scalars['Int'], - updated_at: Scalars['timestamptz'], -}; - - -export type PostsCommentsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type PostsComments_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type PostsPost_ReactionsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type PostsPost_Reactions_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - -export type Posts_Aggregate = { - __typename?: 'posts_aggregate', - aggregate?: Maybe, - nodes: Array, -}; - -export type Posts_Aggregate_Fields = { - __typename?: 'posts_aggregate_fields', - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - - -export type Posts_Aggregate_FieldsCountArgs = { - columns?: Maybe>, - distinct?: Maybe -}; - -export type Posts_Aggregate_Order_By = { - avg?: Maybe, - count?: Maybe, - max?: Maybe, - min?: Maybe, - stddev?: Maybe, - stddev_pop?: Maybe, - stddev_samp?: Maybe, - sum?: Maybe, - var_pop?: Maybe, - var_samp?: Maybe, - variance?: Maybe, -}; - -export type Posts_Arr_Rel_Insert_Input = { - data: Array, - on_conflict?: Maybe, -}; - -export type Posts_Avg_Fields = { - __typename?: 'posts_avg_fields', - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Avg_Order_By = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Bool_Exp = { - _and?: Maybe>>, - _not?: Maybe, - _or?: Maybe>>, - author_id?: Maybe, - comments?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - onchain_link?: Maybe, - poll?: Maybe, - post_reactions?: Maybe, - title?: Maybe, - topic?: Maybe, - topic_id?: Maybe, - type?: Maybe, - type_id?: Maybe, - updated_at?: Maybe, -}; - -export enum Posts_Constraint { - MessagesPkey = 'messages_pkey' -} - -export type Posts_Inc_Input = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Insert_Input = { - author_id?: Maybe, - comments?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - onchain_link?: Maybe, - poll?: Maybe, - post_reactions?: Maybe, - title?: Maybe, - topic?: Maybe, - topic_id?: Maybe, - type?: Maybe, - type_id?: Maybe, - updated_at?: Maybe, -}; - -export type Posts_Max_Fields = { - __typename?: 'posts_max_fields', - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - title?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, - updated_at?: Maybe, -}; - -export type Posts_Max_Order_By = { - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - title?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, - updated_at?: Maybe, -}; - -export type Posts_Min_Fields = { - __typename?: 'posts_min_fields', - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - title?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, - updated_at?: Maybe, -}; - -export type Posts_Min_Order_By = { - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - title?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, - updated_at?: Maybe, -}; - -export type Posts_Mutation_Response = { - __typename?: 'posts_mutation_response', - affected_rows: Scalars['Int'], - returning: Array, -}; - -export type Posts_Obj_Rel_Insert_Input = { - data: Posts_Insert_Input, - on_conflict?: Maybe, -}; - -export type Posts_On_Conflict = { - constraint: Posts_Constraint, - update_columns: Array, - where?: Maybe, -}; - -export type Posts_Order_By = { - author_id?: Maybe, - comments_aggregate?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - onchain_link?: Maybe, - poll?: Maybe, - post_reactions_aggregate?: Maybe, - title?: Maybe, - topic?: Maybe, - topic_id?: Maybe, - type?: Maybe, - type_id?: Maybe, - updated_at?: Maybe, -}; - -export type Posts_Pk_Columns_Input = { - id: Scalars['Int'], -}; - -export enum Posts_Select_Column { - AuthorId = 'author_id', - Content = 'content', - CreatedAt = 'created_at', - Id = 'id', - Title = 'title', - TopicId = 'topic_id', - TypeId = 'type_id', - UpdatedAt = 'updated_at' -} - -export type Posts_Set_Input = { - author_id?: Maybe, - content?: Maybe, - created_at?: Maybe, - id?: Maybe, - title?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, - updated_at?: Maybe, -}; - -export type Posts_Stddev_Fields = { - __typename?: 'posts_stddev_fields', - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Stddev_Order_By = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Stddev_Pop_Fields = { - __typename?: 'posts_stddev_pop_fields', - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Stddev_Pop_Order_By = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Stddev_Samp_Fields = { - __typename?: 'posts_stddev_samp_fields', - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Stddev_Samp_Order_By = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Sum_Fields = { - __typename?: 'posts_sum_fields', - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Sum_Order_By = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export enum Posts_Update_Column { - AuthorId = 'author_id', - Content = 'content', - CreatedAt = 'created_at', - Id = 'id', - Title = 'title', - TopicId = 'topic_id', - TypeId = 'type_id', - UpdatedAt = 'updated_at' -} - -export type Posts_Var_Pop_Fields = { - __typename?: 'posts_var_pop_fields', - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Var_Pop_Order_By = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Var_Samp_Fields = { - __typename?: 'posts_var_samp_fields', - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Var_Samp_Order_By = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Variance_Fields = { - __typename?: 'posts_variance_fields', - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Posts_Variance_Order_By = { - author_id?: Maybe, - id?: Maybe, - topic_id?: Maybe, - type_id?: Maybe, -}; - -export type Preimage = Node & { - __typename?: 'Preimage', - author: Scalars['String'], - depositAmount: Scalars['String'], - hash: Scalars['String'], - id: Scalars['ID'], - metaDescription: Scalars['String'], - method: Scalars['String'], - motion?: Maybe, - preimageArguments?: Maybe>, - preimageStatus?: Maybe>, - proposal?: Maybe, - referendum?: Maybe, - section: Scalars['String'], -}; - - -export type PreimagePreimageArgumentsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type PreimagePreimageStatusArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - -export type PreimageArgument = Node & { - __typename?: 'PreimageArgument', - id: Scalars['ID'], - name: Scalars['String'], - preimage: Preimage, - value: Scalars['String'], -}; - -export type PreimageArgumentConnection = { - __typename?: 'PreimageArgumentConnection', - aggregate: AggregatePreimageArgument, - edges: Array>, - pageInfo: PageInfo, -}; - -export type PreimageArgumentCreateInput = { - id?: Maybe, - name: Scalars['String'], - preimage: PreimageCreateOneWithoutPreimageArgumentsInput, - value: Scalars['String'], -}; - -export type PreimageArgumentCreateManyWithoutPreimageInput = { - connect?: Maybe>, - create?: Maybe>, -}; - -export type PreimageArgumentCreateWithoutPreimageInput = { - id?: Maybe, - name: Scalars['String'], - value: Scalars['String'], -}; - -export type PreimageArgumentEdge = { - __typename?: 'PreimageArgumentEdge', - cursor: Scalars['String'], - node: PreimageArgument, -}; - -export enum PreimageArgumentOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - NameAsc = 'name_ASC', - NameDesc = 'name_DESC', - ValueAsc = 'value_ASC', - ValueDesc = 'value_DESC' -} - -export type PreimageArgumentPreviousValues = { - __typename?: 'PreimageArgumentPreviousValues', - id: Scalars['ID'], - name: Scalars['String'], - value: Scalars['String'], -}; - -export type PreimageArgumentScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - name?: Maybe, - name_contains?: Maybe, - name_ends_with?: Maybe, - name_gt?: Maybe, - name_gte?: Maybe, - name_in?: Maybe>, - name_lt?: Maybe, - name_lte?: Maybe, - name_not?: Maybe, - name_not_contains?: Maybe, - name_not_ends_with?: Maybe, - name_not_in?: Maybe>, - name_not_starts_with?: Maybe, - name_starts_with?: Maybe, - value?: Maybe, - value_contains?: Maybe, - value_ends_with?: Maybe, - value_gt?: Maybe, - value_gte?: Maybe, - value_in?: Maybe>, - value_lt?: Maybe, - value_lte?: Maybe, - value_not?: Maybe, - value_not_contains?: Maybe, - value_not_ends_with?: Maybe, - value_not_in?: Maybe>, - value_not_starts_with?: Maybe, - value_starts_with?: Maybe, -}; - -export type PreimageArgumentSubscriptionPayload = { - __typename?: 'PreimageArgumentSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; - -export type PreimageArgumentSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type PreimageArgumentUpdateInput = { - name?: Maybe, - preimage?: Maybe, - value?: Maybe, -}; - -export type PreimageArgumentUpdateManyDataInput = { - name?: Maybe, - value?: Maybe, -}; - -export type PreimageArgumentUpdateManyMutationInput = { - name?: Maybe, - value?: Maybe, -}; - -export type PreimageArgumentUpdateManyWithoutPreimageInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - updateMany?: Maybe>, - upsert?: Maybe>, -}; - -export type PreimageArgumentUpdateManyWithWhereNestedInput = { - data: PreimageArgumentUpdateManyDataInput, - where: PreimageArgumentScalarWhereInput, -}; - -export type PreimageArgumentUpdateWithoutPreimageDataInput = { - name?: Maybe, - value?: Maybe, -}; - -export type PreimageArgumentUpdateWithWhereUniqueWithoutPreimageInput = { - data: PreimageArgumentUpdateWithoutPreimageDataInput, - where: PreimageArgumentWhereUniqueInput, -}; - -export type PreimageArgumentUpsertWithWhereUniqueWithoutPreimageInput = { - create: PreimageArgumentCreateWithoutPreimageInput, - update: PreimageArgumentUpdateWithoutPreimageDataInput, - where: PreimageArgumentWhereUniqueInput, -}; - -export type PreimageArgumentWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - name?: Maybe, - name_contains?: Maybe, - name_ends_with?: Maybe, - name_gt?: Maybe, - name_gte?: Maybe, - name_in?: Maybe>, - name_lt?: Maybe, - name_lte?: Maybe, - name_not?: Maybe, - name_not_contains?: Maybe, - name_not_ends_with?: Maybe, - name_not_in?: Maybe>, - name_not_starts_with?: Maybe, - name_starts_with?: Maybe, - preimage?: Maybe, - value?: Maybe, - value_contains?: Maybe, - value_ends_with?: Maybe, - value_gt?: Maybe, - value_gte?: Maybe, - value_in?: Maybe>, - value_lt?: Maybe, - value_lte?: Maybe, - value_not?: Maybe, - value_not_contains?: Maybe, - value_not_ends_with?: Maybe, - value_not_in?: Maybe>, - value_not_starts_with?: Maybe, - value_starts_with?: Maybe, -}; - -export type PreimageArgumentWhereUniqueInput = { - id?: Maybe, -}; - -export type PreimageConnection = { - __typename?: 'PreimageConnection', - aggregate: AggregatePreimage, - edges: Array>, - pageInfo: PageInfo, -}; - -export type PreimageCreateInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - hash: Scalars['String'], - id?: Maybe, - metaDescription: Scalars['String'], - method: Scalars['String'], - motion?: Maybe, - preimageArguments?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section: Scalars['String'], -}; - -export type PreimageCreateOneWithoutMotionInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type PreimageCreateOneWithoutPreimageArgumentsInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type PreimageCreateOneWithoutPreimageStatusInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type PreimageCreateOneWithoutProposalInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type PreimageCreateOneWithoutReferendumInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type PreimageCreateWithoutMotionInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - hash: Scalars['String'], - id?: Maybe, - metaDescription: Scalars['String'], - method: Scalars['String'], - preimageArguments?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section: Scalars['String'], -}; - -export type PreimageCreateWithoutPreimageArgumentsInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - hash: Scalars['String'], - id?: Maybe, - metaDescription: Scalars['String'], - method: Scalars['String'], - motion?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section: Scalars['String'], -}; - -export type PreimageCreateWithoutPreimageStatusInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - hash: Scalars['String'], - id?: Maybe, - metaDescription: Scalars['String'], - method: Scalars['String'], - motion?: Maybe, - preimageArguments?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section: Scalars['String'], -}; - -export type PreimageCreateWithoutProposalInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - hash: Scalars['String'], - id?: Maybe, - metaDescription: Scalars['String'], - method: Scalars['String'], - motion?: Maybe, - preimageArguments?: Maybe, - preimageStatus?: Maybe, - referendum?: Maybe, - section: Scalars['String'], -}; - -export type PreimageCreateWithoutReferendumInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - hash: Scalars['String'], - id?: Maybe, - metaDescription: Scalars['String'], - method: Scalars['String'], - motion?: Maybe, - preimageArguments?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - section: Scalars['String'], -}; - -export type PreimageEdge = { - __typename?: 'PreimageEdge', - cursor: Scalars['String'], - node: Preimage, -}; - -export enum PreimageOrderByInput { - AuthorAsc = 'author_ASC', - AuthorDesc = 'author_DESC', - DepositAmountAsc = 'depositAmount_ASC', - DepositAmountDesc = 'depositAmount_DESC', - HashAsc = 'hash_ASC', - HashDesc = 'hash_DESC', - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - MetaDescriptionAsc = 'metaDescription_ASC', - MetaDescriptionDesc = 'metaDescription_DESC', - MethodAsc = 'method_ASC', - MethodDesc = 'method_DESC', - SectionAsc = 'section_ASC', - SectionDesc = 'section_DESC' -} - -export type PreimagePreviousValues = { - __typename?: 'PreimagePreviousValues', - author: Scalars['String'], - depositAmount: Scalars['String'], - hash: Scalars['String'], - id: Scalars['ID'], - metaDescription: Scalars['String'], - method: Scalars['String'], - section: Scalars['String'], -}; - -export type PreimageStatus = Node & { - __typename?: 'PreimageStatus', - blockNumber: BlockNumber, - id: Scalars['ID'], - preimage: Preimage, - status: Scalars['String'], -}; - -export type PreimageStatusConnection = { - __typename?: 'PreimageStatusConnection', - aggregate: AggregatePreimageStatus, - edges: Array>, - pageInfo: PageInfo, -}; - -export type PreimageStatusCreateInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - preimage: PreimageCreateOneWithoutPreimageStatusInput, - status: Scalars['String'], -}; - -export type PreimageStatusCreateManyWithoutPreimageInput = { - connect?: Maybe>, - create?: Maybe>, -}; - -export type PreimageStatusCreateWithoutPreimageInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - status: Scalars['String'], -}; - -export type PreimageStatusEdge = { - __typename?: 'PreimageStatusEdge', - cursor: Scalars['String'], - node: PreimageStatus, -}; - -export enum PreimageStatusOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - StatusAsc = 'status_ASC', - StatusDesc = 'status_DESC' -} - -export type PreimageStatusPreviousValues = { - __typename?: 'PreimageStatusPreviousValues', - id: Scalars['ID'], - status: Scalars['String'], -}; - -export type PreimageStatusScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, -}; - -export type PreimageStatusSubscriptionPayload = { - __typename?: 'PreimageStatusSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; - -export type PreimageStatusSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type PreimageStatusUpdateInput = { - blockNumber?: Maybe, - preimage?: Maybe, - status?: Maybe, -}; - -export type PreimageStatusUpdateManyDataInput = { - status?: Maybe, -}; - -export type PreimageStatusUpdateManyMutationInput = { - status?: Maybe, -}; - -export type PreimageStatusUpdateManyWithoutPreimageInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - updateMany?: Maybe>, - upsert?: Maybe>, -}; - -export type PreimageStatusUpdateManyWithWhereNestedInput = { - data: PreimageStatusUpdateManyDataInput, - where: PreimageStatusScalarWhereInput, -}; - -export type PreimageStatusUpdateWithoutPreimageDataInput = { - blockNumber?: Maybe, - status?: Maybe, -}; - -export type PreimageStatusUpdateWithWhereUniqueWithoutPreimageInput = { - data: PreimageStatusUpdateWithoutPreimageDataInput, - where: PreimageStatusWhereUniqueInput, -}; - -export type PreimageStatusUpsertWithWhereUniqueWithoutPreimageInput = { - create: PreimageStatusCreateWithoutPreimageInput, - update: PreimageStatusUpdateWithoutPreimageDataInput, - where: PreimageStatusWhereUniqueInput, -}; - -export type PreimageStatusWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - preimage?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, -}; - -export type PreimageStatusWhereUniqueInput = { - id?: Maybe, -}; - -export type PreimageSubscriptionPayload = { - __typename?: 'PreimageSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; - -export type PreimageSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type PreimageUpdateInput = { - author?: Maybe, - depositAmount?: Maybe, - hash?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motion?: Maybe, - preimageArguments?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section?: Maybe, -}; - -export type PreimageUpdateManyMutationInput = { - author?: Maybe, - depositAmount?: Maybe, - hash?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - section?: Maybe, -}; - -export type PreimageUpdateOneRequiredWithoutPreimageArgumentsInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type PreimageUpdateOneRequiredWithoutPreimageStatusInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type PreimageUpdateOneWithoutMotionInput = { - connect?: Maybe, - create?: Maybe, - delete?: Maybe, - disconnect?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type PreimageUpdateOneWithoutProposalInput = { - connect?: Maybe, - create?: Maybe, - delete?: Maybe, - disconnect?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type PreimageUpdateOneWithoutReferendumInput = { - connect?: Maybe, - create?: Maybe, - delete?: Maybe, - disconnect?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type PreimageUpdateWithoutMotionDataInput = { - author?: Maybe, - depositAmount?: Maybe, - hash?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - preimageArguments?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section?: Maybe, -}; - -export type PreimageUpdateWithoutPreimageArgumentsDataInput = { - author?: Maybe, - depositAmount?: Maybe, - hash?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motion?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section?: Maybe, -}; - -export type PreimageUpdateWithoutPreimageStatusDataInput = { - author?: Maybe, - depositAmount?: Maybe, - hash?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motion?: Maybe, - preimageArguments?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section?: Maybe, -}; - -export type PreimageUpdateWithoutProposalDataInput = { - author?: Maybe, - depositAmount?: Maybe, - hash?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motion?: Maybe, - preimageArguments?: Maybe, - preimageStatus?: Maybe, - referendum?: Maybe, - section?: Maybe, -}; - -export type PreimageUpdateWithoutReferendumDataInput = { - author?: Maybe, - depositAmount?: Maybe, - hash?: Maybe, - metaDescription?: Maybe, - method?: Maybe, - motion?: Maybe, - preimageArguments?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - section?: Maybe, -}; - -export type PreimageUpsertWithoutMotionInput = { - create: PreimageCreateWithoutMotionInput, - update: PreimageUpdateWithoutMotionDataInput, -}; - -export type PreimageUpsertWithoutPreimageArgumentsInput = { - create: PreimageCreateWithoutPreimageArgumentsInput, - update: PreimageUpdateWithoutPreimageArgumentsDataInput, -}; - -export type PreimageUpsertWithoutPreimageStatusInput = { - create: PreimageCreateWithoutPreimageStatusInput, - update: PreimageUpdateWithoutPreimageStatusDataInput, -}; - -export type PreimageUpsertWithoutProposalInput = { - create: PreimageCreateWithoutProposalInput, - update: PreimageUpdateWithoutProposalDataInput, -}; - -export type PreimageUpsertWithoutReferendumInput = { - create: PreimageCreateWithoutReferendumInput, - update: PreimageUpdateWithoutReferendumDataInput, -}; - -export type PreimageWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - author?: Maybe, - author_contains?: Maybe, - author_ends_with?: Maybe, - author_gt?: Maybe, - author_gte?: Maybe, - author_in?: Maybe>, - author_lt?: Maybe, - author_lte?: Maybe, - author_not?: Maybe, - author_not_contains?: Maybe, - author_not_ends_with?: Maybe, - author_not_in?: Maybe>, - author_not_starts_with?: Maybe, - author_starts_with?: Maybe, - depositAmount?: Maybe, - depositAmount_contains?: Maybe, - depositAmount_ends_with?: Maybe, - depositAmount_gt?: Maybe, - depositAmount_gte?: Maybe, - depositAmount_in?: Maybe>, - depositAmount_lt?: Maybe, - depositAmount_lte?: Maybe, - depositAmount_not?: Maybe, - depositAmount_not_contains?: Maybe, - depositAmount_not_ends_with?: Maybe, - depositAmount_not_in?: Maybe>, - depositAmount_not_starts_with?: Maybe, - depositAmount_starts_with?: Maybe, - hash?: Maybe, - hash_contains?: Maybe, - hash_ends_with?: Maybe, - hash_gt?: Maybe, - hash_gte?: Maybe, - hash_in?: Maybe>, - hash_lt?: Maybe, - hash_lte?: Maybe, - hash_not?: Maybe, - hash_not_contains?: Maybe, - hash_not_ends_with?: Maybe, - hash_not_in?: Maybe>, - hash_not_starts_with?: Maybe, - hash_starts_with?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - metaDescription?: Maybe, - metaDescription_contains?: Maybe, - metaDescription_ends_with?: Maybe, - metaDescription_gt?: Maybe, - metaDescription_gte?: Maybe, - metaDescription_in?: Maybe>, - metaDescription_lt?: Maybe, - metaDescription_lte?: Maybe, - metaDescription_not?: Maybe, - metaDescription_not_contains?: Maybe, - metaDescription_not_ends_with?: Maybe, - metaDescription_not_in?: Maybe>, - metaDescription_not_starts_with?: Maybe, - metaDescription_starts_with?: Maybe, - method?: Maybe, - method_contains?: Maybe, - method_ends_with?: Maybe, - method_gt?: Maybe, - method_gte?: Maybe, - method_in?: Maybe>, - method_lt?: Maybe, - method_lte?: Maybe, - method_not?: Maybe, - method_not_contains?: Maybe, - method_not_ends_with?: Maybe, - method_not_in?: Maybe>, - method_not_starts_with?: Maybe, - method_starts_with?: Maybe, - motion?: Maybe, - preimageArguments_every?: Maybe, - preimageArguments_none?: Maybe, - preimageArguments_some?: Maybe, - preimageStatus_every?: Maybe, - preimageStatus_none?: Maybe, - preimageStatus_some?: Maybe, - proposal?: Maybe, - referendum?: Maybe, - section?: Maybe, - section_contains?: Maybe, - section_ends_with?: Maybe, - section_gt?: Maybe, - section_gte?: Maybe, - section_in?: Maybe>, - section_lt?: Maybe, - section_lte?: Maybe, - section_not?: Maybe, - section_not_contains?: Maybe, - section_not_ends_with?: Maybe, - section_not_in?: Maybe>, - section_not_starts_with?: Maybe, - section_starts_with?: Maybe, -}; - -export type PreimageWhereUniqueInput = { - id?: Maybe, -}; - -export enum PrismaDatabase { - Default = 'default' -} - -export type Proposal = { - __typename?: 'Proposal', - author: Scalars['String'], - depositAmount: Scalars['String'], - id: Scalars['Int'], - preimage?: Maybe, - preimageHash: Scalars['String'], - proposalId: Scalars['Int'], - proposalStatus?: Maybe>, -}; - - -export type ProposalProposalStatusArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - -export type ProposalConnection = { - __typename?: 'ProposalConnection', - aggregate: AggregateProposal, - edges: Array>, - pageInfo: PageInfo, -}; - -export type ProposalCreateInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - preimage?: Maybe, - preimageHash: Scalars['String'], - proposalId: Scalars['Int'], - proposalStatus?: Maybe, -}; - -export type ProposalCreateOneWithoutPreimageInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type ProposalCreateOneWithoutProposalStatusInput = { - connect?: Maybe, - create?: Maybe, -}; - -export type ProposalCreateWithoutPreimageInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - preimageHash: Scalars['String'], - proposalId: Scalars['Int'], - proposalStatus?: Maybe, -}; - -export type ProposalCreateWithoutProposalStatusInput = { - author: Scalars['String'], - depositAmount: Scalars['String'], - preimage?: Maybe, - preimageHash: Scalars['String'], - proposalId: Scalars['Int'], -}; - -export type ProposalEdge = { - __typename?: 'ProposalEdge', - cursor: Scalars['String'], - node: Proposal, -}; - -export enum ProposalOrderByInput { - AuthorAsc = 'author_ASC', - AuthorDesc = 'author_DESC', - DepositAmountAsc = 'depositAmount_ASC', - DepositAmountDesc = 'depositAmount_DESC', - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - PreimageHashAsc = 'preimageHash_ASC', - PreimageHashDesc = 'preimageHash_DESC', - ProposalIdAsc = 'proposalId_ASC', - ProposalIdDesc = 'proposalId_DESC' -} - -export type ProposalPreviousValues = { - __typename?: 'ProposalPreviousValues', - author: Scalars['String'], - depositAmount: Scalars['String'], - id: Scalars['Int'], - preimageHash: Scalars['String'], - proposalId: Scalars['Int'], -}; - -export type ProposalStatus = Node & { - __typename?: 'ProposalStatus', - blockNumber: BlockNumber, - id: Scalars['ID'], - proposal: Proposal, - status: Scalars['String'], - uniqueStatus: Scalars['String'], -}; - -export type ProposalStatusConnection = { - __typename?: 'ProposalStatusConnection', - aggregate: AggregateProposalStatus, - edges: Array>, - pageInfo: PageInfo, -}; - -export type ProposalStatusCreateInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - proposal: ProposalCreateOneWithoutProposalStatusInput, - status: Scalars['String'], - uniqueStatus: Scalars['String'], -}; - -export type ProposalStatusCreateManyWithoutProposalInput = { - connect?: Maybe>, - create?: Maybe>, -}; - -export type ProposalStatusCreateWithoutProposalInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - status: Scalars['String'], - uniqueStatus: Scalars['String'], -}; - -export type ProposalStatusEdge = { - __typename?: 'ProposalStatusEdge', - cursor: Scalars['String'], - node: ProposalStatus, -}; - -export enum ProposalStatusOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - StatusAsc = 'status_ASC', - StatusDesc = 'status_DESC', - UniqueStatusAsc = 'uniqueStatus_ASC', - UniqueStatusDesc = 'uniqueStatus_DESC' -} - -export type ProposalStatusPreviousValues = { - __typename?: 'ProposalStatusPreviousValues', - id: Scalars['ID'], - status: Scalars['String'], - uniqueStatus: Scalars['String'], -}; - -export type ProposalStatusScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, - uniqueStatus?: Maybe, - uniqueStatus_contains?: Maybe, - uniqueStatus_ends_with?: Maybe, - uniqueStatus_gt?: Maybe, - uniqueStatus_gte?: Maybe, - uniqueStatus_in?: Maybe>, - uniqueStatus_lt?: Maybe, - uniqueStatus_lte?: Maybe, - uniqueStatus_not?: Maybe, - uniqueStatus_not_contains?: Maybe, - uniqueStatus_not_ends_with?: Maybe, - uniqueStatus_not_in?: Maybe>, - uniqueStatus_not_starts_with?: Maybe, - uniqueStatus_starts_with?: Maybe, -}; - -export type ProposalStatusSubscriptionPayload = { - __typename?: 'ProposalStatusSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; - -export type ProposalStatusSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type ProposalStatusUpdateInput = { - blockNumber?: Maybe, - proposal?: Maybe, - status?: Maybe, - uniqueStatus?: Maybe, -}; - -export type ProposalStatusUpdateManyDataInput = { - status?: Maybe, - uniqueStatus?: Maybe, -}; - -export type ProposalStatusUpdateManyMutationInput = { - status?: Maybe, - uniqueStatus?: Maybe, -}; - -export type ProposalStatusUpdateManyWithoutProposalInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - updateMany?: Maybe>, - upsert?: Maybe>, -}; - -export type ProposalStatusUpdateManyWithWhereNestedInput = { - data: ProposalStatusUpdateManyDataInput, - where: ProposalStatusScalarWhereInput, -}; - -export type ProposalStatusUpdateWithoutProposalDataInput = { - blockNumber?: Maybe, - status?: Maybe, - uniqueStatus?: Maybe, -}; - -export type ProposalStatusUpdateWithWhereUniqueWithoutProposalInput = { - data: ProposalStatusUpdateWithoutProposalDataInput, - where: ProposalStatusWhereUniqueInput, -}; - -export type ProposalStatusUpsertWithWhereUniqueWithoutProposalInput = { - create: ProposalStatusCreateWithoutProposalInput, - update: ProposalStatusUpdateWithoutProposalDataInput, - where: ProposalStatusWhereUniqueInput, -}; - -export type ProposalStatusWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - proposal?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, - uniqueStatus?: Maybe, - uniqueStatus_contains?: Maybe, - uniqueStatus_ends_with?: Maybe, - uniqueStatus_gt?: Maybe, - uniqueStatus_gte?: Maybe, - uniqueStatus_in?: Maybe>, - uniqueStatus_lt?: Maybe, - uniqueStatus_lte?: Maybe, - uniqueStatus_not?: Maybe, - uniqueStatus_not_contains?: Maybe, - uniqueStatus_not_ends_with?: Maybe, - uniqueStatus_not_in?: Maybe>, - uniqueStatus_not_starts_with?: Maybe, - uniqueStatus_starts_with?: Maybe, -}; - -export type ProposalStatusWhereUniqueInput = { - id?: Maybe, - uniqueStatus?: Maybe, -}; - -export type ProposalSubscriptionPayload = { - __typename?: 'ProposalSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; - -export type ProposalSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, -}; - -export type ProposalUpdateInput = { - author?: Maybe, - depositAmount?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - proposalId?: Maybe, - proposalStatus?: Maybe, -}; - -export type ProposalUpdateManyMutationInput = { - author?: Maybe, - depositAmount?: Maybe, - preimageHash?: Maybe, - proposalId?: Maybe, -}; - -export type ProposalUpdateOneRequiredWithoutProposalStatusInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type ProposalUpdateOneWithoutPreimageInput = { - connect?: Maybe, - create?: Maybe, - delete?: Maybe, - disconnect?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; - -export type ProposalUpdateWithoutPreimageDataInput = { - author?: Maybe, - depositAmount?: Maybe, - preimageHash?: Maybe, - proposalId?: Maybe, - proposalStatus?: Maybe, -}; - -export type ProposalUpdateWithoutProposalStatusDataInput = { - author?: Maybe, - depositAmount?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - proposalId?: Maybe, -}; - -export type ProposalUpsertWithoutPreimageInput = { - create: ProposalCreateWithoutPreimageInput, - update: ProposalUpdateWithoutPreimageDataInput, -}; - -export type ProposalUpsertWithoutProposalStatusInput = { - create: ProposalCreateWithoutProposalStatusInput, - update: ProposalUpdateWithoutProposalStatusDataInput, -}; - -export type ProposalWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - author?: Maybe, - author_contains?: Maybe, - author_ends_with?: Maybe, - author_gt?: Maybe, - author_gte?: Maybe, - author_in?: Maybe>, - author_lt?: Maybe, - author_lte?: Maybe, - author_not?: Maybe, - author_not_contains?: Maybe, - author_not_ends_with?: Maybe, - author_not_in?: Maybe>, - author_not_starts_with?: Maybe, - author_starts_with?: Maybe, - depositAmount?: Maybe, - depositAmount_contains?: Maybe, - depositAmount_ends_with?: Maybe, - depositAmount_gt?: Maybe, - depositAmount_gte?: Maybe, - depositAmount_in?: Maybe>, - depositAmount_lt?: Maybe, - depositAmount_lte?: Maybe, - depositAmount_not?: Maybe, - depositAmount_not_contains?: Maybe, - depositAmount_not_ends_with?: Maybe, - depositAmount_not_in?: Maybe>, - depositAmount_not_starts_with?: Maybe, - depositAmount_starts_with?: Maybe, - id?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_in?: Maybe>, - preimage?: Maybe, - preimageHash?: Maybe, - preimageHash_contains?: Maybe, - preimageHash_ends_with?: Maybe, - preimageHash_gt?: Maybe, - preimageHash_gte?: Maybe, - preimageHash_in?: Maybe>, - preimageHash_lt?: Maybe, - preimageHash_lte?: Maybe, - preimageHash_not?: Maybe, - preimageHash_not_contains?: Maybe, - preimageHash_not_ends_with?: Maybe, - preimageHash_not_in?: Maybe>, - preimageHash_not_starts_with?: Maybe, - preimageHash_starts_with?: Maybe, - proposalId?: Maybe, - proposalId_gt?: Maybe, - proposalId_gte?: Maybe, - proposalId_in?: Maybe>, - proposalId_lt?: Maybe, - proposalId_lte?: Maybe, - proposalId_not?: Maybe, - proposalId_not_in?: Maybe>, - proposalStatus_every?: Maybe, - proposalStatus_none?: Maybe, - proposalStatus_some?: Maybe, -}; - -export type ProposalWhereInput_Remote_Rel_Public_Onchain_Linksonchain_Proposal = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - author?: Maybe, - author_contains?: Maybe, - author_ends_with?: Maybe, - author_gt?: Maybe, - author_gte?: Maybe, - author_in?: Maybe>, - author_lt?: Maybe, - author_lte?: Maybe, - author_not?: Maybe, - author_not_contains?: Maybe, - author_not_ends_with?: Maybe, - author_not_in?: Maybe>, - author_not_starts_with?: Maybe, - author_starts_with?: Maybe, - depositAmount?: Maybe, - depositAmount_contains?: Maybe, - depositAmount_ends_with?: Maybe, - depositAmount_gt?: Maybe, - depositAmount_gte?: Maybe, - depositAmount_in?: Maybe>, - depositAmount_lt?: Maybe, - depositAmount_lte?: Maybe, - depositAmount_not?: Maybe, - depositAmount_not_contains?: Maybe, - depositAmount_not_ends_with?: Maybe, - depositAmount_not_in?: Maybe>, - depositAmount_not_starts_with?: Maybe, - depositAmount_starts_with?: Maybe, - id?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_in?: Maybe>, - preimage?: Maybe, - preimageHash?: Maybe, - preimageHash_contains?: Maybe, - preimageHash_ends_with?: Maybe, - preimageHash_gt?: Maybe, - preimageHash_gte?: Maybe, - preimageHash_in?: Maybe>, - preimageHash_lt?: Maybe, - preimageHash_lte?: Maybe, - preimageHash_not?: Maybe, - preimageHash_not_contains?: Maybe, - preimageHash_not_ends_with?: Maybe, - preimageHash_not_in?: Maybe>, - preimageHash_not_starts_with?: Maybe, - preimageHash_starts_with?: Maybe, - proposalId_gt?: Maybe, - proposalId_gte?: Maybe, - proposalId_in?: Maybe>, - proposalId_lt?: Maybe, - proposalId_lte?: Maybe, - proposalId_not?: Maybe, - proposalId_not_in?: Maybe>, - proposalStatus_every?: Maybe, - proposalStatus_none?: Maybe, - proposalStatus_some?: Maybe, -}; - -export type ProposalWhereUniqueInput = { - id?: Maybe, - proposalId?: Maybe, -}; - -export type PublicUser = { - __typename?: 'PublicUser', - id?: Maybe, - username?: Maybe, -}; - -export type Query = { - __typename?: 'Query', - subscription?: Maybe, - token?: Maybe, - user?: Maybe, -}; - - -export type QuerySubscriptionArgs = { - post_id: Scalars['Int'] -}; - - -export type QueryUserArgs = { - id: Scalars['Int'] -}; - -export type Query_Root = { - __typename?: 'query_root', - blockIndex?: Maybe, - blockIndexes: Array>, - blockIndexesConnection: BlockIndexConnection, - blockNumber?: Maybe, - blockNumbers: Array>, - blockNumbersConnection: BlockNumberConnection, - comment_reactions: Array, - comment_reactions_aggregate: Comment_Reactions_Aggregate, - comment_reactions_by_pk?: Maybe, - comments: Array, - comments_aggregate: Comments_Aggregate, - comments_by_pk?: Maybe, - council?: Maybe, - councilMember?: Maybe, - councilMembers: Array>, - councilMembersConnection: CouncilMemberConnection, - councils: Array>, - councilsConnection: CouncilConnection, - era?: Maybe, - eras: Array>, - erasConnection: EraConnection, - heartBeat?: Maybe, - heartBeats: Array>, - heartBeatsConnection: HeartBeatConnection, - motion?: Maybe, - motionProposalArgument?: Maybe, - motionProposalArguments: Array>, - motionProposalArgumentsConnection: MotionProposalArgumentConnection, - motionStatus?: Maybe, - motionStatuses: Array>, - motionStatusesConnection: MotionStatusConnection, - motions: Array>, - motionsConnection: MotionConnection, - node?: Maybe, - nomination?: Maybe, - nominations: Array>, - nominationsConnection: NominationConnection, - offlineValidator?: Maybe, - offlineValidators: Array>, - offlineValidatorsConnection: OfflineValidatorConnection, - onchain_links: Array, - onchain_links_aggregate: Onchain_Links_Aggregate, - onchain_links_by_pk?: Maybe, - poll: Array, - poll_aggregate: Poll_Aggregate, - poll_by_pk?: Maybe, - poll_votes: Array, - poll_votes_aggregate: Poll_Votes_Aggregate, - poll_votes_by_pk?: Maybe, - post_reactions: Array, - post_reactions_aggregate: Post_Reactions_Aggregate, - post_reactions_by_pk?: Maybe, - post_topics: Array, - post_topics_aggregate: Post_Topics_Aggregate, - post_topics_by_pk?: Maybe, - post_types: Array, - post_types_aggregate: Post_Types_Aggregate, - post_types_by_pk?: Maybe, - posts: Array, - posts_aggregate: Posts_Aggregate, - posts_by_pk?: Maybe, - preimage?: Maybe, - preimageArgument?: Maybe, - preimageArguments: Array>, - preimageArgumentsConnection: PreimageArgumentConnection, - preimageStatus?: Maybe, - preimageStatuses: Array>, - preimageStatusesConnection: PreimageStatusConnection, - preimages: Array>, - preimagesConnection: PreimageConnection, - proposal?: Maybe, - proposalStatus?: Maybe, - proposalStatuses: Array>, - proposalStatusesConnection: ProposalStatusConnection, - proposals: Array>, - proposalsConnection: ProposalConnection, - referendum?: Maybe, - referendumStatus?: Maybe, - referendumStatuses: Array>, - referendumStatusesConnection: ReferendumStatusConnection, - referendums: Array>, - referendumsConnection: ReferendumConnection, - reward?: Maybe, - rewards: Array>, - rewardsConnection: RewardConnection, - session?: Maybe, - sessions: Array>, - sessionsConnection: SessionConnection, - slashing?: Maybe, - slashings: Array>, - slashingsConnection: SlashingConnection, - stake?: Maybe, - stakes: Array>, - stakesConnection: StakeConnection, - subscription?: Maybe, - token?: Maybe, - totalIssuance?: Maybe, - totalIssuances: Array>, - totalIssuancesConnection: TotalIssuanceConnection, - treasurySpendProposal?: Maybe, - treasurySpendProposals: Array>, - treasurySpendProposalsConnection: TreasurySpendProposalConnection, - treasuryStatus?: Maybe, - treasuryStatuses: Array>, - treasuryStatusesConnection: TreasuryStatusConnection, - user?: Maybe, - validator?: Maybe, - validators: Array>, - validatorsConnection: ValidatorConnection, -}; - - -export type Query_RootBlockIndexArgs = { - where: BlockIndexWhereUniqueInput -}; - - -export type Query_RootBlockIndexesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootBlockIndexesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootBlockNumberArgs = { - where: BlockNumberWhereUniqueInput -}; - - -export type Query_RootBlockNumbersArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootBlockNumbersConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootComment_ReactionsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Query_RootComment_Reactions_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Query_RootComment_Reactions_By_PkArgs = { - id: Scalars['Int'] -}; - - -export type Query_RootCommentsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Query_RootComments_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Query_RootComments_By_PkArgs = { - id: Scalars['uuid'] -}; - - -export type Query_RootCouncilArgs = { - where: CouncilWhereUniqueInput -}; - - -export type Query_RootCouncilMemberArgs = { - where: CouncilMemberWhereUniqueInput -}; - - -export type Query_RootCouncilMembersArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootCouncilMembersConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootCouncilsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootCouncilsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootEraArgs = { - where: EraWhereUniqueInput -}; - - -export type Query_RootErasArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootErasConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootHeartBeatArgs = { - where: HeartBeatWhereUniqueInput -}; - - -export type Query_RootHeartBeatsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootHeartBeatsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootMotionArgs = { - where: MotionWhereUniqueInput -}; - - -export type Query_RootMotionProposalArgumentArgs = { - where: MotionProposalArgumentWhereUniqueInput -}; - - -export type Query_RootMotionProposalArgumentsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootMotionProposalArgumentsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootMotionStatusArgs = { - where: MotionStatusWhereUniqueInput -}; - - -export type Query_RootMotionStatusesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootMotionStatusesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootMotionsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootMotionsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootNodeArgs = { - id: Scalars['ID'] -}; - - -export type Query_RootNominationArgs = { - where: NominationWhereUniqueInput -}; - - -export type Query_RootNominationsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootNominationsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootOfflineValidatorArgs = { - where: OfflineValidatorWhereUniqueInput -}; - - -export type Query_RootOfflineValidatorsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootOfflineValidatorsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe -}; - - -export type Query_RootOnchain_LinksArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Query_RootOnchain_Links_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe -}; - - -export type Query_RootOnchain_Links_By_PkArgs = { - id: Scalars['Int'] -}; - - -export type Query_RootPollArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** columns and relationships of "post_reactions" */ +export type Post_Reactions = { + __typename?: 'post_reactions'; + created_at: Scalars['timestamp']; + id: Scalars['Int']; + /** An object relationship */ + post: Posts; + post_id: Scalars['Int']; + /** Remote relationship field */ + reacting_user?: Maybe; + reaction: Scalars['bpchar']; + updated_at: Scalars['timestamp']; + user_id: Scalars['Int']; +}; + +/** aggregated selection of "post_reactions" */ +export type Post_Reactions_Aggregate = { + __typename?: 'post_reactions_aggregate'; + aggregate?: Maybe; + nodes: Array; }; +/** aggregate fields of "post_reactions" */ +export type Post_Reactions_Aggregate_Fields = { + __typename?: 'post_reactions_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "post_reactions" */ +export type Post_Reactions_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; +}; -export type Query_RootPoll_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** order by aggregate values of table "post_reactions" */ +export type Post_Reactions_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "post_reactions" */ +export type Post_Reactions_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; }; +/** aggregate avg on columns */ +export type Post_Reactions_Avg_Fields = { + __typename?: 'post_reactions_avg_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPoll_By_PkArgs = { - id: Scalars['Int'] +/** order by avg() on columns of table "post_reactions" */ +export type Post_Reactions_Avg_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** Boolean expression to filter rows from the table "post_reactions". All fields are combined with a logical 'AND'. */ +export type Post_Reactions_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + created_at?: Maybe; + id?: Maybe; + post?: Maybe; + post_id?: Maybe; + reaction?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; + +/** unique or primary key constraints on table "post_reactions" */ +export enum Post_Reactions_Constraint { + /** unique or primary key constraint */ + PostReactionsPkey = 'post_reactions_pkey' +} -export type Query_RootPoll_VotesArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** input type for incrementing integer columne in table "post_reactions" */ +export type Post_Reactions_Inc_Input = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** input type for inserting data into table "post_reactions" */ +export type Post_Reactions_Insert_Input = { + created_at?: Maybe; + id?: Maybe; + post?: Maybe; + post_id?: Maybe; + reaction?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPoll_Votes_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** aggregate max on columns */ +export type Post_Reactions_Max_Fields = { + __typename?: 'post_reactions_max_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** order by max() on columns of table "post_reactions" */ +export type Post_Reactions_Max_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPoll_Votes_By_PkArgs = { - id: Scalars['Int'] +/** aggregate min on columns */ +export type Post_Reactions_Min_Fields = { + __typename?: 'post_reactions_min_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** order by min() on columns of table "post_reactions" */ +export type Post_Reactions_Min_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPost_ReactionsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** response of any mutation on the table "post_reactions" */ +export type Post_Reactions_Mutation_Response = { + __typename?: 'post_reactions_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; }; +/** input type for inserting object relation for remote table "post_reactions" */ +export type Post_Reactions_Obj_Rel_Insert_Input = { + data: Post_Reactions_Insert_Input; + on_conflict?: Maybe; +}; -export type Query_RootPost_Reactions_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** on conflict condition type for table "post_reactions" */ +export type Post_Reactions_On_Conflict = { + constraint: Post_Reactions_Constraint; + update_columns: Array; + where?: Maybe; }; +/** ordering options when selecting data from "post_reactions" */ +export type Post_Reactions_Order_By = { + created_at?: Maybe; + id?: Maybe; + post?: Maybe; + post_id?: Maybe; + reaction?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPost_Reactions_By_PkArgs = { - id: Scalars['Int'] +/** primary key columns input for table: "post_reactions" */ +export type Post_Reactions_Pk_Columns_Input = { + id: Scalars['Int']; }; +/** select columns of table "post_reactions" */ +export enum Post_Reactions_Select_Column { + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + PostId = 'post_id', + /** column name */ + Reaction = 'reaction', + /** column name */ + UpdatedAt = 'updated_at', + /** column name */ + UserId = 'user_id' +} -export type Query_RootPost_TopicsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** input type for updating data in table "post_reactions" */ +export type Post_Reactions_Set_Input = { + created_at?: Maybe; + id?: Maybe; + post_id?: Maybe; + reaction?: Maybe; + updated_at?: Maybe; + user_id?: Maybe; }; +/** aggregate stddev on columns */ +export type Post_Reactions_Stddev_Fields = { + __typename?: 'post_reactions_stddev_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPost_Topics_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** order by stddev() on columns of table "post_reactions" */ +export type Post_Reactions_Stddev_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** aggregate stddev_pop on columns */ +export type Post_Reactions_Stddev_Pop_Fields = { + __typename?: 'post_reactions_stddev_pop_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPost_Topics_By_PkArgs = { - id: Scalars['Int'] +/** order by stddev_pop() on columns of table "post_reactions" */ +export type Post_Reactions_Stddev_Pop_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** aggregate stddev_samp on columns */ +export type Post_Reactions_Stddev_Samp_Fields = { + __typename?: 'post_reactions_stddev_samp_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPost_TypesArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** order by stddev_samp() on columns of table "post_reactions" */ +export type Post_Reactions_Stddev_Samp_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** aggregate sum on columns */ +export type Post_Reactions_Sum_Fields = { + __typename?: 'post_reactions_sum_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPost_Types_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** order by sum() on columns of table "post_reactions" */ +export type Post_Reactions_Sum_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** update columns of table "post_reactions" */ +export enum Post_Reactions_Update_Column { + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + PostId = 'post_id', + /** column name */ + Reaction = 'reaction', + /** column name */ + UpdatedAt = 'updated_at', + /** column name */ + UserId = 'user_id' +} -export type Query_RootPost_Types_By_PkArgs = { - id: Scalars['Int'] +/** aggregate var_pop on columns */ +export type Post_Reactions_Var_Pop_Fields = { + __typename?: 'post_reactions_var_pop_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** order by var_pop() on columns of table "post_reactions" */ +export type Post_Reactions_Var_Pop_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPostsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** aggregate var_samp on columns */ +export type Post_Reactions_Var_Samp_Fields = { + __typename?: 'post_reactions_var_samp_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** order by var_samp() on columns of table "post_reactions" */ +export type Post_Reactions_Var_Samp_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPosts_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** aggregate variance on columns */ +export type Post_Reactions_Variance_Fields = { + __typename?: 'post_reactions_variance_fields'; + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; }; +/** order by variance() on columns of table "post_reactions" */ +export type Post_Reactions_Variance_Order_By = { + id?: Maybe; + post_id?: Maybe; + user_id?: Maybe; +}; -export type Query_RootPosts_By_PkArgs = { - id: Scalars['Int'] +/** columns and relationships of "post_topics" */ +export type Post_Topics = { + __typename?: 'post_topics'; + id: Scalars['Int']; + name: Scalars['String']; + /** An array relationship */ + posts: Array; + /** An aggregated array relationship */ + posts_aggregate: Posts_Aggregate; }; -export type Query_RootPreimageArgs = { - where: PreimageWhereUniqueInput +/** columns and relationships of "post_topics" */ +export type Post_TopicsPostsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Query_RootPreimageArgumentArgs = { - where: PreimageArgumentWhereUniqueInput +/** columns and relationships of "post_topics" */ +export type Post_TopicsPosts_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; +/** aggregated selection of "post_topics" */ +export type Post_Topics_Aggregate = { + __typename?: 'post_topics_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; -export type Query_RootPreimageArgumentsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate fields of "post_topics" */ +export type Post_Topics_Aggregate_Fields = { + __typename?: 'post_topics_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "post_topics" */ +export type Post_Topics_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; }; +/** order by aggregate values of table "post_topics" */ +export type Post_Topics_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "post_topics" */ +export type Post_Topics_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; +}; -export type Query_RootPreimageArgumentsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate avg on columns */ +export type Post_Topics_Avg_Fields = { + __typename?: 'post_topics_avg_fields'; + id?: Maybe; }; +/** order by avg() on columns of table "post_topics" */ +export type Post_Topics_Avg_Order_By = { + id?: Maybe; +}; -export type Query_RootPreimageStatusArgs = { - where: PreimageStatusWhereUniqueInput +/** Boolean expression to filter rows from the table "post_topics". All fields are combined with a logical 'AND'. */ +export type Post_Topics_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + id?: Maybe; + name?: Maybe; + posts?: Maybe; }; +/** unique or primary key constraints on table "post_topics" */ +export enum Post_Topics_Constraint { + /** unique or primary key constraint */ + CategoriesNameKey = 'categories_name_key', + /** unique or primary key constraint */ + CategoriesPkey = 'categories_pkey' +} -export type Query_RootPreimageStatusesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** input type for incrementing integer columne in table "post_topics" */ +export type Post_Topics_Inc_Input = { + id?: Maybe; }; +/** input type for inserting data into table "post_topics" */ +export type Post_Topics_Insert_Input = { + id?: Maybe; + name?: Maybe; + posts?: Maybe; +}; -export type Query_RootPreimageStatusesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate max on columns */ +export type Post_Topics_Max_Fields = { + __typename?: 'post_topics_max_fields'; + id?: Maybe; + name?: Maybe; }; +/** order by max() on columns of table "post_topics" */ +export type Post_Topics_Max_Order_By = { + id?: Maybe; + name?: Maybe; +}; -export type Query_RootPreimagesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate min on columns */ +export type Post_Topics_Min_Fields = { + __typename?: 'post_topics_min_fields'; + id?: Maybe; + name?: Maybe; }; +/** order by min() on columns of table "post_topics" */ +export type Post_Topics_Min_Order_By = { + id?: Maybe; + name?: Maybe; +}; -export type Query_RootPreimagesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** response of any mutation on the table "post_topics" */ +export type Post_Topics_Mutation_Response = { + __typename?: 'post_topics_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; }; +/** input type for inserting object relation for remote table "post_topics" */ +export type Post_Topics_Obj_Rel_Insert_Input = { + data: Post_Topics_Insert_Input; + on_conflict?: Maybe; +}; -export type Query_RootProposalArgs = { - where: ProposalWhereUniqueInput +/** on conflict condition type for table "post_topics" */ +export type Post_Topics_On_Conflict = { + constraint: Post_Topics_Constraint; + update_columns: Array; + where?: Maybe; }; +/** ordering options when selecting data from "post_topics" */ +export type Post_Topics_Order_By = { + id?: Maybe; + name?: Maybe; + posts_aggregate?: Maybe; +}; -export type Query_RootProposalStatusArgs = { - where: ProposalStatusWhereUniqueInput +/** primary key columns input for table: "post_topics" */ +export type Post_Topics_Pk_Columns_Input = { + id: Scalars['Int']; }; +/** select columns of table "post_topics" */ +export enum Post_Topics_Select_Column { + /** column name */ + Id = 'id', + /** column name */ + Name = 'name' +} -export type Query_RootProposalStatusesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** input type for updating data in table "post_topics" */ +export type Post_Topics_Set_Input = { + id?: Maybe; + name?: Maybe; }; +/** aggregate stddev on columns */ +export type Post_Topics_Stddev_Fields = { + __typename?: 'post_topics_stddev_fields'; + id?: Maybe; +}; -export type Query_RootProposalStatusesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** order by stddev() on columns of table "post_topics" */ +export type Post_Topics_Stddev_Order_By = { + id?: Maybe; }; +/** aggregate stddev_pop on columns */ +export type Post_Topics_Stddev_Pop_Fields = { + __typename?: 'post_topics_stddev_pop_fields'; + id?: Maybe; +}; -export type Query_RootProposalsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** order by stddev_pop() on columns of table "post_topics" */ +export type Post_Topics_Stddev_Pop_Order_By = { + id?: Maybe; }; +/** aggregate stddev_samp on columns */ +export type Post_Topics_Stddev_Samp_Fields = { + __typename?: 'post_topics_stddev_samp_fields'; + id?: Maybe; +}; -export type Query_RootProposalsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** order by stddev_samp() on columns of table "post_topics" */ +export type Post_Topics_Stddev_Samp_Order_By = { + id?: Maybe; }; +/** aggregate sum on columns */ +export type Post_Topics_Sum_Fields = { + __typename?: 'post_topics_sum_fields'; + id?: Maybe; +}; -export type Query_RootReferendumArgs = { - where: ReferendumWhereUniqueInput +/** order by sum() on columns of table "post_topics" */ +export type Post_Topics_Sum_Order_By = { + id?: Maybe; }; +/** update columns of table "post_topics" */ +export enum Post_Topics_Update_Column { + /** column name */ + Id = 'id', + /** column name */ + Name = 'name' +} -export type Query_RootReferendumStatusArgs = { - where: ReferendumStatusWhereUniqueInput +/** aggregate var_pop on columns */ +export type Post_Topics_Var_Pop_Fields = { + __typename?: 'post_topics_var_pop_fields'; + id?: Maybe; }; +/** order by var_pop() on columns of table "post_topics" */ +export type Post_Topics_Var_Pop_Order_By = { + id?: Maybe; +}; -export type Query_RootReferendumStatusesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate var_samp on columns */ +export type Post_Topics_Var_Samp_Fields = { + __typename?: 'post_topics_var_samp_fields'; + id?: Maybe; }; +/** order by var_samp() on columns of table "post_topics" */ +export type Post_Topics_Var_Samp_Order_By = { + id?: Maybe; +}; -export type Query_RootReferendumStatusesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate variance on columns */ +export type Post_Topics_Variance_Fields = { + __typename?: 'post_topics_variance_fields'; + id?: Maybe; }; +/** order by variance() on columns of table "post_topics" */ +export type Post_Topics_Variance_Order_By = { + id?: Maybe; +}; -export type Query_RootReferendumsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** columns and relationships of "post_types" */ +export type Post_Types = { + __typename?: 'post_types'; + id: Scalars['Int']; + name: Scalars['String']; + /** An array relationship */ + posts: Array; + /** An aggregated array relationship */ + posts_aggregate: Posts_Aggregate; }; -export type Query_RootReferendumsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** columns and relationships of "post_types" */ +export type Post_TypesPostsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Query_RootRewardArgs = { - where: RewardWhereUniqueInput +/** columns and relationships of "post_types" */ +export type Post_TypesPosts_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; +/** aggregated selection of "post_types" */ +export type Post_Types_Aggregate = { + __typename?: 'post_types_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; -export type Query_RootRewardsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate fields of "post_types" */ +export type Post_Types_Aggregate_Fields = { + __typename?: 'post_types_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "post_types" */ +export type Post_Types_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; }; +/** order by aggregate values of table "post_types" */ +export type Post_Types_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "post_types" */ +export type Post_Types_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; +}; -export type Query_RootRewardsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate avg on columns */ +export type Post_Types_Avg_Fields = { + __typename?: 'post_types_avg_fields'; + id?: Maybe; }; +/** order by avg() on columns of table "post_types" */ +export type Post_Types_Avg_Order_By = { + id?: Maybe; +}; -export type Query_RootSessionArgs = { - where: SessionWhereUniqueInput +/** Boolean expression to filter rows from the table "post_types". All fields are combined with a logical 'AND'. */ +export type Post_Types_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + id?: Maybe; + name?: Maybe; + posts?: Maybe; }; +/** unique or primary key constraints on table "post_types" */ +export enum Post_Types_Constraint { + /** unique or primary key constraint */ + PostTypesNameKey = 'post_types_name_key', + /** unique or primary key constraint */ + PostTypesPkey = 'post_types_pkey' +} -export type Query_RootSessionsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** input type for incrementing integer columne in table "post_types" */ +export type Post_Types_Inc_Input = { + id?: Maybe; }; +/** input type for inserting data into table "post_types" */ +export type Post_Types_Insert_Input = { + id?: Maybe; + name?: Maybe; + posts?: Maybe; +}; -export type Query_RootSessionsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate max on columns */ +export type Post_Types_Max_Fields = { + __typename?: 'post_types_max_fields'; + id?: Maybe; + name?: Maybe; }; +/** order by max() on columns of table "post_types" */ +export type Post_Types_Max_Order_By = { + id?: Maybe; + name?: Maybe; +}; -export type Query_RootSlashingArgs = { - where: SlashingWhereUniqueInput +/** aggregate min on columns */ +export type Post_Types_Min_Fields = { + __typename?: 'post_types_min_fields'; + id?: Maybe; + name?: Maybe; }; +/** order by min() on columns of table "post_types" */ +export type Post_Types_Min_Order_By = { + id?: Maybe; + name?: Maybe; +}; -export type Query_RootSlashingsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** response of any mutation on the table "post_types" */ +export type Post_Types_Mutation_Response = { + __typename?: 'post_types_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; }; +/** input type for inserting object relation for remote table "post_types" */ +export type Post_Types_Obj_Rel_Insert_Input = { + data: Post_Types_Insert_Input; + on_conflict?: Maybe; +}; -export type Query_RootSlashingsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** on conflict condition type for table "post_types" */ +export type Post_Types_On_Conflict = { + constraint: Post_Types_Constraint; + update_columns: Array; + where?: Maybe; }; +/** ordering options when selecting data from "post_types" */ +export type Post_Types_Order_By = { + id?: Maybe; + name?: Maybe; + posts_aggregate?: Maybe; +}; -export type Query_RootStakeArgs = { - where: StakeWhereUniqueInput +/** primary key columns input for table: "post_types" */ +export type Post_Types_Pk_Columns_Input = { + id: Scalars['Int']; }; +/** select columns of table "post_types" */ +export enum Post_Types_Select_Column { + /** column name */ + Id = 'id', + /** column name */ + Name = 'name' +} -export type Query_RootStakesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** input type for updating data in table "post_types" */ +export type Post_Types_Set_Input = { + id?: Maybe; + name?: Maybe; }; +/** aggregate stddev on columns */ +export type Post_Types_Stddev_Fields = { + __typename?: 'post_types_stddev_fields'; + id?: Maybe; +}; -export type Query_RootStakesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** order by stddev() on columns of table "post_types" */ +export type Post_Types_Stddev_Order_By = { + id?: Maybe; }; +/** aggregate stddev_pop on columns */ +export type Post_Types_Stddev_Pop_Fields = { + __typename?: 'post_types_stddev_pop_fields'; + id?: Maybe; +}; -export type Query_RootSubscriptionArgs = { - post_id: Scalars['Int'] +/** order by stddev_pop() on columns of table "post_types" */ +export type Post_Types_Stddev_Pop_Order_By = { + id?: Maybe; }; +/** aggregate stddev_samp on columns */ +export type Post_Types_Stddev_Samp_Fields = { + __typename?: 'post_types_stddev_samp_fields'; + id?: Maybe; +}; -export type Query_RootTotalIssuanceArgs = { - where: TotalIssuanceWhereUniqueInput +/** order by stddev_samp() on columns of table "post_types" */ +export type Post_Types_Stddev_Samp_Order_By = { + id?: Maybe; }; +/** aggregate sum on columns */ +export type Post_Types_Sum_Fields = { + __typename?: 'post_types_sum_fields'; + id?: Maybe; +}; -export type Query_RootTotalIssuancesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** order by sum() on columns of table "post_types" */ +export type Post_Types_Sum_Order_By = { + id?: Maybe; }; +/** update columns of table "post_types" */ +export enum Post_Types_Update_Column { + /** column name */ + Id = 'id', + /** column name */ + Name = 'name' +} -export type Query_RootTotalIssuancesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate var_pop on columns */ +export type Post_Types_Var_Pop_Fields = { + __typename?: 'post_types_var_pop_fields'; + id?: Maybe; }; +/** order by var_pop() on columns of table "post_types" */ +export type Post_Types_Var_Pop_Order_By = { + id?: Maybe; +}; -export type Query_RootTreasurySpendProposalArgs = { - where: TreasurySpendProposalWhereUniqueInput +/** aggregate var_samp on columns */ +export type Post_Types_Var_Samp_Fields = { + __typename?: 'post_types_var_samp_fields'; + id?: Maybe; }; +/** order by var_samp() on columns of table "post_types" */ +export type Post_Types_Var_Samp_Order_By = { + id?: Maybe; +}; -export type Query_RootTreasurySpendProposalsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate variance on columns */ +export type Post_Types_Variance_Fields = { + __typename?: 'post_types_variance_fields'; + id?: Maybe; }; +/** order by variance() on columns of table "post_types" */ +export type Post_Types_Variance_Order_By = { + id?: Maybe; +}; -export type Query_RootTreasurySpendProposalsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** columns and relationships of "posts" */ +export type Posts = { + __typename?: 'posts'; + /** Remote relationship field */ + author?: Maybe; + author_id: Scalars['Int']; + /** An array relationship */ + comments: Array; + /** An aggregated array relationship */ + comments_aggregate: Comments_Aggregate; + content?: Maybe; + created_at: Scalars['timestamptz']; + id: Scalars['Int']; + /** An object relationship */ + onchain_link?: Maybe; + /** An array relationship */ + polls: Array; + /** An aggregated array relationship */ + polls_aggregate: Poll_Aggregate; + /** An array relationship */ + post_reactions: Array; + /** An aggregated array relationship */ + post_reactions_aggregate: Post_Reactions_Aggregate; + title?: Maybe; + /** An object relationship */ + topic: Post_Topics; + /** Define the main suject of the post */ + topic_id: Scalars['Int']; + /** An object relationship */ + type: Post_Types; + type_id: Scalars['Int']; + updated_at: Scalars['timestamptz']; +}; + + +/** columns and relationships of "posts" */ +export type PostsCommentsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Query_RootTreasuryStatusArgs = { - where: TreasuryStatusWhereUniqueInput +/** columns and relationships of "posts" */ +export type PostsComments_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Query_RootTreasuryStatusesArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** columns and relationships of "posts" */ +export type PostsPollsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Query_RootTreasuryStatusesConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** columns and relationships of "posts" */ +export type PostsPolls_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Query_RootUserArgs = { - id: Scalars['Int'] +/** columns and relationships of "posts" */ +export type PostsPost_ReactionsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Query_RootValidatorArgs = { - where: ValidatorWhereUniqueInput +/** columns and relationships of "posts" */ +export type PostsPost_Reactions_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; +/** aggregated selection of "posts" */ +export type Posts_Aggregate = { + __typename?: 'posts_aggregate'; + aggregate?: Maybe; + nodes: Array; +}; -export type Query_RootValidatorsArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate fields of "posts" */ +export type Posts_Aggregate_Fields = { + __typename?: 'posts_aggregate_fields'; + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + + +/** aggregate fields of "posts" */ +export type Posts_Aggregate_FieldsCountArgs = { + columns?: Maybe>; + distinct?: Maybe; }; +/** order by aggregate values of table "posts" */ +export type Posts_Aggregate_Order_By = { + avg?: Maybe; + count?: Maybe; + max?: Maybe; + min?: Maybe; + stddev?: Maybe; + stddev_pop?: Maybe; + stddev_samp?: Maybe; + sum?: Maybe; + var_pop?: Maybe; + var_samp?: Maybe; + variance?: Maybe; +}; + +/** input type for inserting array relation for remote table "posts" */ +export type Posts_Arr_Rel_Insert_Input = { + data: Array; + on_conflict?: Maybe; +}; -export type Query_RootValidatorsConnectionArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** aggregate avg on columns */ +export type Posts_Avg_Fields = { + __typename?: 'posts_avg_fields'; + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type Referendum = { - __typename?: 'Referendum', - delay: Scalars['Int'], - end: Scalars['Int'], - id: Scalars['Int'], - preimage?: Maybe, - preimageHash: Scalars['String'], - referendumId: Scalars['Int'], - referendumStatus?: Maybe>, - voteThreshold: Scalars['String'], +/** order by avg() on columns of table "posts" */ +export type Posts_Avg_Order_By = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; +/** Boolean expression to filter rows from the table "posts". All fields are combined with a logical 'AND'. */ +export type Posts_Bool_Exp = { + _and?: Maybe>>; + _not?: Maybe; + _or?: Maybe>>; + author_id?: Maybe; + comments?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + onchain_link?: Maybe; + polls?: Maybe; + post_reactions?: Maybe; + title?: Maybe; + topic?: Maybe; + topic_id?: Maybe; + type?: Maybe; + type_id?: Maybe; + updated_at?: Maybe; +}; + +/** unique or primary key constraints on table "posts" */ +export enum Posts_Constraint { + /** unique or primary key constraint */ + MessagesPkey = 'messages_pkey' +} -export type ReferendumReferendumStatusArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** input type for incrementing integer columne in table "posts" */ +export type Posts_Inc_Input = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumConnection = { - __typename?: 'ReferendumConnection', - aggregate: AggregateReferendum, - edges: Array>, - pageInfo: PageInfo, +/** input type for inserting data into table "posts" */ +export type Posts_Insert_Input = { + author_id?: Maybe; + comments?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + onchain_link?: Maybe; + polls?: Maybe; + post_reactions?: Maybe; + title?: Maybe; + topic?: Maybe; + topic_id?: Maybe; + type?: Maybe; + type_id?: Maybe; + updated_at?: Maybe; +}; + +/** aggregate max on columns */ +export type Posts_Max_Fields = { + __typename?: 'posts_max_fields'; + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + title?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; + updated_at?: Maybe; +}; + +/** order by max() on columns of table "posts" */ +export type Posts_Max_Order_By = { + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + title?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; + updated_at?: Maybe; }; -export type ReferendumCreateInput = { - delay: Scalars['Int'], - end: Scalars['Int'], - preimage?: Maybe, - preimageHash: Scalars['String'], - referendumId: Scalars['Int'], - referendumStatus?: Maybe, - voteThreshold: Scalars['String'], +/** aggregate min on columns */ +export type Posts_Min_Fields = { + __typename?: 'posts_min_fields'; + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + title?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; + updated_at?: Maybe; +}; + +/** order by min() on columns of table "posts" */ +export type Posts_Min_Order_By = { + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + title?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; + updated_at?: Maybe; }; -export type ReferendumCreateOneWithoutPreimageInput = { - connect?: Maybe, - create?: Maybe, +/** response of any mutation on the table "posts" */ +export type Posts_Mutation_Response = { + __typename?: 'posts_mutation_response'; + /** number of affected rows by the mutation */ + affected_rows: Scalars['Int']; + /** data of the affected rows by the mutation */ + returning: Array; }; -export type ReferendumCreateOneWithoutReferendumStatusInput = { - connect?: Maybe, - create?: Maybe, +/** input type for inserting object relation for remote table "posts" */ +export type Posts_Obj_Rel_Insert_Input = { + data: Posts_Insert_Input; + on_conflict?: Maybe; }; -export type ReferendumCreateWithoutPreimageInput = { - delay: Scalars['Int'], - end: Scalars['Int'], - preimageHash: Scalars['String'], - referendumId: Scalars['Int'], - referendumStatus?: Maybe, - voteThreshold: Scalars['String'], +/** on conflict condition type for table "posts" */ +export type Posts_On_Conflict = { + constraint: Posts_Constraint; + update_columns: Array; + where?: Maybe; }; -export type ReferendumCreateWithoutReferendumStatusInput = { - delay: Scalars['Int'], - end: Scalars['Int'], - preimage?: Maybe, - preimageHash: Scalars['String'], - referendumId: Scalars['Int'], - voteThreshold: Scalars['String'], +/** ordering options when selecting data from "posts" */ +export type Posts_Order_By = { + author_id?: Maybe; + comments_aggregate?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + onchain_link?: Maybe; + polls_aggregate?: Maybe; + post_reactions_aggregate?: Maybe; + title?: Maybe; + topic?: Maybe; + topic_id?: Maybe; + type?: Maybe; + type_id?: Maybe; + updated_at?: Maybe; +}; + +/** primary key columns input for table: "posts" */ +export type Posts_Pk_Columns_Input = { + id: Scalars['Int']; }; -export type ReferendumEdge = { - __typename?: 'ReferendumEdge', - cursor: Scalars['String'], - node: Referendum, +/** select columns of table "posts" */ +export enum Posts_Select_Column { + /** column name */ + AuthorId = 'author_id', + /** column name */ + Content = 'content', + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + Title = 'title', + /** column name */ + TopicId = 'topic_id', + /** column name */ + TypeId = 'type_id', + /** column name */ + UpdatedAt = 'updated_at' +} + +/** input type for updating data in table "posts" */ +export type Posts_Set_Input = { + author_id?: Maybe; + content?: Maybe; + created_at?: Maybe; + id?: Maybe; + title?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; + updated_at?: Maybe; }; -export enum ReferendumOrderByInput { - DelayAsc = 'delay_ASC', - DelayDesc = 'delay_DESC', - EndAsc = 'end_ASC', - EndDesc = 'end_DESC', - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - PreimageHashAsc = 'preimageHash_ASC', - PreimageHashDesc = 'preimageHash_DESC', - ReferendumIdAsc = 'referendumId_ASC', - ReferendumIdDesc = 'referendumId_DESC', - VoteThresholdAsc = 'voteThreshold_ASC', - VoteThresholdDesc = 'voteThreshold_DESC' -} +/** aggregate stddev on columns */ +export type Posts_Stddev_Fields = { + __typename?: 'posts_stddev_fields'; + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; +}; -export type ReferendumPreviousValues = { - __typename?: 'ReferendumPreviousValues', - delay: Scalars['Int'], - end: Scalars['Int'], - id: Scalars['Int'], - preimageHash: Scalars['String'], - referendumId: Scalars['Int'], - voteThreshold: Scalars['String'], +/** order by stddev() on columns of table "posts" */ +export type Posts_Stddev_Order_By = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatus = Node & { - __typename?: 'ReferendumStatus', - blockNumber: BlockNumber, - id: Scalars['ID'], - referendum: Referendum, - status: Scalars['String'], - uniqueStatus: Scalars['String'], +/** aggregate stddev_pop on columns */ +export type Posts_Stddev_Pop_Fields = { + __typename?: 'posts_stddev_pop_fields'; + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusConnection = { - __typename?: 'ReferendumStatusConnection', - aggregate: AggregateReferendumStatus, - edges: Array>, - pageInfo: PageInfo, +/** order by stddev_pop() on columns of table "posts" */ +export type Posts_Stddev_Pop_Order_By = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusCreateInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - referendum: ReferendumCreateOneWithoutReferendumStatusInput, - status: Scalars['String'], - uniqueStatus: Scalars['String'], +/** aggregate stddev_samp on columns */ +export type Posts_Stddev_Samp_Fields = { + __typename?: 'posts_stddev_samp_fields'; + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusCreateManyWithoutReferendumInput = { - connect?: Maybe>, - create?: Maybe>, +/** order by stddev_samp() on columns of table "posts" */ +export type Posts_Stddev_Samp_Order_By = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusCreateWithoutReferendumInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - status: Scalars['String'], - uniqueStatus: Scalars['String'], +/** aggregate sum on columns */ +export type Posts_Sum_Fields = { + __typename?: 'posts_sum_fields'; + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusEdge = { - __typename?: 'ReferendumStatusEdge', - cursor: Scalars['String'], - node: ReferendumStatus, +/** order by sum() on columns of table "posts" */ +export type Posts_Sum_Order_By = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export enum ReferendumStatusOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - StatusAsc = 'status_ASC', - StatusDesc = 'status_DESC', - UniqueStatusAsc = 'uniqueStatus_ASC', - UniqueStatusDesc = 'uniqueStatus_DESC' +/** update columns of table "posts" */ +export enum Posts_Update_Column { + /** column name */ + AuthorId = 'author_id', + /** column name */ + Content = 'content', + /** column name */ + CreatedAt = 'created_at', + /** column name */ + Id = 'id', + /** column name */ + Title = 'title', + /** column name */ + TopicId = 'topic_id', + /** column name */ + TypeId = 'type_id', + /** column name */ + UpdatedAt = 'updated_at' } -export type ReferendumStatusPreviousValues = { - __typename?: 'ReferendumStatusPreviousValues', - id: Scalars['ID'], - status: Scalars['String'], - uniqueStatus: Scalars['String'], -}; - -export type ReferendumStatusScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, - uniqueStatus?: Maybe, - uniqueStatus_contains?: Maybe, - uniqueStatus_ends_with?: Maybe, - uniqueStatus_gt?: Maybe, - uniqueStatus_gte?: Maybe, - uniqueStatus_in?: Maybe>, - uniqueStatus_lt?: Maybe, - uniqueStatus_lte?: Maybe, - uniqueStatus_not?: Maybe, - uniqueStatus_not_contains?: Maybe, - uniqueStatus_not_ends_with?: Maybe, - uniqueStatus_not_in?: Maybe>, - uniqueStatus_not_starts_with?: Maybe, - uniqueStatus_starts_with?: Maybe, +/** aggregate var_pop on columns */ +export type Posts_Var_Pop_Fields = { + __typename?: 'posts_var_pop_fields'; + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusSubscriptionPayload = { - __typename?: 'ReferendumStatusSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, +/** order by var_pop() on columns of table "posts" */ +export type Posts_Var_Pop_Order_By = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** aggregate var_samp on columns */ +export type Posts_Var_Samp_Fields = { + __typename?: 'posts_var_samp_fields'; + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusUpdateInput = { - blockNumber?: Maybe, - referendum?: Maybe, - status?: Maybe, - uniqueStatus?: Maybe, +/** order by var_samp() on columns of table "posts" */ +export type Posts_Var_Samp_Order_By = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusUpdateManyDataInput = { - status?: Maybe, - uniqueStatus?: Maybe, +/** aggregate variance on columns */ +export type Posts_Variance_Fields = { + __typename?: 'posts_variance_fields'; + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusUpdateManyMutationInput = { - status?: Maybe, - uniqueStatus?: Maybe, +/** order by variance() on columns of table "posts" */ +export type Posts_Variance_Order_By = { + author_id?: Maybe; + id?: Maybe; + topic_id?: Maybe; + type_id?: Maybe; }; -export type ReferendumStatusUpdateManyWithoutReferendumInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - updateMany?: Maybe>, - upsert?: Maybe>, +/** query root */ +export type Query_Root = { + __typename?: 'query_root'; + blockIndex?: Maybe; + blockIndexes: Array>; + blockIndexesConnection: BlockIndexConnection; + blockNumber?: Maybe; + blockNumbers: Array>; + blockNumbersConnection: BlockNumberConnection; + /** fetch data from the table: "comment_reactions" */ + comment_reactions: Array; + /** fetch aggregated fields from the table: "comment_reactions" */ + comment_reactions_aggregate: Comment_Reactions_Aggregate; + /** fetch data from the table: "comment_reactions" using primary key columns */ + comment_reactions_by_pk?: Maybe; + /** fetch data from the table: "comments" */ + comments: Array; + /** fetch aggregated fields from the table: "comments" */ + comments_aggregate: Comments_Aggregate; + /** fetch data from the table: "comments" using primary key columns */ + comments_by_pk?: Maybe; + council?: Maybe; + councilMember?: Maybe; + councilMembers: Array>; + councilMembersConnection: CouncilMemberConnection; + councils: Array>; + councilsConnection: CouncilConnection; + era?: Maybe; + eras: Array>; + erasConnection: EraConnection; + heartBeat?: Maybe; + heartBeats: Array>; + heartBeatsConnection: HeartBeatConnection; + motion?: Maybe; + motionProposalArgument?: Maybe; + motionProposalArguments: Array>; + motionProposalArgumentsConnection: MotionProposalArgumentConnection; + motionStatus?: Maybe; + motionStatuses: Array>; + motionStatusesConnection: MotionStatusConnection; + motions: Array>; + motionsConnection: MotionConnection; + node?: Maybe; + nomination?: Maybe; + nominations: Array>; + nominationsConnection: NominationConnection; + offlineValidator?: Maybe; + offlineValidators: Array>; + offlineValidatorsConnection: OfflineValidatorConnection; + /** fetch data from the table: "onchain_links" */ + onchain_links: Array; + /** fetch aggregated fields from the table: "onchain_links" */ + onchain_links_aggregate: Onchain_Links_Aggregate; + /** fetch data from the table: "onchain_links" using primary key columns */ + onchain_links_by_pk?: Maybe; + /** fetch data from the table: "poll" */ + poll: Array; + /** fetch aggregated fields from the table: "poll" */ + poll_aggregate: Poll_Aggregate; + /** fetch data from the table: "poll" using primary key columns */ + poll_by_pk?: Maybe; + /** fetch data from the table: "poll_votes" */ + poll_votes: Array; + /** fetch aggregated fields from the table: "poll_votes" */ + poll_votes_aggregate: Poll_Votes_Aggregate; + /** fetch data from the table: "poll_votes" using primary key columns */ + poll_votes_by_pk?: Maybe; + /** fetch data from the table: "post_reactions" */ + post_reactions: Array; + /** fetch aggregated fields from the table: "post_reactions" */ + post_reactions_aggregate: Post_Reactions_Aggregate; + /** fetch data from the table: "post_reactions" using primary key columns */ + post_reactions_by_pk?: Maybe; + /** fetch data from the table: "post_topics" */ + post_topics: Array; + /** fetch aggregated fields from the table: "post_topics" */ + post_topics_aggregate: Post_Topics_Aggregate; + /** fetch data from the table: "post_topics" using primary key columns */ + post_topics_by_pk?: Maybe; + /** fetch data from the table: "post_types" */ + post_types: Array; + /** fetch aggregated fields from the table: "post_types" */ + post_types_aggregate: Post_Types_Aggregate; + /** fetch data from the table: "post_types" using primary key columns */ + post_types_by_pk?: Maybe; + /** fetch data from the table: "posts" */ + posts: Array; + /** fetch aggregated fields from the table: "posts" */ + posts_aggregate: Posts_Aggregate; + /** fetch data from the table: "posts" using primary key columns */ + posts_by_pk?: Maybe; + preimage?: Maybe; + preimageArgument?: Maybe; + preimageArguments: Array>; + preimageArgumentsConnection: PreimageArgumentConnection; + preimageStatus?: Maybe; + preimageStatuses: Array>; + preimageStatusesConnection: PreimageStatusConnection; + preimages: Array>; + preimagesConnection: PreimageConnection; + proposal?: Maybe; + proposalStatus?: Maybe; + proposalStatuses: Array>; + proposalStatusesConnection: ProposalStatusConnection; + proposals: Array>; + proposalsConnection: ProposalConnection; + referendum?: Maybe; + referendumStatus?: Maybe; + referendumStatuses: Array>; + referendumStatusesConnection: ReferendumStatusConnection; + referendums: Array>; + referendumsConnection: ReferendumConnection; + reward?: Maybe; + rewards: Array>; + rewardsConnection: RewardConnection; + session?: Maybe; + sessions: Array>; + sessionsConnection: SessionConnection; + slashing?: Maybe; + slashings: Array>; + slashingsConnection: SlashingConnection; + stake?: Maybe; + stakes: Array>; + stakesConnection: StakeConnection; + subscription?: Maybe; + token?: Maybe; + totalIssuance?: Maybe; + totalIssuances: Array>; + totalIssuancesConnection: TotalIssuanceConnection; + treasurySpendProposal?: Maybe; + treasurySpendProposals: Array>; + treasurySpendProposalsConnection: TreasurySpendProposalConnection; + treasuryStatus?: Maybe; + treasuryStatuses: Array>; + treasuryStatusesConnection: TreasuryStatusConnection; + user?: Maybe; + validator?: Maybe; + validators: Array>; + validatorsConnection: ValidatorConnection; +}; + + +/** query root */ +export type Query_RootBlockIndexArgs = { + where: BlockIndexWhereUniqueInput; }; -export type ReferendumStatusUpdateManyWithWhereNestedInput = { - data: ReferendumStatusUpdateManyDataInput, - where: ReferendumStatusScalarWhereInput, -}; -export type ReferendumStatusUpdateWithoutReferendumDataInput = { - blockNumber?: Maybe, - status?: Maybe, - uniqueStatus?: Maybe, +/** query root */ +export type Query_RootBlockIndexesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type ReferendumStatusUpdateWithWhereUniqueWithoutReferendumInput = { - data: ReferendumStatusUpdateWithoutReferendumDataInput, - where: ReferendumStatusWhereUniqueInput, -}; -export type ReferendumStatusUpsertWithWhereUniqueWithoutReferendumInput = { - create: ReferendumStatusCreateWithoutReferendumInput, - update: ReferendumStatusUpdateWithoutReferendumDataInput, - where: ReferendumStatusWhereUniqueInput, +/** query root */ +export type Query_RootBlockIndexesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type ReferendumStatusWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - referendum?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, - uniqueStatus?: Maybe, - uniqueStatus_contains?: Maybe, - uniqueStatus_ends_with?: Maybe, - uniqueStatus_gt?: Maybe, - uniqueStatus_gte?: Maybe, - uniqueStatus_in?: Maybe>, - uniqueStatus_lt?: Maybe, - uniqueStatus_lte?: Maybe, - uniqueStatus_not?: Maybe, - uniqueStatus_not_contains?: Maybe, - uniqueStatus_not_ends_with?: Maybe, - uniqueStatus_not_in?: Maybe>, - uniqueStatus_not_starts_with?: Maybe, - uniqueStatus_starts_with?: Maybe, -}; -export type ReferendumStatusWhereUniqueInput = { - id?: Maybe, - uniqueStatus?: Maybe, +/** query root */ +export type Query_RootBlockNumberArgs = { + where: BlockNumberWhereUniqueInput; }; -export type ReferendumSubscriptionPayload = { - __typename?: 'ReferendumSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type ReferendumSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** query root */ +export type Query_RootBlockNumbersArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type ReferendumUpdateInput = { - delay?: Maybe, - end?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - referendumId?: Maybe, - referendumStatus?: Maybe, - voteThreshold?: Maybe, -}; -export type ReferendumUpdateManyMutationInput = { - delay?: Maybe, - end?: Maybe, - preimageHash?: Maybe, - referendumId?: Maybe, - voteThreshold?: Maybe, +/** query root */ +export type Query_RootBlockNumbersConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type ReferendumUpdateOneRequiredWithoutReferendumStatusInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; -export type ReferendumUpdateOneWithoutPreimageInput = { - connect?: Maybe, - create?: Maybe, - delete?: Maybe, - disconnect?: Maybe, - update?: Maybe, - upsert?: Maybe, +/** query root */ +export type Query_RootComment_ReactionsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type ReferendumUpdateWithoutPreimageDataInput = { - delay?: Maybe, - end?: Maybe, - preimageHash?: Maybe, - referendumId?: Maybe, - referendumStatus?: Maybe, - voteThreshold?: Maybe, -}; -export type ReferendumUpdateWithoutReferendumStatusDataInput = { - delay?: Maybe, - end?: Maybe, - preimage?: Maybe, - preimageHash?: Maybe, - referendumId?: Maybe, - voteThreshold?: Maybe, +/** query root */ +export type Query_RootComment_Reactions_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type ReferendumUpsertWithoutPreimageInput = { - create: ReferendumCreateWithoutPreimageInput, - update: ReferendumUpdateWithoutPreimageDataInput, -}; -export type ReferendumUpsertWithoutReferendumStatusInput = { - create: ReferendumCreateWithoutReferendumStatusInput, - update: ReferendumUpdateWithoutReferendumStatusDataInput, +/** query root */ +export type Query_RootComment_Reactions_By_PkArgs = { + id: Scalars['Int']; }; -export type ReferendumWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - delay?: Maybe, - delay_gt?: Maybe, - delay_gte?: Maybe, - delay_in?: Maybe>, - delay_lt?: Maybe, - delay_lte?: Maybe, - delay_not?: Maybe, - delay_not_in?: Maybe>, - end?: Maybe, - end_gt?: Maybe, - end_gte?: Maybe, - end_in?: Maybe>, - end_lt?: Maybe, - end_lte?: Maybe, - end_not?: Maybe, - end_not_in?: Maybe>, - id?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_in?: Maybe>, - preimage?: Maybe, - preimageHash?: Maybe, - preimageHash_contains?: Maybe, - preimageHash_ends_with?: Maybe, - preimageHash_gt?: Maybe, - preimageHash_gte?: Maybe, - preimageHash_in?: Maybe>, - preimageHash_lt?: Maybe, - preimageHash_lte?: Maybe, - preimageHash_not?: Maybe, - preimageHash_not_contains?: Maybe, - preimageHash_not_ends_with?: Maybe, - preimageHash_not_in?: Maybe>, - preimageHash_not_starts_with?: Maybe, - preimageHash_starts_with?: Maybe, - referendumId?: Maybe, - referendumId_gt?: Maybe, - referendumId_gte?: Maybe, - referendumId_in?: Maybe>, - referendumId_lt?: Maybe, - referendumId_lte?: Maybe, - referendumId_not?: Maybe, - referendumId_not_in?: Maybe>, - referendumStatus_every?: Maybe, - referendumStatus_none?: Maybe, - referendumStatus_some?: Maybe, - voteThreshold?: Maybe, - voteThreshold_contains?: Maybe, - voteThreshold_ends_with?: Maybe, - voteThreshold_gt?: Maybe, - voteThreshold_gte?: Maybe, - voteThreshold_in?: Maybe>, - voteThreshold_lt?: Maybe, - voteThreshold_lte?: Maybe, - voteThreshold_not?: Maybe, - voteThreshold_not_contains?: Maybe, - voteThreshold_not_ends_with?: Maybe, - voteThreshold_not_in?: Maybe>, - voteThreshold_not_starts_with?: Maybe, - voteThreshold_starts_with?: Maybe, -}; -export type ReferendumWhereInput_Remote_Rel_Public_Onchain_Linksonchain_Referendum = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - delay?: Maybe, - delay_gt?: Maybe, - delay_gte?: Maybe, - delay_in?: Maybe>, - delay_lt?: Maybe, - delay_lte?: Maybe, - delay_not?: Maybe, - delay_not_in?: Maybe>, - end?: Maybe, - end_gt?: Maybe, - end_gte?: Maybe, - end_in?: Maybe>, - end_lt?: Maybe, - end_lte?: Maybe, - end_not?: Maybe, - end_not_in?: Maybe>, - id?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_in?: Maybe>, - preimage?: Maybe, - preimageHash?: Maybe, - preimageHash_contains?: Maybe, - preimageHash_ends_with?: Maybe, - preimageHash_gt?: Maybe, - preimageHash_gte?: Maybe, - preimageHash_in?: Maybe>, - preimageHash_lt?: Maybe, - preimageHash_lte?: Maybe, - preimageHash_not?: Maybe, - preimageHash_not_contains?: Maybe, - preimageHash_not_ends_with?: Maybe, - preimageHash_not_in?: Maybe>, - preimageHash_not_starts_with?: Maybe, - preimageHash_starts_with?: Maybe, - referendumId_gt?: Maybe, - referendumId_gte?: Maybe, - referendumId_in?: Maybe>, - referendumId_lt?: Maybe, - referendumId_lte?: Maybe, - referendumId_not?: Maybe, - referendumId_not_in?: Maybe>, - referendumStatus_every?: Maybe, - referendumStatus_none?: Maybe, - referendumStatus_some?: Maybe, - voteThreshold?: Maybe, - voteThreshold_contains?: Maybe, - voteThreshold_ends_with?: Maybe, - voteThreshold_gt?: Maybe, - voteThreshold_gte?: Maybe, - voteThreshold_in?: Maybe>, - voteThreshold_lt?: Maybe, - voteThreshold_lte?: Maybe, - voteThreshold_not?: Maybe, - voteThreshold_not_contains?: Maybe, - voteThreshold_not_ends_with?: Maybe, - voteThreshold_not_in?: Maybe>, - voteThreshold_not_starts_with?: Maybe, - voteThreshold_starts_with?: Maybe, +/** query root */ +export type Query_RootCommentsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type ReferendumWhereUniqueInput = { - id?: Maybe, - referendumId?: Maybe, -}; -export type Reward = Node & { - __typename?: 'Reward', - authoredBlock: BlockNumber, - id: Scalars['ID'], - sessionIndex: Session, - treasuryReward: Scalars['String'], - validatorReward: Scalars['String'], +/** query root */ +export type Query_RootComments_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type RewardConnection = { - __typename?: 'RewardConnection', - aggregate: AggregateReward, - edges: Array>, - pageInfo: PageInfo, -}; -export type RewardCreateInput = { - authoredBlock: BlockNumberCreateOneInput, - id?: Maybe, - sessionIndex: SessionCreateOneInput, - treasuryReward: Scalars['String'], - validatorReward: Scalars['String'], +/** query root */ +export type Query_RootComments_By_PkArgs = { + id: Scalars['uuid']; }; -export type RewardEdge = { - __typename?: 'RewardEdge', - cursor: Scalars['String'], - node: Reward, + +/** query root */ +export type Query_RootCouncilArgs = { + where: CouncilWhereUniqueInput; }; -export enum RewardOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - TreasuryRewardAsc = 'treasuryReward_ASC', - TreasuryRewardDesc = 'treasuryReward_DESC', - ValidatorRewardAsc = 'validatorReward_ASC', - ValidatorRewardDesc = 'validatorReward_DESC' -} -export type RewardPreviousValues = { - __typename?: 'RewardPreviousValues', - id: Scalars['ID'], - treasuryReward: Scalars['String'], - validatorReward: Scalars['String'], +/** query root */ +export type Query_RootCouncilMemberArgs = { + where: CouncilMemberWhereUniqueInput; }; -export type RewardSubscriptionPayload = { - __typename?: 'RewardSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type RewardSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** query root */ +export type Query_RootCouncilMembersArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type RewardUpdateInput = { - authoredBlock?: Maybe, - sessionIndex?: Maybe, - treasuryReward?: Maybe, - validatorReward?: Maybe, -}; -export type RewardUpdateManyMutationInput = { - treasuryReward?: Maybe, - validatorReward?: Maybe, +/** query root */ +export type Query_RootCouncilMembersConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type RewardWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - authoredBlock?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - sessionIndex?: Maybe, - treasuryReward?: Maybe, - treasuryReward_contains?: Maybe, - treasuryReward_ends_with?: Maybe, - treasuryReward_gt?: Maybe, - treasuryReward_gte?: Maybe, - treasuryReward_in?: Maybe>, - treasuryReward_lt?: Maybe, - treasuryReward_lte?: Maybe, - treasuryReward_not?: Maybe, - treasuryReward_not_contains?: Maybe, - treasuryReward_not_ends_with?: Maybe, - treasuryReward_not_in?: Maybe>, - treasuryReward_not_starts_with?: Maybe, - treasuryReward_starts_with?: Maybe, - validatorReward?: Maybe, - validatorReward_contains?: Maybe, - validatorReward_ends_with?: Maybe, - validatorReward_gt?: Maybe, - validatorReward_gte?: Maybe, - validatorReward_in?: Maybe>, - validatorReward_lt?: Maybe, - validatorReward_lte?: Maybe, - validatorReward_not?: Maybe, - validatorReward_not_contains?: Maybe, - validatorReward_not_ends_with?: Maybe, - validatorReward_not_in?: Maybe>, - validatorReward_not_starts_with?: Maybe, - validatorReward_starts_with?: Maybe, -}; -export type RewardWhereUniqueInput = { - id?: Maybe, +/** query root */ +export type Query_RootCouncilsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Session = Node & { - __typename?: 'Session', - id: Scalars['ID'], - index: Scalars['Int'], - start: BlockNumber, -}; -export type SessionConnection = { - __typename?: 'SessionConnection', - aggregate: AggregateSession, - edges: Array>, - pageInfo: PageInfo, +/** query root */ +export type Query_RootCouncilsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type SessionCreateInput = { - id?: Maybe, - index: Scalars['Int'], - start: BlockNumberCreateOneInput, -}; -export type SessionCreateOneInput = { - connect?: Maybe, - create?: Maybe, +/** query root */ +export type Query_RootEraArgs = { + where: EraWhereUniqueInput; }; -export type SessionEdge = { - __typename?: 'SessionEdge', - cursor: Scalars['String'], - node: Session, + +/** query root */ +export type Query_RootErasArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export enum SessionOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - IndexAsc = 'index_ASC', - IndexDesc = 'index_DESC' -} -export type SessionPreviousValues = { - __typename?: 'SessionPreviousValues', - id: Scalars['ID'], - index: Scalars['Int'], +/** query root */ +export type Query_RootErasConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type SessionSubscriptionPayload = { - __typename?: 'SessionSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type SessionSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** query root */ +export type Query_RootHeartBeatArgs = { + where: HeartBeatWhereUniqueInput; }; -export type SessionUpdateDataInput = { - index?: Maybe, - start?: Maybe, -}; -export type SessionUpdateInput = { - index?: Maybe, - start?: Maybe, +/** query root */ +export type Query_RootHeartBeatsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type SessionUpdateManyMutationInput = { - index?: Maybe, -}; -export type SessionUpdateOneRequiredInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, +/** query root */ +export type Query_RootHeartBeatsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type SessionUpsertNestedInput = { - create: SessionCreateInput, - update: SessionUpdateDataInput, -}; -export type SessionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - index?: Maybe, - index_gt?: Maybe, - index_gte?: Maybe, - index_in?: Maybe>, - index_lt?: Maybe, - index_lte?: Maybe, - index_not?: Maybe, - index_not_in?: Maybe>, - start?: Maybe, +/** query root */ +export type Query_RootMotionArgs = { + where: MotionWhereUniqueInput; }; -export type SessionWhereUniqueInput = { - id?: Maybe, - index?: Maybe, -}; -export type Slashing = Node & { - __typename?: 'Slashing', - amount: Scalars['String'], - blockNumber: BlockNumber, - id: Scalars['ID'], - who: Scalars['String'], +/** query root */ +export type Query_RootMotionProposalArgumentArgs = { + where: MotionProposalArgumentWhereUniqueInput; }; -export type SlashingConnection = { - __typename?: 'SlashingConnection', - aggregate: AggregateSlashing, - edges: Array>, - pageInfo: PageInfo, -}; -export type SlashingCreateInput = { - amount: Scalars['String'], - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - who: Scalars['String'], +/** query root */ +export type Query_RootMotionProposalArgumentsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type SlashingEdge = { - __typename?: 'SlashingEdge', - cursor: Scalars['String'], - node: Slashing, + +/** query root */ +export type Query_RootMotionProposalArgumentsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export enum SlashingOrderByInput { - AmountAsc = 'amount_ASC', - AmountDesc = 'amount_DESC', - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - WhoAsc = 'who_ASC', - WhoDesc = 'who_DESC' -} -export type SlashingPreviousValues = { - __typename?: 'SlashingPreviousValues', - amount: Scalars['String'], - id: Scalars['ID'], - who: Scalars['String'], +/** query root */ +export type Query_RootMotionStatusArgs = { + where: MotionStatusWhereUniqueInput; }; -export type SlashingSubscriptionPayload = { - __typename?: 'SlashingSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type SlashingSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** query root */ +export type Query_RootMotionStatusesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type SlashingUpdateInput = { - amount?: Maybe, - blockNumber?: Maybe, - who?: Maybe, -}; -export type SlashingUpdateManyMutationInput = { - amount?: Maybe, - who?: Maybe, +/** query root */ +export type Query_RootMotionStatusesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type SlashingWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - amount?: Maybe, - amount_contains?: Maybe, - amount_ends_with?: Maybe, - amount_gt?: Maybe, - amount_gte?: Maybe, - amount_in?: Maybe>, - amount_lt?: Maybe, - amount_lte?: Maybe, - amount_not?: Maybe, - amount_not_contains?: Maybe, - amount_not_ends_with?: Maybe, - amount_not_in?: Maybe>, - amount_not_starts_with?: Maybe, - amount_starts_with?: Maybe, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - who?: Maybe, - who_contains?: Maybe, - who_ends_with?: Maybe, - who_gt?: Maybe, - who_gte?: Maybe, - who_in?: Maybe>, - who_lt?: Maybe, - who_lte?: Maybe, - who_not?: Maybe, - who_not_contains?: Maybe, - who_not_ends_with?: Maybe, - who_not_in?: Maybe>, - who_not_starts_with?: Maybe, - who_starts_with?: Maybe, -}; -export type SlashingWhereUniqueInput = { - id?: Maybe, - who?: Maybe, +/** query root */ +export type Query_RootMotionsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Stake = Node & { - __typename?: 'Stake', - blockNumber: BlockNumber, - id: Scalars['ID'], - totalStake: Scalars['String'], -}; -export type StakeConnection = { - __typename?: 'StakeConnection', - aggregate: AggregateStake, - edges: Array>, - pageInfo: PageInfo, +/** query root */ +export type Query_RootMotionsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type StakeCreateInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - totalStake: Scalars['String'], -}; -export type StakeEdge = { - __typename?: 'StakeEdge', - cursor: Scalars['String'], - node: Stake, +/** query root */ +export type Query_RootNodeArgs = { + id: Scalars['ID']; }; -export enum StakeOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - TotalStakeAsc = 'totalStake_ASC', - TotalStakeDesc = 'totalStake_DESC' -} -export type StakePreviousValues = { - __typename?: 'StakePreviousValues', - id: Scalars['ID'], - totalStake: Scalars['String'], +/** query root */ +export type Query_RootNominationArgs = { + where: NominationWhereUniqueInput; }; -export type StakeSubscriptionPayload = { - __typename?: 'StakeSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, + +/** query root */ +export type Query_RootNominationsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type StakeSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, + +/** query root */ +export type Query_RootNominationsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type StakeUpdateInput = { - blockNumber?: Maybe, - totalStake?: Maybe, + +/** query root */ +export type Query_RootOfflineValidatorArgs = { + where: OfflineValidatorWhereUniqueInput; }; -export type StakeUpdateManyMutationInput = { - totalStake?: Maybe, + +/** query root */ +export type Query_RootOfflineValidatorsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type StakeWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - totalStake?: Maybe, - totalStake_contains?: Maybe, - totalStake_ends_with?: Maybe, - totalStake_gt?: Maybe, - totalStake_gte?: Maybe, - totalStake_in?: Maybe>, - totalStake_lt?: Maybe, - totalStake_lte?: Maybe, - totalStake_not?: Maybe, - totalStake_not_contains?: Maybe, - totalStake_not_ends_with?: Maybe, - totalStake_not_in?: Maybe>, - totalStake_not_starts_with?: Maybe, - totalStake_starts_with?: Maybe, + +/** query root */ +export type Query_RootOfflineValidatorsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type StakeWhereUniqueInput = { - id?: Maybe, + +/** query root */ +export type Query_RootOnchain_LinksArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type String_Comparison_Exp = { - _eq?: Maybe, - _gt?: Maybe, - _gte?: Maybe, - _ilike?: Maybe, - _in?: Maybe>, - _is_null?: Maybe, - _like?: Maybe, - _lt?: Maybe, - _lte?: Maybe, - _neq?: Maybe, - _nilike?: Maybe, - _nin?: Maybe>, - _nlike?: Maybe, - _nsimilar?: Maybe, - _similar?: Maybe, + +/** query root */ +export type Query_RootOnchain_Links_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription = { - __typename?: 'Subscription', - subscribed?: Maybe, + +/** query root */ +export type Query_RootOnchain_Links_By_PkArgs = { + id: Scalars['Int']; }; -export type Subscription_Root = { - __typename?: 'subscription_root', - blockIndex?: Maybe, - blockNumber?: Maybe, - comment_reactions: Array, - comment_reactions_aggregate: Comment_Reactions_Aggregate, - comment_reactions_by_pk?: Maybe, - comments: Array, - comments_aggregate: Comments_Aggregate, - comments_by_pk?: Maybe, - council?: Maybe, - councilMember?: Maybe, - era?: Maybe, - heartBeat?: Maybe, - motion?: Maybe, - motionProposalArgument?: Maybe, - motionStatus?: Maybe, - nomination?: Maybe, - offlineValidator?: Maybe, - onchain_links: Array, - onchain_links_aggregate: Onchain_Links_Aggregate, - onchain_links_by_pk?: Maybe, - poll: Array, - poll_aggregate: Poll_Aggregate, - poll_by_pk?: Maybe, - poll_votes: Array, - poll_votes_aggregate: Poll_Votes_Aggregate, - poll_votes_by_pk?: Maybe, - post_reactions: Array, - post_reactions_aggregate: Post_Reactions_Aggregate, - post_reactions_by_pk?: Maybe, - post_topics: Array, - post_topics_aggregate: Post_Topics_Aggregate, - post_topics_by_pk?: Maybe, - post_types: Array, - post_types_aggregate: Post_Types_Aggregate, - post_types_by_pk?: Maybe, - posts: Array, - posts_aggregate: Posts_Aggregate, - posts_by_pk?: Maybe, - preimage?: Maybe, - preimageArgument?: Maybe, - preimageStatus?: Maybe, - proposal?: Maybe, - proposalStatus?: Maybe, - referendum?: Maybe, - referendumStatus?: Maybe, - reward?: Maybe, - session?: Maybe, - slashing?: Maybe, - stake?: Maybe, - subscribed?: Maybe, - totalIssuance?: Maybe, - treasurySpendProposal?: Maybe, - treasuryStatus?: Maybe, - validator?: Maybe, -}; - - -export type Subscription_RootBlockIndexArgs = { - where?: Maybe -}; - - -export type Subscription_RootBlockNumberArgs = { - where?: Maybe + +/** query root */ +export type Query_RootPollArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootComment_ReactionsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPoll_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootComment_Reactions_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPoll_By_PkArgs = { + id: Scalars['Int']; }; -export type Subscription_RootComment_Reactions_By_PkArgs = { - id: Scalars['Int'] +/** query root */ +export type Query_RootPoll_VotesArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootCommentsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPoll_Votes_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootComments_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPoll_Votes_By_PkArgs = { + id: Scalars['Int']; }; -export type Subscription_RootComments_By_PkArgs = { - id: Scalars['uuid'] +/** query root */ +export type Query_RootPost_ReactionsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootCouncilArgs = { - where?: Maybe +/** query root */ +export type Query_RootPost_Reactions_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootCouncilMemberArgs = { - where?: Maybe +/** query root */ +export type Query_RootPost_Reactions_By_PkArgs = { + id: Scalars['Int']; }; -export type Subscription_RootEraArgs = { - where?: Maybe +/** query root */ +export type Query_RootPost_TopicsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootHeartBeatArgs = { - where?: Maybe +/** query root */ +export type Query_RootPost_Topics_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootMotionArgs = { - where?: Maybe +/** query root */ +export type Query_RootPost_Topics_By_PkArgs = { + id: Scalars['Int']; }; -export type Subscription_RootMotionProposalArgumentArgs = { - where?: Maybe +/** query root */ +export type Query_RootPost_TypesArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootMotionStatusArgs = { - where?: Maybe +/** query root */ +export type Query_RootPost_Types_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootNominationArgs = { - where?: Maybe +/** query root */ +export type Query_RootPost_Types_By_PkArgs = { + id: Scalars['Int']; }; -export type Subscription_RootOfflineValidatorArgs = { - where?: Maybe +/** query root */ +export type Query_RootPostsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootOnchain_LinksArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPosts_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Subscription_RootOnchain_Links_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPosts_By_PkArgs = { + id: Scalars['Int']; }; -export type Subscription_RootOnchain_Links_By_PkArgs = { - id: Scalars['Int'] +/** query root */ +export type Query_RootPreimageArgs = { + where: PreimageWhereUniqueInput; }; -export type Subscription_RootPollArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPreimageArgumentArgs = { + where: PreimageArgumentWhereUniqueInput; }; -export type Subscription_RootPoll_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPreimageArgumentsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPoll_By_PkArgs = { - id: Scalars['Int'] +/** query root */ +export type Query_RootPreimageArgumentsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPoll_VotesArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPreimageStatusArgs = { + where: PreimageStatusWhereUniqueInput; }; -export type Subscription_RootPoll_Votes_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPreimageStatusesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPoll_Votes_By_PkArgs = { - id: Scalars['Int'] +/** query root */ +export type Query_RootPreimageStatusesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPost_ReactionsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPreimagesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPost_Reactions_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootPreimagesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPost_Reactions_By_PkArgs = { - id: Scalars['Int'] +/** query root */ +export type Query_RootProposalArgs = { + where: ProposalWhereUniqueInput; }; -export type Subscription_RootPost_TopicsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootProposalStatusArgs = { + where: ProposalStatusWhereUniqueInput; }; -export type Subscription_RootPost_Topics_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootProposalStatusesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPost_Topics_By_PkArgs = { - id: Scalars['Int'] +/** query root */ +export type Query_RootProposalStatusesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPost_TypesArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootProposalsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPost_Types_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootProposalsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPost_Types_By_PkArgs = { - id: Scalars['Int'] +/** query root */ +export type Query_RootReferendumArgs = { + where: ReferendumWhereUniqueInput; }; -export type Subscription_RootPostsArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootReferendumStatusArgs = { + where: ReferendumStatusWhereUniqueInput; }; -export type Subscription_RootPosts_AggregateArgs = { - distinct_on?: Maybe>, - limit?: Maybe, - offset?: Maybe, - order_by?: Maybe>, - where?: Maybe +/** query root */ +export type Query_RootReferendumStatusesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPosts_By_PkArgs = { - id: Scalars['Int'] +/** query root */ +export type Query_RootReferendumStatusesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPreimageArgs = { - where?: Maybe +/** query root */ +export type Query_RootReferendumsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPreimageArgumentArgs = { - where?: Maybe +/** query root */ +export type Query_RootReferendumsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootPreimageStatusArgs = { - where?: Maybe +/** query root */ +export type Query_RootRewardArgs = { + where: RewardWhereUniqueInput; }; -export type Subscription_RootProposalArgs = { - where?: Maybe +/** query root */ +export type Query_RootRewardsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootProposalStatusArgs = { - where?: Maybe +/** query root */ +export type Query_RootRewardsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootReferendumArgs = { - where?: Maybe +/** query root */ +export type Query_RootSessionArgs = { + where: SessionWhereUniqueInput; }; -export type Subscription_RootReferendumStatusArgs = { - where?: Maybe +/** query root */ +export type Query_RootSessionsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootRewardArgs = { - where?: Maybe +/** query root */ +export type Query_RootSessionsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootSessionArgs = { - where?: Maybe +/** query root */ +export type Query_RootSlashingArgs = { + where: SlashingWhereUniqueInput; }; -export type Subscription_RootSlashingArgs = { - where?: Maybe +/** query root */ +export type Query_RootSlashingsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootStakeArgs = { - where?: Maybe +/** query root */ +export type Query_RootSlashingsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootTotalIssuanceArgs = { - where?: Maybe +/** query root */ +export type Query_RootStakeArgs = { + where: StakeWhereUniqueInput; }; -export type Subscription_RootTreasurySpendProposalArgs = { - where?: Maybe +/** query root */ +export type Query_RootStakesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootTreasuryStatusArgs = { - where?: Maybe +/** query root */ +export type Query_RootStakesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Subscription_RootValidatorArgs = { - where?: Maybe +/** query root */ +export type Query_RootSubscriptionArgs = { + post_id: Scalars['Int']; }; -export type Timestamp_Comparison_Exp = { - _eq?: Maybe, - _gt?: Maybe, - _gte?: Maybe, - _in?: Maybe>, - _is_null?: Maybe, - _lt?: Maybe, - _lte?: Maybe, - _neq?: Maybe, - _nin?: Maybe>, +/** query root */ +export type Query_RootTotalIssuanceArgs = { + where: TotalIssuanceWhereUniqueInput; }; -export type Timestamptz_Comparison_Exp = { - _eq?: Maybe, - _gt?: Maybe, - _gte?: Maybe, - _in?: Maybe>, - _is_null?: Maybe, - _lt?: Maybe, - _lte?: Maybe, - _neq?: Maybe, - _nin?: Maybe>, +/** query root */ +export type Query_RootTotalIssuancesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type Token = { - __typename?: 'Token', - token?: Maybe, -}; -export type TotalIssuance = Node & { - __typename?: 'TotalIssuance', - amount: Scalars['String'], - blockNumber: BlockNumber, - id: Scalars['ID'], +/** query root */ +export type Query_RootTotalIssuancesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type TotalIssuanceConnection = { - __typename?: 'TotalIssuanceConnection', - aggregate: AggregateTotalIssuance, - edges: Array>, - pageInfo: PageInfo, -}; -export type TotalIssuanceCreateInput = { - amount: Scalars['String'], - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, +/** query root */ +export type Query_RootTreasurySpendProposalArgs = { + where: TreasurySpendProposalWhereUniqueInput; }; -export type TotalIssuanceEdge = { - __typename?: 'TotalIssuanceEdge', - cursor: Scalars['String'], - node: TotalIssuance, + +/** query root */ +export type Query_RootTreasurySpendProposalsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export enum TotalIssuanceOrderByInput { - AmountAsc = 'amount_ASC', - AmountDesc = 'amount_DESC', - IdAsc = 'id_ASC', - IdDesc = 'id_DESC' -} -export type TotalIssuancePreviousValues = { - __typename?: 'TotalIssuancePreviousValues', - amount: Scalars['String'], - id: Scalars['ID'], +/** query root */ +export type Query_RootTreasurySpendProposalsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type TotalIssuanceSubscriptionPayload = { - __typename?: 'TotalIssuanceSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type TotalIssuanceSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** query root */ +export type Query_RootTreasuryStatusArgs = { + where: TreasuryStatusWhereUniqueInput; }; -export type TotalIssuanceUpdateInput = { - amount?: Maybe, - blockNumber?: Maybe, -}; -export type TotalIssuanceUpdateManyMutationInput = { - amount?: Maybe, +/** query root */ +export type Query_RootTreasuryStatusesArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type TotalIssuanceWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - amount?: Maybe, - amount_contains?: Maybe, - amount_ends_with?: Maybe, - amount_gt?: Maybe, - amount_gte?: Maybe, - amount_in?: Maybe>, - amount_lt?: Maybe, - amount_lte?: Maybe, - amount_not?: Maybe, - amount_not_contains?: Maybe, - amount_not_ends_with?: Maybe, - amount_not_in?: Maybe>, - amount_not_starts_with?: Maybe, - amount_starts_with?: Maybe, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, -}; -export type TotalIssuanceWhereUniqueInput = { - id?: Maybe, +/** query root */ +export type Query_RootTreasuryStatusesConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type TreasurySpendProposal = { - __typename?: 'TreasurySpendProposal', - beneficiary: Scalars['String'], - bond: Scalars['String'], - id: Scalars['Int'], - motion?: Maybe, - proposer: Scalars['String'], - treasuryProposalId: Scalars['Int'], - treasuryStatus?: Maybe>, - value: Scalars['String'], + +/** query root */ +export type Query_RootUserArgs = { + id: Scalars['Int']; }; -export type TreasurySpendProposalTreasuryStatusArgs = { - after?: Maybe, - before?: Maybe, - first?: Maybe, - last?: Maybe, - orderBy?: Maybe, - skip?: Maybe, - where?: Maybe +/** query root */ +export type Query_RootValidatorArgs = { + where: ValidatorWhereUniqueInput; }; -export type TreasurySpendProposalConnection = { - __typename?: 'TreasurySpendProposalConnection', - aggregate: AggregateTreasurySpendProposal, - edges: Array>, - pageInfo: PageInfo, -}; -export type TreasurySpendProposalCreateInput = { - beneficiary: Scalars['String'], - bond: Scalars['String'], - motion?: Maybe, - proposer: Scalars['String'], - treasuryProposalId: Scalars['Int'], - treasuryStatus?: Maybe, - value: Scalars['String'], +/** query root */ +export type Query_RootValidatorsArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type TreasurySpendProposalCreateOneWithoutMotionInput = { - connect?: Maybe, - create?: Maybe, -}; -export type TreasurySpendProposalCreateOneWithoutTreasuryStatusInput = { - connect?: Maybe, - create?: Maybe, +/** query root */ +export type Query_RootValidatorsConnectionArgs = { + after?: Maybe; + before?: Maybe; + first?: Maybe; + last?: Maybe; + orderBy?: Maybe; + skip?: Maybe; + where?: Maybe; }; -export type TreasurySpendProposalCreateWithoutMotionInput = { - beneficiary: Scalars['String'], - bond: Scalars['String'], - proposer: Scalars['String'], - treasuryProposalId: Scalars['Int'], - treasuryStatus?: Maybe, - value: Scalars['String'], +/** subscription root */ +export type Subscription_Root = { + __typename?: 'subscription_root'; + /** fetch data from the table: "comment_reactions" */ + comment_reactions: Array; + /** fetch aggregated fields from the table: "comment_reactions" */ + comment_reactions_aggregate: Comment_Reactions_Aggregate; + /** fetch data from the table: "comment_reactions" using primary key columns */ + comment_reactions_by_pk?: Maybe; + /** fetch data from the table: "comments" */ + comments: Array; + /** fetch aggregated fields from the table: "comments" */ + comments_aggregate: Comments_Aggregate; + /** fetch data from the table: "comments" using primary key columns */ + comments_by_pk?: Maybe; + /** fetch data from the table: "onchain_links" */ + onchain_links: Array; + /** fetch aggregated fields from the table: "onchain_links" */ + onchain_links_aggregate: Onchain_Links_Aggregate; + /** fetch data from the table: "onchain_links" using primary key columns */ + onchain_links_by_pk?: Maybe; + /** fetch data from the table: "poll" */ + poll: Array; + /** fetch aggregated fields from the table: "poll" */ + poll_aggregate: Poll_Aggregate; + /** fetch data from the table: "poll" using primary key columns */ + poll_by_pk?: Maybe; + /** fetch data from the table: "poll_votes" */ + poll_votes: Array; + /** fetch aggregated fields from the table: "poll_votes" */ + poll_votes_aggregate: Poll_Votes_Aggregate; + /** fetch data from the table: "poll_votes" using primary key columns */ + poll_votes_by_pk?: Maybe; + /** fetch data from the table: "post_reactions" */ + post_reactions: Array; + /** fetch aggregated fields from the table: "post_reactions" */ + post_reactions_aggregate: Post_Reactions_Aggregate; + /** fetch data from the table: "post_reactions" using primary key columns */ + post_reactions_by_pk?: Maybe; + /** fetch data from the table: "post_topics" */ + post_topics: Array; + /** fetch aggregated fields from the table: "post_topics" */ + post_topics_aggregate: Post_Topics_Aggregate; + /** fetch data from the table: "post_topics" using primary key columns */ + post_topics_by_pk?: Maybe; + /** fetch data from the table: "post_types" */ + post_types: Array; + /** fetch aggregated fields from the table: "post_types" */ + post_types_aggregate: Post_Types_Aggregate; + /** fetch data from the table: "post_types" using primary key columns */ + post_types_by_pk?: Maybe; + /** fetch data from the table: "posts" */ + posts: Array; + /** fetch aggregated fields from the table: "posts" */ + posts_aggregate: Posts_Aggregate; + /** fetch data from the table: "posts" using primary key columns */ + posts_by_pk?: Maybe; +}; + + +/** subscription root */ +export type Subscription_RootComment_ReactionsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasurySpendProposalCreateWithoutTreasuryStatusInput = { - beneficiary: Scalars['String'], - bond: Scalars['String'], - motion?: Maybe, - proposer: Scalars['String'], - treasuryProposalId: Scalars['Int'], - value: Scalars['String'], -}; -export type TreasurySpendProposalEdge = { - __typename?: 'TreasurySpendProposalEdge', - cursor: Scalars['String'], - node: TreasurySpendProposal, +/** subscription root */ +export type Subscription_RootComment_Reactions_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export enum TreasurySpendProposalOrderByInput { - BeneficiaryAsc = 'beneficiary_ASC', - BeneficiaryDesc = 'beneficiary_DESC', - BondAsc = 'bond_ASC', - BondDesc = 'bond_DESC', - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - ProposerAsc = 'proposer_ASC', - ProposerDesc = 'proposer_DESC', - TreasuryProposalIdAsc = 'treasuryProposalId_ASC', - TreasuryProposalIdDesc = 'treasuryProposalId_DESC', - ValueAsc = 'value_ASC', - ValueDesc = 'value_DESC' -} -export type TreasurySpendProposalPreviousValues = { - __typename?: 'TreasurySpendProposalPreviousValues', - beneficiary: Scalars['String'], - bond: Scalars['String'], - id: Scalars['Int'], - proposer: Scalars['String'], - treasuryProposalId: Scalars['Int'], - value: Scalars['String'], +/** subscription root */ +export type Subscription_RootComment_Reactions_By_PkArgs = { + id: Scalars['Int']; }; -export type TreasurySpendProposalSubscriptionPayload = { - __typename?: 'TreasurySpendProposalSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type TreasurySpendProposalSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** subscription root */ +export type Subscription_RootCommentsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasurySpendProposalUpdateInput = { - beneficiary?: Maybe, - bond?: Maybe, - motion?: Maybe, - proposer?: Maybe, - treasuryProposalId?: Maybe, - treasuryStatus?: Maybe, - value?: Maybe, -}; -export type TreasurySpendProposalUpdateManyMutationInput = { - beneficiary?: Maybe, - bond?: Maybe, - proposer?: Maybe, - treasuryProposalId?: Maybe, - value?: Maybe, +/** subscription root */ +export type Subscription_RootComments_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasurySpendProposalUpdateOneRequiredWithoutTreasuryStatusInput = { - connect?: Maybe, - create?: Maybe, - update?: Maybe, - upsert?: Maybe, -}; -export type TreasurySpendProposalUpdateOneWithoutMotionInput = { - connect?: Maybe, - create?: Maybe, - delete?: Maybe, - disconnect?: Maybe, - update?: Maybe, - upsert?: Maybe, +/** subscription root */ +export type Subscription_RootComments_By_PkArgs = { + id: Scalars['uuid']; }; -export type TreasurySpendProposalUpdateWithoutMotionDataInput = { - beneficiary?: Maybe, - bond?: Maybe, - proposer?: Maybe, - treasuryProposalId?: Maybe, - treasuryStatus?: Maybe, - value?: Maybe, -}; -export type TreasurySpendProposalUpdateWithoutTreasuryStatusDataInput = { - beneficiary?: Maybe, - bond?: Maybe, - motion?: Maybe, - proposer?: Maybe, - treasuryProposalId?: Maybe, - value?: Maybe, +/** subscription root */ +export type Subscription_RootOnchain_LinksArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasurySpendProposalUpsertWithoutMotionInput = { - create: TreasurySpendProposalCreateWithoutMotionInput, - update: TreasurySpendProposalUpdateWithoutMotionDataInput, -}; -export type TreasurySpendProposalUpsertWithoutTreasuryStatusInput = { - create: TreasurySpendProposalCreateWithoutTreasuryStatusInput, - update: TreasurySpendProposalUpdateWithoutTreasuryStatusDataInput, +/** subscription root */ +export type Subscription_RootOnchain_Links_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasurySpendProposalWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - beneficiary?: Maybe, - beneficiary_contains?: Maybe, - beneficiary_ends_with?: Maybe, - beneficiary_gt?: Maybe, - beneficiary_gte?: Maybe, - beneficiary_in?: Maybe>, - beneficiary_lt?: Maybe, - beneficiary_lte?: Maybe, - beneficiary_not?: Maybe, - beneficiary_not_contains?: Maybe, - beneficiary_not_ends_with?: Maybe, - beneficiary_not_in?: Maybe>, - beneficiary_not_starts_with?: Maybe, - beneficiary_starts_with?: Maybe, - bond?: Maybe, - bond_contains?: Maybe, - bond_ends_with?: Maybe, - bond_gt?: Maybe, - bond_gte?: Maybe, - bond_in?: Maybe>, - bond_lt?: Maybe, - bond_lte?: Maybe, - bond_not?: Maybe, - bond_not_contains?: Maybe, - bond_not_ends_with?: Maybe, - bond_not_in?: Maybe>, - bond_not_starts_with?: Maybe, - bond_starts_with?: Maybe, - id?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_in?: Maybe>, - motion?: Maybe, - proposer?: Maybe, - proposer_contains?: Maybe, - proposer_ends_with?: Maybe, - proposer_gt?: Maybe, - proposer_gte?: Maybe, - proposer_in?: Maybe>, - proposer_lt?: Maybe, - proposer_lte?: Maybe, - proposer_not?: Maybe, - proposer_not_contains?: Maybe, - proposer_not_ends_with?: Maybe, - proposer_not_in?: Maybe>, - proposer_not_starts_with?: Maybe, - proposer_starts_with?: Maybe, - treasuryProposalId?: Maybe, - treasuryProposalId_gt?: Maybe, - treasuryProposalId_gte?: Maybe, - treasuryProposalId_in?: Maybe>, - treasuryProposalId_lt?: Maybe, - treasuryProposalId_lte?: Maybe, - treasuryProposalId_not?: Maybe, - treasuryProposalId_not_in?: Maybe>, - treasuryStatus_every?: Maybe, - treasuryStatus_none?: Maybe, - treasuryStatus_some?: Maybe, - value?: Maybe, - value_contains?: Maybe, - value_ends_with?: Maybe, - value_gt?: Maybe, - value_gte?: Maybe, - value_in?: Maybe>, - value_lt?: Maybe, - value_lte?: Maybe, - value_not?: Maybe, - value_not_contains?: Maybe, - value_not_ends_with?: Maybe, - value_not_in?: Maybe>, - value_not_starts_with?: Maybe, - value_starts_with?: Maybe, -}; -export type TreasurySpendProposalWhereInput_Remote_Rel_Public_Onchain_Linksonchain_Treasury_Spend_Proposal = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - beneficiary?: Maybe, - beneficiary_contains?: Maybe, - beneficiary_ends_with?: Maybe, - beneficiary_gt?: Maybe, - beneficiary_gte?: Maybe, - beneficiary_in?: Maybe>, - beneficiary_lt?: Maybe, - beneficiary_lte?: Maybe, - beneficiary_not?: Maybe, - beneficiary_not_contains?: Maybe, - beneficiary_not_ends_with?: Maybe, - beneficiary_not_in?: Maybe>, - beneficiary_not_starts_with?: Maybe, - beneficiary_starts_with?: Maybe, - bond?: Maybe, - bond_contains?: Maybe, - bond_ends_with?: Maybe, - bond_gt?: Maybe, - bond_gte?: Maybe, - bond_in?: Maybe>, - bond_lt?: Maybe, - bond_lte?: Maybe, - bond_not?: Maybe, - bond_not_contains?: Maybe, - bond_not_ends_with?: Maybe, - bond_not_in?: Maybe>, - bond_not_starts_with?: Maybe, - bond_starts_with?: Maybe, - id?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_in?: Maybe>, - motion?: Maybe, - proposer?: Maybe, - proposer_contains?: Maybe, - proposer_ends_with?: Maybe, - proposer_gt?: Maybe, - proposer_gte?: Maybe, - proposer_in?: Maybe>, - proposer_lt?: Maybe, - proposer_lte?: Maybe, - proposer_not?: Maybe, - proposer_not_contains?: Maybe, - proposer_not_ends_with?: Maybe, - proposer_not_in?: Maybe>, - proposer_not_starts_with?: Maybe, - proposer_starts_with?: Maybe, - treasuryProposalId_gt?: Maybe, - treasuryProposalId_gte?: Maybe, - treasuryProposalId_in?: Maybe>, - treasuryProposalId_lt?: Maybe, - treasuryProposalId_lte?: Maybe, - treasuryProposalId_not?: Maybe, - treasuryProposalId_not_in?: Maybe>, - treasuryStatus_every?: Maybe, - treasuryStatus_none?: Maybe, - treasuryStatus_some?: Maybe, - value?: Maybe, - value_contains?: Maybe, - value_ends_with?: Maybe, - value_gt?: Maybe, - value_gte?: Maybe, - value_in?: Maybe>, - value_lt?: Maybe, - value_lte?: Maybe, - value_not?: Maybe, - value_not_contains?: Maybe, - value_not_ends_with?: Maybe, - value_not_in?: Maybe>, - value_not_starts_with?: Maybe, - value_starts_with?: Maybe, +/** subscription root */ +export type Subscription_RootOnchain_Links_By_PkArgs = { + id: Scalars['Int']; }; -export type TreasurySpendProposalWhereUniqueInput = { - id?: Maybe, - treasuryProposalId?: Maybe, -}; -export type TreasuryStatus = Node & { - __typename?: 'TreasuryStatus', - blockNumber: BlockNumber, - id: Scalars['ID'], - status: Scalars['String'], - treasurySpendProposal: TreasurySpendProposal, - uniqueStatus: Scalars['String'], +/** subscription root */ +export type Subscription_RootPollArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasuryStatusConnection = { - __typename?: 'TreasuryStatusConnection', - aggregate: AggregateTreasuryStatus, - edges: Array>, - pageInfo: PageInfo, -}; -export type TreasuryStatusCreateInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - status: Scalars['String'], - treasurySpendProposal: TreasurySpendProposalCreateOneWithoutTreasuryStatusInput, - uniqueStatus: Scalars['String'], +/** subscription root */ +export type Subscription_RootPoll_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasuryStatusCreateManyWithoutTreasurySpendProposalInput = { - connect?: Maybe>, - create?: Maybe>, -}; -export type TreasuryStatusCreateWithoutTreasurySpendProposalInput = { - blockNumber: BlockNumberCreateOneInput, - id?: Maybe, - status: Scalars['String'], - uniqueStatus: Scalars['String'], +/** subscription root */ +export type Subscription_RootPoll_By_PkArgs = { + id: Scalars['Int']; }; -export type TreasuryStatusEdge = { - __typename?: 'TreasuryStatusEdge', - cursor: Scalars['String'], - node: TreasuryStatus, + +/** subscription root */ +export type Subscription_RootPoll_VotesArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export enum TreasuryStatusOrderByInput { - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - StatusAsc = 'status_ASC', - StatusDesc = 'status_DESC', - UniqueStatusAsc = 'uniqueStatus_ASC', - UniqueStatusDesc = 'uniqueStatus_DESC' -} -export type TreasuryStatusPreviousValues = { - __typename?: 'TreasuryStatusPreviousValues', - id: Scalars['ID'], - status: Scalars['String'], - uniqueStatus: Scalars['String'], -}; - -export type TreasuryStatusScalarWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, - uniqueStatus?: Maybe, - uniqueStatus_contains?: Maybe, - uniqueStatus_ends_with?: Maybe, - uniqueStatus_gt?: Maybe, - uniqueStatus_gte?: Maybe, - uniqueStatus_in?: Maybe>, - uniqueStatus_lt?: Maybe, - uniqueStatus_lte?: Maybe, - uniqueStatus_not?: Maybe, - uniqueStatus_not_contains?: Maybe, - uniqueStatus_not_ends_with?: Maybe, - uniqueStatus_not_in?: Maybe>, - uniqueStatus_not_starts_with?: Maybe, - uniqueStatus_starts_with?: Maybe, +/** subscription root */ +export type Subscription_RootPoll_Votes_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasuryStatusSubscriptionPayload = { - __typename?: 'TreasuryStatusSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type TreasuryStatusSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** subscription root */ +export type Subscription_RootPoll_Votes_By_PkArgs = { + id: Scalars['Int']; }; -export type TreasuryStatusUpdateInput = { - blockNumber?: Maybe, - status?: Maybe, - treasurySpendProposal?: Maybe, - uniqueStatus?: Maybe, -}; -export type TreasuryStatusUpdateManyDataInput = { - status?: Maybe, - uniqueStatus?: Maybe, +/** subscription root */ +export type Subscription_RootPost_ReactionsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasuryStatusUpdateManyMutationInput = { - status?: Maybe, - uniqueStatus?: Maybe, -}; -export type TreasuryStatusUpdateManyWithoutTreasurySpendProposalInput = { - connect?: Maybe>, - create?: Maybe>, - delete?: Maybe>, - deleteMany?: Maybe>, - disconnect?: Maybe>, - set?: Maybe>, - update?: Maybe>, - updateMany?: Maybe>, - upsert?: Maybe>, +/** subscription root */ +export type Subscription_RootPost_Reactions_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasuryStatusUpdateManyWithWhereNestedInput = { - data: TreasuryStatusUpdateManyDataInput, - where: TreasuryStatusScalarWhereInput, -}; -export type TreasuryStatusUpdateWithoutTreasurySpendProposalDataInput = { - blockNumber?: Maybe, - status?: Maybe, - uniqueStatus?: Maybe, +/** subscription root */ +export type Subscription_RootPost_Reactions_By_PkArgs = { + id: Scalars['Int']; }; -export type TreasuryStatusUpdateWithWhereUniqueWithoutTreasurySpendProposalInput = { - data: TreasuryStatusUpdateWithoutTreasurySpendProposalDataInput, - where: TreasuryStatusWhereUniqueInput, -}; -export type TreasuryStatusUpsertWithWhereUniqueWithoutTreasurySpendProposalInput = { - create: TreasuryStatusCreateWithoutTreasurySpendProposalInput, - update: TreasuryStatusUpdateWithoutTreasurySpendProposalDataInput, - where: TreasuryStatusWhereUniqueInput, +/** subscription root */ +export type Subscription_RootPost_TopicsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type TreasuryStatusWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - blockNumber?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - status?: Maybe, - status_contains?: Maybe, - status_ends_with?: Maybe, - status_gt?: Maybe, - status_gte?: Maybe, - status_in?: Maybe>, - status_lt?: Maybe, - status_lte?: Maybe, - status_not?: Maybe, - status_not_contains?: Maybe, - status_not_ends_with?: Maybe, - status_not_in?: Maybe>, - status_not_starts_with?: Maybe, - status_starts_with?: Maybe, - treasurySpendProposal?: Maybe, - uniqueStatus?: Maybe, - uniqueStatus_contains?: Maybe, - uniqueStatus_ends_with?: Maybe, - uniqueStatus_gt?: Maybe, - uniqueStatus_gte?: Maybe, - uniqueStatus_in?: Maybe>, - uniqueStatus_lt?: Maybe, - uniqueStatus_lte?: Maybe, - uniqueStatus_not?: Maybe, - uniqueStatus_not_contains?: Maybe, - uniqueStatus_not_ends_with?: Maybe, - uniqueStatus_not_in?: Maybe>, - uniqueStatus_not_starts_with?: Maybe, - uniqueStatus_starts_with?: Maybe, -}; -export type TreasuryStatusWhereUniqueInput = { - id?: Maybe, - uniqueStatus?: Maybe, +/** subscription root */ +export type Subscription_RootPost_Topics_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type UndoEmailChangeResponse = { - __typename?: 'UndoEmailChangeResponse', - email?: Maybe, - message?: Maybe, - token?: Maybe, + +/** subscription root */ +export type Subscription_RootPost_Topics_By_PkArgs = { + id: Scalars['Int']; }; -export type User = { - __typename?: 'User', - email?: Maybe, - email_verified?: Maybe, - id?: Maybe, - kusama_default_address?: Maybe, - polkadot_default_address?: Maybe, - username?: Maybe, - web3signup?: Maybe, +/** subscription root */ +export type Subscription_RootPost_TypesArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Uuid_Comparison_Exp = { - _eq?: Maybe, - _gt?: Maybe, - _gte?: Maybe, - _in?: Maybe>, - _is_null?: Maybe, - _lt?: Maybe, - _lte?: Maybe, - _neq?: Maybe, - _nin?: Maybe>, +/** subscription root */ +export type Subscription_RootPost_Types_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type Validator = Node & { - __typename?: 'Validator', - controller: Scalars['String'], - id: Scalars['ID'], - preferences: Scalars['String'], - session: Session, - stash: Scalars['String'], -}; -export type ValidatorConnection = { - __typename?: 'ValidatorConnection', - aggregate: AggregateValidator, - edges: Array>, - pageInfo: PageInfo, +/** subscription root */ +export type Subscription_RootPost_Types_By_PkArgs = { + id: Scalars['Int']; }; -export type ValidatorCreateInput = { - controller: Scalars['String'], - id?: Maybe, - preferences: Scalars['String'], - session: SessionCreateOneInput, - stash: Scalars['String'], -}; -export type ValidatorEdge = { - __typename?: 'ValidatorEdge', - cursor: Scalars['String'], - node: Validator, +/** subscription root */ +export type Subscription_RootPostsArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export enum ValidatorOrderByInput { - ControllerAsc = 'controller_ASC', - ControllerDesc = 'controller_DESC', - IdAsc = 'id_ASC', - IdDesc = 'id_DESC', - PreferencesAsc = 'preferences_ASC', - PreferencesDesc = 'preferences_DESC', - StashAsc = 'stash_ASC', - StashDesc = 'stash_DESC' -} -export type ValidatorPreviousValues = { - __typename?: 'ValidatorPreviousValues', - controller: Scalars['String'], - id: Scalars['ID'], - preferences: Scalars['String'], - stash: Scalars['String'], +/** subscription root */ +export type Subscription_RootPosts_AggregateArgs = { + distinct_on?: Maybe>; + limit?: Maybe; + offset?: Maybe; + order_by?: Maybe>; + where?: Maybe; }; -export type ValidatorSubscriptionPayload = { - __typename?: 'ValidatorSubscriptionPayload', - mutation: MutationType, - node?: Maybe, - previousValues?: Maybe, - updatedFields?: Maybe>, -}; -export type ValidatorSubscriptionWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - mutation_in?: Maybe>, - node?: Maybe, - updatedFields_contains?: Maybe, - updatedFields_contains_every?: Maybe>, - updatedFields_contains_some?: Maybe>, +/** subscription root */ +export type Subscription_RootPosts_By_PkArgs = { + id: Scalars['Int']; }; -export type ValidatorUpdateInput = { - controller?: Maybe, - preferences?: Maybe, - session?: Maybe, - stash?: Maybe, -}; -export type ValidatorUpdateManyMutationInput = { - controller?: Maybe, - preferences?: Maybe, - stash?: Maybe, +/** expression to compare columns of type timestamp. All fields are combined with logical 'AND'. */ +export type Timestamp_Comparison_Exp = { + _eq?: Maybe; + _gt?: Maybe; + _gte?: Maybe; + _in?: Maybe>; + _is_null?: Maybe; + _lt?: Maybe; + _lte?: Maybe; + _neq?: Maybe; + _nin?: Maybe>; }; -export type ValidatorWhereInput = { - AND?: Maybe>, - NOT?: Maybe>, - OR?: Maybe>, - controller?: Maybe, - controller_contains?: Maybe, - controller_ends_with?: Maybe, - controller_gt?: Maybe, - controller_gte?: Maybe, - controller_in?: Maybe>, - controller_lt?: Maybe, - controller_lte?: Maybe, - controller_not?: Maybe, - controller_not_contains?: Maybe, - controller_not_ends_with?: Maybe, - controller_not_in?: Maybe>, - controller_not_starts_with?: Maybe, - controller_starts_with?: Maybe, - id?: Maybe, - id_contains?: Maybe, - id_ends_with?: Maybe, - id_gt?: Maybe, - id_gte?: Maybe, - id_in?: Maybe>, - id_lt?: Maybe, - id_lte?: Maybe, - id_not?: Maybe, - id_not_contains?: Maybe, - id_not_ends_with?: Maybe, - id_not_in?: Maybe>, - id_not_starts_with?: Maybe, - id_starts_with?: Maybe, - preferences?: Maybe, - preferences_contains?: Maybe, - preferences_ends_with?: Maybe, - preferences_gt?: Maybe, - preferences_gte?: Maybe, - preferences_in?: Maybe>, - preferences_lt?: Maybe, - preferences_lte?: Maybe, - preferences_not?: Maybe, - preferences_not_contains?: Maybe, - preferences_not_ends_with?: Maybe, - preferences_not_in?: Maybe>, - preferences_not_starts_with?: Maybe, - preferences_starts_with?: Maybe, - session?: Maybe, - stash?: Maybe, - stash_contains?: Maybe, - stash_ends_with?: Maybe, - stash_gt?: Maybe, - stash_gte?: Maybe, - stash_in?: Maybe>, - stash_lt?: Maybe, - stash_lte?: Maybe, - stash_not?: Maybe, - stash_not_contains?: Maybe, - stash_not_ends_with?: Maybe, - stash_not_in?: Maybe>, - stash_not_starts_with?: Maybe, - stash_starts_with?: Maybe, + +/** expression to compare columns of type timestamptz. All fields are combined with logical 'AND'. */ +export type Timestamptz_Comparison_Exp = { + _eq?: Maybe; + _gt?: Maybe; + _gte?: Maybe; + _in?: Maybe>; + _is_null?: Maybe; + _lt?: Maybe; + _lte?: Maybe; + _neq?: Maybe; + _nin?: Maybe>; }; -export type ValidatorWhereUniqueInput = { - id?: Maybe, + +/** expression to compare columns of type uuid. All fields are combined with logical 'AND'. */ +export type Uuid_Comparison_Exp = { + _eq?: Maybe; + _gt?: Maybe; + _gte?: Maybe; + _in?: Maybe>; + _is_null?: Maybe; + _lt?: Maybe; + _lte?: Maybe; + _neq?: Maybe; + _nin?: Maybe>; }; export type EditCommentMutationVariables = { - id: Scalars['uuid'], - content: Scalars['String'] + id: Scalars['uuid']; + content: Scalars['String']; }; export type EditCommentMutation = ( { __typename?: 'mutation_root' } - & { update_comments: Maybe<( + & { update_comments?: Maybe<( { __typename?: 'comments_mutation_response' } & Pick )> } ); export type LoginMutationVariables = { - password: Scalars['String'], - username: Scalars['String'] + password: Scalars['String']; + username: Scalars['String']; }; export type LoginMutation = ( { __typename?: 'mutation_root' } - & { login: Maybe<( + & { login?: Maybe<( { __typename?: 'LoginResponse' } & Pick )> } ); export type AddressLoginStartMutationVariables = { - address: Scalars['String'] + address: Scalars['String']; }; export type AddressLoginStartMutation = ( { __typename?: 'mutation_root' } - & { addressLoginStart: Maybe<( + & { addressLoginStart?: Maybe<( { __typename?: 'AddressLoginType' } & Pick )> } ); export type AddressLoginMutationVariables = { - address: Scalars['String'], - signature: Scalars['String'] + address: Scalars['String']; + signature: Scalars['String']; }; export type AddressLoginMutation = ( { __typename?: 'mutation_root' } - & { addressLogin: Maybe<( + & { addressLogin?: Maybe<( { __typename?: 'LoginResponse' } & Pick )> } @@ -11932,7 +11416,7 @@ export type LogoutMutationVariables = {}; export type LogoutMutation = ( { __typename?: 'mutation_root' } - & { logout: Maybe<( + & { logout?: Maybe<( { __typename?: 'Message' } & Pick )> } @@ -11945,7 +11429,7 @@ export type GetCouncilMembersQuery = ( { __typename?: 'query_root' } & { councils: Array )>> } @@ -11958,7 +11442,7 @@ export type PollFieldsFragment = ( ); export type PollQueryVariables = { - postId: Scalars['Int'] + postId: Scalars['Int']; }; @@ -11973,14 +11457,14 @@ export type PollQuery = ( export type PollVotesFieldsFragment = ( { __typename?: 'poll_votes' } & Pick - & { voter: Maybe<( + & { voter?: Maybe<( { __typename?: 'User' } & Pick )> } ); export type PollVotesQueryVariables = { - pollId: Scalars['Int'] + pollId: Scalars['Int']; }; @@ -11993,36 +11477,36 @@ export type PollVotesQuery = ( ); export type AddPollVoteMutationVariables = { - pollId: Scalars['Int'], - userId: Scalars['Int'], - vote: Scalars['bpchar'] + pollId: Scalars['Int']; + userId: Scalars['Int']; + vote: Scalars['bpchar']; }; export type AddPollVoteMutation = ( { __typename: 'mutation_root' } - & { insert_poll_votes_one: Maybe<( + & { insert_poll_votes_one?: Maybe<( { __typename?: 'poll_votes' } & Pick )> } ); export type DeleteVoteMutationVariables = { - pollId: Scalars['Int'], - userId: Scalars['Int'] + pollId: Scalars['Int']; + userId: Scalars['Int']; }; export type DeleteVoteMutation = ( { __typename?: 'mutation_root' } - & { delete_poll_votes: Maybe<( + & { delete_poll_votes?: Maybe<( { __typename?: 'poll_votes_mutation_response' } & Pick )> } ); export type CouncilAtBlockNumberQueryVariables = { - blockNumber: Scalars['Int'] + blockNumber: Scalars['Int']; }; @@ -12030,7 +11514,7 @@ export type CouncilAtBlockNumberQuery = ( { __typename?: 'query_root' } & { councils: Array )>> } @@ -12038,30 +11522,30 @@ export type CouncilAtBlockNumberQuery = ( ); export type EditPostMutationVariables = { - id: Scalars['Int'], - content: Scalars['String'], - title: Scalars['String'] + id: Scalars['Int']; + content: Scalars['String']; + title: Scalars['String']; }; export type EditPostMutation = ( { __typename?: 'mutation_root' } - & { update_posts: Maybe<( + & { update_posts?: Maybe<( { __typename?: 'posts_mutation_response' } & Pick )> } ); export type AddPostCommentMutationVariables = { - authorId: Scalars['Int'], - content: Scalars['String'], - postId: Scalars['Int'] + authorId: Scalars['Int']; + content: Scalars['String']; + postId: Scalars['Int']; }; export type AddPostCommentMutation = ( { __typename: 'mutation_root' } - & { insert_comments: Maybe<( + & { insert_comments?: Maybe<( { __typename?: 'comments_mutation_response' } & Pick )> } @@ -12070,14 +11554,14 @@ export type AddPostCommentMutation = ( export type PostReactionFieldsFragment = ( { __typename?: 'post_reactions' } & Pick - & { reacting_user: Maybe<( + & { reacting_user?: Maybe<( { __typename?: 'User' } & Pick )> } ); export type PostReactionsQueryVariables = { - postId: Scalars['Int'] + postId: Scalars['Int']; }; @@ -12092,14 +11576,14 @@ export type PostReactionsQuery = ( export type CommentReactionFieldsFragment = ( { __typename?: 'comment_reactions' } & Pick - & { reacting_user: Maybe<( + & { reacting_user?: Maybe<( { __typename?: 'User' } & Pick )> } ); export type CommentReactionsQueryVariables = { - commentId: Scalars['uuid'] + commentId: Scalars['uuid']; }; @@ -12112,159 +11596,159 @@ export type CommentReactionsQuery = ( ); export type AddPostReactionMutationVariables = { - postId: Scalars['Int'], - userId: Scalars['Int'], - reaction: Scalars['bpchar'] + postId: Scalars['Int']; + userId: Scalars['Int']; + reaction: Scalars['bpchar']; }; export type AddPostReactionMutation = ( { __typename: 'mutation_root' } - & { insert_post_reactions: Maybe<( + & { insert_post_reactions?: Maybe<( { __typename?: 'post_reactions_mutation_response' } & Pick )> } ); export type AddCommentReactionMutationVariables = { - commentId: Scalars['uuid'], - userId: Scalars['Int'], - reaction: Scalars['bpchar'] + commentId: Scalars['uuid']; + userId: Scalars['Int']; + reaction: Scalars['bpchar']; }; export type AddCommentReactionMutation = ( { __typename: 'mutation_root' } - & { insert_comment_reactions: Maybe<( + & { insert_comment_reactions?: Maybe<( { __typename?: 'comment_reactions_mutation_response' } & Pick )> } ); export type DeletePostReactionMutationVariables = { - postId: Scalars['Int'], - userId: Scalars['Int'], - reaction: Scalars['bpchar'] + postId: Scalars['Int']; + userId: Scalars['Int']; + reaction: Scalars['bpchar']; }; export type DeletePostReactionMutation = ( { __typename?: 'mutation_root' } - & { delete_post_reactions: Maybe<( + & { delete_post_reactions?: Maybe<( { __typename?: 'post_reactions_mutation_response' } & Pick )> } ); export type DeleteCommentReactionMutationVariables = { - commentId: Scalars['uuid'], - userId: Scalars['Int'], - reaction: Scalars['bpchar'] + commentId: Scalars['uuid']; + userId: Scalars['Int']; + reaction: Scalars['bpchar']; }; export type DeleteCommentReactionMutation = ( { __typename?: 'mutation_root' } - & { delete_comment_reactions: Maybe<( + & { delete_comment_reactions?: Maybe<( { __typename?: 'comment_reactions_mutation_response' } & Pick )> } ); export type ReportContentMutationVariables = { - network: Scalars['String'], - type: Scalars['String'], - content_id: Scalars['String'], - reason: Scalars['String'], - comments: Scalars['String'] + network: Scalars['String']; + type: Scalars['String']; + content_id: Scalars['String']; + reason: Scalars['String']; + comments: Scalars['String']; }; export type ReportContentMutation = ( { __typename?: 'mutation_root' } - & { reportContent: Maybe<( + & { reportContent?: Maybe<( { __typename?: 'Message' } & Pick )> } ); export type SignupMutationVariables = { - email?: Maybe, - password: Scalars['String'], - username: Scalars['String'] + email?: Maybe; + password: Scalars['String']; + username: Scalars['String']; }; export type SignupMutation = ( { __typename?: 'mutation_root' } - & { signup: Maybe<( + & { signup?: Maybe<( { __typename?: 'LoginResponse' } & Pick )> } ); export type AddressSignupStartMutationVariables = { - address: Scalars['String'] + address: Scalars['String']; }; export type AddressSignupStartMutation = ( { __typename?: 'mutation_root' } - & { addressSignupStart: Maybe<( + & { addressSignupStart?: Maybe<( { __typename?: 'AddressLoginType' } & Pick )> } ); export type AddressSignupConfirmMutationVariables = { - network: Scalars['String'], - address: Scalars['String'], - signature: Scalars['String'] + network: Scalars['String']; + address: Scalars['String']; + signature: Scalars['String']; }; export type AddressSignupConfirmMutation = ( { __typename?: 'mutation_root' } - & { addressSignupConfirm: Maybe<( + & { addressSignupConfirm?: Maybe<( { __typename?: 'LoginResponse' } & Pick )> } ); export type PostSubscribeMutationVariables = { - postId: Scalars['Int'] + postId: Scalars['Int']; }; export type PostSubscribeMutation = ( { __typename?: 'mutation_root' } - & { postSubscribe: Maybe<( + & { postSubscribe?: Maybe<( { __typename?: 'Message' } & Pick )> } ); export type PostUnsubscribeMutationVariables = { - postId: Scalars['Int'] + postId: Scalars['Int']; }; export type PostUnsubscribeMutation = ( { __typename?: 'mutation_root' } - & { postUnsubscribe: Maybe<( + & { postUnsubscribe?: Maybe<( { __typename?: 'Message' } & Pick )> } ); export type SubscriptionQueryVariables = { - postId: Scalars['Int'] + postId: Scalars['Int']; }; export type SubscriptionQuery = ( { __typename?: 'query_root' } - & { subscription: Maybe<( + & { subscription?: Maybe<( { __typename?: 'Subscription' } & Pick )> } @@ -12275,7 +11759,7 @@ export type Get_Refresh_TokenQueryVariables = {}; export type Get_Refresh_TokenQuery = ( { __typename?: 'query_root' } - & { token: Maybe<( + & { token?: Maybe<( { __typename?: 'Token' } & Pick )> } @@ -12289,23 +11773,23 @@ export type AuthorFieldsFragment = ( export type CommentFieldsFragment = ( { __typename?: 'comments' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )> } ); export type CreatePostMutationVariables = { - userId: Scalars['Int'], - content: Scalars['String'], - topicId: Scalars['Int'], - title: Scalars['String'] + userId: Scalars['Int']; + content: Scalars['String']; + topicId: Scalars['Int']; + title: Scalars['String']; }; export type CreatePostMutation = ( { __typename: 'mutation_root' } - & { insert_posts: Maybe<( + & { insert_posts?: Maybe<( { __typename?: 'posts_mutation_response' } & Pick & { returning: Array<( @@ -12316,14 +11800,14 @@ export type CreatePostMutation = ( ); export type CreatePollMutationVariables = { - postId: Scalars['Int'], - blockEnd: Scalars['Int'] + postId: Scalars['Int']; + blockEnd: Scalars['Int']; }; export type CreatePollMutation = ( { __typename: 'mutation_root' } - & { insert_poll: Maybe<( + & { insert_poll?: Maybe<( { __typename?: 'poll_mutation_response' } & Pick )> } @@ -12345,17 +11829,6 @@ export type Post_TopicsQuery = ( )> } ); -export type GetCurrentBlockNumberQueryVariables = {}; - - -export type GetCurrentBlockNumberQuery = ( - { __typename?: 'query_root' } - & { blockNumbers: Array - )>> } -); - export type OnchainLinkDiscussionFragment = ( { __typename?: 'onchain_links' } & Pick @@ -12364,13 +11837,13 @@ export type OnchainLinkDiscussionFragment = ( export type DiscussionPostFragment = ( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments: Array<( { __typename?: 'comments' } & CommentFieldsFragment - )>, onchain_link: Maybe<( + )>, onchain_link?: Maybe<( { __typename?: 'onchain_links' } & OnchainLinkDiscussionFragment )>, topic: ( @@ -12383,7 +11856,7 @@ export type DiscussionPostFragment = ( ); export type DiscussionPostAndCommentsQueryVariables = { - id: Scalars['Int'] + id: Scalars['Int']; }; @@ -12396,7 +11869,7 @@ export type DiscussionPostAndCommentsQuery = ( ); export type LatestDiscussionPostsQueryVariables = { - limit?: Scalars['Int'] + limit?: Scalars['Int']; }; @@ -12405,12 +11878,12 @@ export type LatestDiscussionPostsQuery = ( & { posts: Array<( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments_aggregate: ( { __typename?: 'comments_aggregate' } - & { aggregate: Maybe<( + & { aggregate?: Maybe<( { __typename?: 'comments_aggregate_fields' } & Pick )> } @@ -12424,7 +11897,7 @@ export type LatestDiscussionPostsQuery = ( export type OnchainLinkMotionPreimageFragment = ( { __typename?: 'Preimage' } & Pick - & { preimageArguments: Maybe )>> } @@ -12441,16 +11914,16 @@ export type OnchainLinkMotionFragment = ( & { onchain_motion: Array - & { motionStatus: Maybe - )>>, motionProposalArguments: Maybe>, motionProposalArguments?: Maybe - )>>, preimage: Maybe<( + )>>, preimage?: Maybe<( { __typename?: 'Preimage' } & OnchainLinkMotionPreimageFragment - )>, treasurySpendProposal: Maybe<( + )>, treasurySpendProposal?: Maybe<( { __typename?: 'TreasurySpendProposal' } & OnchainLinkMotionTreasuryFragment )> } @@ -12460,13 +11933,13 @@ export type OnchainLinkMotionFragment = ( export type MotionPostFragment = ( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments: Array<( { __typename?: 'comments' } & CommentFieldsFragment - )>, onchain_link: Maybe<( + )>, onchain_link?: Maybe<( { __typename?: 'onchain_links' } & OnchainLinkMotionFragment )>, topic: ( @@ -12479,7 +11952,7 @@ export type MotionPostFragment = ( ); export type MotionPostAndCommentsQueryVariables = { - id: Scalars['Int'] + id: Scalars['Int']; }; @@ -12492,24 +11965,24 @@ export type MotionPostAndCommentsQuery = ( ); export type ChangeNotificationPreferenceMutationVariables = { - postParticipated?: Maybe, - postCreated?: Maybe, - newProposal?: Maybe, - ownProposal?: Maybe + postParticipated?: Maybe; + postCreated?: Maybe; + newProposal?: Maybe; + ownProposal?: Maybe; }; export type ChangeNotificationPreferenceMutation = ( { __typename?: 'mutation_root' } - & { changeNotificationPreference: Maybe<( + & { changeNotificationPreference?: Maybe<( { __typename?: 'ChangeResponse' } & Pick )> } ); export type LatestMotionPostsQueryVariables = { - postType: Scalars['Int'], - limit?: Scalars['Int'] + postType: Scalars['Int']; + limit?: Scalars['Int']; }; @@ -12518,12 +11991,12 @@ export type LatestMotionPostsQuery = ( & { posts: Array<( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments_aggregate: ( { __typename?: 'comments_aggregate' } - & { aggregate: Maybe<( + & { aggregate?: Maybe<( { __typename?: 'comments_aggregate_fields' } & Pick )> } @@ -12533,16 +12006,16 @@ export type LatestMotionPostsQuery = ( ), topic: ( { __typename?: 'post_topics' } & Pick - ), onchain_link: Maybe<( + ), onchain_link?: Maybe<( { __typename?: 'onchain_links' } & Pick & { onchain_motion: Array - & { motionStatus: Maybe - )>>, preimage: Maybe<( + )>>, preimage?: Maybe<( { __typename?: 'Preimage' } & Pick )> } @@ -12552,9 +12025,9 @@ export type LatestMotionPostsQuery = ( ); export type LatestDemocracyProposalPostsQueryVariables = { - postType: Scalars['Int'], - postTopic: Scalars['Int'], - limit?: Scalars['Int'] + postType: Scalars['Int']; + postTopic: Scalars['Int']; + limit?: Scalars['Int']; }; @@ -12563,12 +12036,12 @@ export type LatestDemocracyProposalPostsQuery = ( & { posts: Array<( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments_aggregate: ( { __typename?: 'comments_aggregate' } - & { aggregate: Maybe<( + & { aggregate?: Maybe<( { __typename?: 'comments_aggregate_fields' } & Pick )> } @@ -12578,16 +12051,16 @@ export type LatestDemocracyProposalPostsQuery = ( ), topic: ( { __typename?: 'post_topics' } & Pick - ), onchain_link: Maybe<( + ), onchain_link?: Maybe<( { __typename?: 'onchain_links' } & Pick & { onchain_proposal: Array - & { proposalStatus: Maybe - )>>, preimage: Maybe<( + )>>, preimage?: Maybe<( { __typename?: 'Preimage' } & Pick )> } @@ -12597,8 +12070,8 @@ export type LatestDemocracyProposalPostsQuery = ( ); export type LatestReferendaPostsQueryVariables = { - postType: Scalars['Int'], - limit?: Scalars['Int'] + postType: Scalars['Int']; + limit?: Scalars['Int']; }; @@ -12607,12 +12080,12 @@ export type LatestReferendaPostsQuery = ( & { posts: Array<( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments_aggregate: ( { __typename?: 'comments_aggregate' } - & { aggregate: Maybe<( + & { aggregate?: Maybe<( { __typename?: 'comments_aggregate_fields' } & Pick )> } @@ -12622,16 +12095,16 @@ export type LatestReferendaPostsQuery = ( ), topic: ( { __typename?: 'post_topics' } & Pick - ), onchain_link: Maybe<( + ), onchain_link?: Maybe<( { __typename?: 'onchain_links' } & Pick & { onchain_referendum: Array - & { referendumStatus: Maybe - )>>, preimage: Maybe<( + )>>, preimage?: Maybe<( { __typename?: 'Preimage' } & Pick )> } @@ -12641,9 +12114,9 @@ export type LatestReferendaPostsQuery = ( ); export type LatestDemocracyTreasuryProposalPostsQueryVariables = { - postType: Scalars['Int'], - postTopic: Scalars['Int'], - limit?: Scalars['Int'] + postType: Scalars['Int']; + postTopic: Scalars['Int']; + limit?: Scalars['Int']; }; @@ -12652,12 +12125,12 @@ export type LatestDemocracyTreasuryProposalPostsQuery = ( & { posts: Array<( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments_aggregate: ( { __typename?: 'comments_aggregate' } - & { aggregate: Maybe<( + & { aggregate?: Maybe<( { __typename?: 'comments_aggregate_fields' } & Pick )> } @@ -12667,13 +12140,13 @@ export type LatestDemocracyTreasuryProposalPostsQuery = ( ), topic: ( { __typename?: 'post_topics' } & Pick - ), onchain_link: Maybe<( + ), onchain_link?: Maybe<( { __typename?: 'onchain_links' } & Pick & { onchain_treasury_spend_proposal: Array - & { treasuryStatus: Maybe )>> } @@ -12688,13 +12161,13 @@ export type OnchainLinkProposalFragment = ( & { onchain_proposal: Array - & { proposalStatus: Maybe - )>>, preimage: Maybe<( + )>>, preimage?: Maybe<( { __typename?: 'Preimage' } & Pick - & { preimageArguments: Maybe )>> } @@ -12705,13 +12178,13 @@ export type OnchainLinkProposalFragment = ( export type ProposalPostFragment = ( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments: Array<( { __typename?: 'comments' } & CommentFieldsFragment - )>, onchain_link: Maybe<( + )>, onchain_link?: Maybe<( { __typename?: 'onchain_links' } & OnchainLinkProposalFragment )>, topic: ( @@ -12724,7 +12197,7 @@ export type ProposalPostFragment = ( ); export type ProposalPostAndCommentsQueryVariables = { - id: Scalars['Int'] + id: Scalars['Int']; }; @@ -12742,17 +12215,17 @@ export type OnchainLinkReferendumFragment = ( & { onchain_referendum: Array - & { referendumStatus: Maybe & { blockNumber: ( { __typename?: 'BlockNumber' } & Pick ) } - )>>, preimage: Maybe<( + )>>, preimage?: Maybe<( { __typename?: 'Preimage' } & Pick - & { preimageArguments: Maybe )>> } @@ -12763,13 +12236,13 @@ export type OnchainLinkReferendumFragment = ( export type ReferendumPostFragment = ( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments: Array<( { __typename?: 'comments' } & CommentFieldsFragment - )>, onchain_link: Maybe<( + )>, onchain_link?: Maybe<( { __typename?: 'onchain_links' } & OnchainLinkReferendumFragment )>, topic: ( @@ -12782,7 +12255,7 @@ export type ReferendumPostFragment = ( ); export type ReferendumPostAndCommentsQueryVariables = { - id: Scalars['Int'] + id: Scalars['Int']; }; @@ -12795,111 +12268,111 @@ export type ReferendumPostAndCommentsQuery = ( ); export type RequestResetPasswordMutationVariables = { - email: Scalars['String'] + email: Scalars['String']; }; export type RequestResetPasswordMutation = ( { __typename?: 'mutation_root' } - & { requestResetPassword: Maybe<( + & { requestResetPassword?: Maybe<( { __typename?: 'Message' } & Pick )> } ); export type ResetPasswordMutationVariables = { - newPassword: Scalars['String'], - userId: Scalars['Int'], - token: Scalars['String'] + newPassword: Scalars['String']; + userId: Scalars['Int']; + token: Scalars['String']; }; export type ResetPasswordMutation = ( { __typename?: 'mutation_root' } - & { resetPassword: Maybe<( + & { resetPassword?: Maybe<( { __typename?: 'Message' } & Pick )> } ); export type ChangeUsernameMutationVariables = { - username: Scalars['String'], - password: Scalars['String'] + username: Scalars['String']; + password: Scalars['String']; }; export type ChangeUsernameMutation = ( { __typename?: 'mutation_root' } - & { changeUsername: Maybe<( + & { changeUsername?: Maybe<( { __typename?: 'ChangeResponse' } & Pick )> } ); export type ChangeEmailMutationVariables = { - email: Scalars['String'], - password: Scalars['String'] + email: Scalars['String']; + password: Scalars['String']; }; export type ChangeEmailMutation = ( { __typename?: 'mutation_root' } - & { changeEmail: Maybe<( + & { changeEmail?: Maybe<( { __typename?: 'ChangeResponse' } & Pick )> } ); export type ChangePasswordMutationVariables = { - oldPassword: Scalars['String'], - newPassword: Scalars['String'] + oldPassword: Scalars['String']; + newPassword: Scalars['String']; }; export type ChangePasswordMutation = ( { __typename?: 'mutation_root' } - & { changePassword: Maybe<( + & { changePassword?: Maybe<( { __typename?: 'Message' } & Pick )> } ); export type AddressLinkStartMutationVariables = { - network: Scalars['String'], - address: Scalars['String'] + network: Scalars['String']; + address: Scalars['String']; }; export type AddressLinkStartMutation = ( { __typename?: 'mutation_root' } - & { addressLinkStart: Maybe<( + & { addressLinkStart?: Maybe<( { __typename?: 'AddressLinkType' } & Pick )> } ); export type AddressLinkConfirmMutationVariables = { - address_id: Scalars['Int'], - signature: Scalars['String'] + address_id: Scalars['Int']; + signature: Scalars['String']; }; export type AddressLinkConfirmMutation = ( { __typename?: 'mutation_root' } - & { addressLinkConfirm: Maybe<( + & { addressLinkConfirm?: Maybe<( { __typename?: 'ChangeResponse' } & Pick )> } ); export type AddressUnlinkMutationVariables = { - address: Scalars['String'] + address: Scalars['String']; }; export type AddressUnlinkMutation = ( { __typename?: 'mutation_root' } - & { addressUnlink: Maybe<( + & { addressUnlink?: Maybe<( { __typename?: 'ChangeResponse' } & Pick )> } @@ -12910,50 +12383,50 @@ export type ResendVerifyEmailTokenMutationVariables = {}; export type ResendVerifyEmailTokenMutation = ( { __typename?: 'mutation_root' } - & { resendVerifyEmailToken: Maybe<( + & { resendVerifyEmailToken?: Maybe<( { __typename?: 'Message' } & Pick )> } ); export type SetDefaultAddressMutationVariables = { - address: Scalars['String'] + address: Scalars['String']; }; export type SetDefaultAddressMutation = ( { __typename?: 'mutation_root' } - & { setDefaultAddress: Maybe<( + & { setDefaultAddress?: Maybe<( { __typename?: 'ChangeResponse' } & Pick )> } ); export type SetCredentialsStartMutationVariables = { - address: Scalars['String'] + address: Scalars['String']; }; export type SetCredentialsStartMutation = ( { __typename?: 'mutation_root' } - & { setCredentialsStart: Maybe<( + & { setCredentialsStart?: Maybe<( { __typename?: 'AddressLoginType' } & Pick )> } ); export type SetCredentialsConfirmMutationVariables = { - address: Scalars['String'], - email?: Maybe, - signature: Scalars['String'], - username: Scalars['String'], - password: Scalars['String'] + address: Scalars['String']; + email?: Maybe; + signature: Scalars['String']; + username: Scalars['String']; + password: Scalars['String']; }; export type SetCredentialsConfirmMutation = ( { __typename?: 'mutation_root' } - & { setCredentialsConfirm: Maybe<( + & { setCredentialsConfirm?: Maybe<( { __typename?: 'ChangeResponse' } & Pick )> } @@ -12965,7 +12438,7 @@ export type OnchainLinkTreasuryProposalFragment = ( & { onchain_treasury_spend_proposal: Array - & { treasuryStatus: Maybe )>> } @@ -12975,13 +12448,13 @@ export type OnchainLinkTreasuryProposalFragment = ( export type TreasuryProposalPostFragment = ( { __typename?: 'posts' } & Pick - & { author: Maybe<( + & { author?: Maybe<( { __typename?: 'User' } & AuthorFieldsFragment )>, comments: Array<( { __typename?: 'comments' } & CommentFieldsFragment - )>, onchain_link: Maybe<( + )>, onchain_link?: Maybe<( { __typename?: 'onchain_links' } & OnchainLinkTreasuryProposalFragment )>, topic: ( @@ -12994,7 +12467,7 @@ export type TreasuryProposalPostFragment = ( ); export type TreasuryProposalPostAndCommentsQueryVariables = { - id: Scalars['Int'] + id: Scalars['Int']; }; @@ -13007,26 +12480,26 @@ export type TreasuryProposalPostAndCommentsQuery = ( ); export type UndoEmailChangeMutationVariables = { - token: Scalars['String'] + token: Scalars['String']; }; export type UndoEmailChangeMutation = ( { __typename?: 'mutation_root' } - & { undoEmailChange: Maybe<( + & { undoEmailChange?: Maybe<( { __typename?: 'UndoEmailChangeResponse' } & Pick )> } ); export type VerifyEmailMutationVariables = { - token: Scalars['String'] + token: Scalars['String']; }; export type VerifyEmailMutation = ( { __typename?: 'mutation_root' } - & { verifyEmail: Maybe<( + & { verifyEmail?: Maybe<( { __typename?: 'ChangeResponse' } & Pick )> } @@ -13556,7 +13029,7 @@ export const GetCouncilMembersDocument = gql` * __useGetCouncilMembersQuery__ * * To run a query within a React component, call `useGetCouncilMembersQuery` and pass it any options that fit your needs. - * When your component renders, `useGetCouncilMembersQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useGetCouncilMembersQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -13588,7 +13061,7 @@ export const PollDocument = gql` * __usePollQuery__ * * To run a query within a React component, call `usePollQuery` and pass it any options that fit your needs. - * When your component renders, `usePollQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `usePollQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -13621,7 +13094,7 @@ export const PollVotesDocument = gql` * __usePollVotesQuery__ * * To run a query within a React component, call `usePollVotesQuery` and pass it any options that fit your needs. - * When your component renders, `usePollVotesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `usePollVotesQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -13724,7 +13197,7 @@ export const CouncilAtBlockNumberDocument = gql` * __useCouncilAtBlockNumberQuery__ * * To run a query within a React component, call `useCouncilAtBlockNumberQuery` and pass it any options that fit your needs. - * When your component renders, `useCouncilAtBlockNumberQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useCouncilAtBlockNumberQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -13826,7 +13299,7 @@ export const PostReactionsDocument = gql` * __usePostReactionsQuery__ * * To run a query within a React component, call `usePostReactionsQuery` and pass it any options that fit your needs. - * When your component renders, `usePostReactionsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `usePostReactionsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -13859,7 +13332,7 @@ export const CommentReactionsDocument = gql` * __useCommentReactionsQuery__ * * To run a query within a React component, call `useCommentReactionsQuery` and pass it any options that fit your needs. - * When your component renders, `useCommentReactionsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useCommentReactionsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14231,7 +13704,7 @@ export const SubscriptionDocument = gql` * __useSubscriptionQuery__ * * To run a query within a React component, call `useSubscriptionQuery` and pass it any options that fit your needs. - * When your component renders, `useSubscriptionQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useSubscriptionQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14264,7 +13737,7 @@ export const Get_Refresh_TokenDocument = gql` * __useGet_Refresh_TokenQuery__ * * To run a query within a React component, call `useGet_Refresh_TokenQuery` and pass it any options that fit your needs. - * When your component renders, `useGet_Refresh_TokenQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useGet_Refresh_TokenQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14369,7 +13842,7 @@ export const Post_TopicsDocument = gql` * __usePost_TopicsQuery__ * * To run a query within a React component, call `usePost_TopicsQuery` and pass it any options that fit your needs. - * When your component renders, `usePost_TopicsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `usePost_TopicsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14389,38 +13862,6 @@ export function usePost_TopicsLazyQuery(baseOptions?: ApolloReactHooks.LazyQuery export type Post_TopicsQueryHookResult = ReturnType; export type Post_TopicsLazyQueryHookResult = ReturnType; export type Post_TopicsQueryResult = ApolloReactCommon.QueryResult; -export const GetCurrentBlockNumberDocument = gql` - query getCurrentBlockNumber { - blockNumbers(orderBy: number_DESC, first: 1) { - number - } -} - `; - -/** - * __useGetCurrentBlockNumberQuery__ - * - * To run a query within a React component, call `useGetCurrentBlockNumberQuery` and pass it any options that fit your needs. - * When your component renders, `useGetCurrentBlockNumberQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetCurrentBlockNumberQuery({ - * variables: { - * }, - * }); - */ -export function useGetCurrentBlockNumberQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { - return ApolloReactHooks.useQuery(GetCurrentBlockNumberDocument, baseOptions); - } -export function useGetCurrentBlockNumberLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { - return ApolloReactHooks.useLazyQuery(GetCurrentBlockNumberDocument, baseOptions); - } -export type GetCurrentBlockNumberQueryHookResult = ReturnType; -export type GetCurrentBlockNumberLazyQueryHookResult = ReturnType; -export type GetCurrentBlockNumberQueryResult = ApolloReactCommon.QueryResult; export const DiscussionPostAndCommentsDocument = gql` query DiscussionPostAndComments($id: Int!) { posts(where: {id: {_eq: $id}}) { @@ -14433,7 +13874,7 @@ export const DiscussionPostAndCommentsDocument = gql` * __useDiscussionPostAndCommentsQuery__ * * To run a query within a React component, call `useDiscussionPostAndCommentsQuery` and pass it any options that fit your needs. - * When your component renders, `useDiscussionPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useDiscussionPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14481,7 +13922,7 @@ export const LatestDiscussionPostsDocument = gql` * __useLatestDiscussionPostsQuery__ * * To run a query within a React component, call `useLatestDiscussionPostsQuery` and pass it any options that fit your needs. - * When your component renders, `useLatestDiscussionPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useLatestDiscussionPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14514,7 +13955,7 @@ export const MotionPostAndCommentsDocument = gql` * __useMotionPostAndCommentsQuery__ * * To run a query within a React component, call `useMotionPostAndCommentsQuery` and pass it any options that fit your needs. - * When your component renders, `useMotionPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useMotionPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14618,7 +14059,7 @@ export const LatestMotionPostsDocument = gql` * __useLatestMotionPostsQuery__ * * To run a query within a React component, call `useLatestMotionPostsQuery` and pass it any options that fit your needs. - * When your component renders, `useLatestMotionPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useLatestMotionPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14687,7 +14128,7 @@ export const LatestDemocracyProposalPostsDocument = gql` * __useLatestDemocracyProposalPostsQuery__ * * To run a query within a React component, call `useLatestDemocracyProposalPostsQuery` and pass it any options that fit your needs. - * When your component renders, `useLatestDemocracyProposalPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useLatestDemocracyProposalPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14757,7 +14198,7 @@ export const LatestReferendaPostsDocument = gql` * __useLatestReferendaPostsQuery__ * * To run a query within a React component, call `useLatestReferendaPostsQuery` and pass it any options that fit your needs. - * When your component renders, `useLatestReferendaPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useLatestReferendaPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14822,7 +14263,7 @@ export const LatestDemocracyTreasuryProposalPostsDocument = gql` * __useLatestDemocracyTreasuryProposalPostsQuery__ * * To run a query within a React component, call `useLatestDemocracyTreasuryProposalPostsQuery` and pass it any options that fit your needs. - * When your component renders, `useLatestDemocracyTreasuryProposalPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useLatestDemocracyTreasuryProposalPostsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14857,7 +14298,7 @@ export const ProposalPostAndCommentsDocument = gql` * __useProposalPostAndCommentsQuery__ * * To run a query within a React component, call `useProposalPostAndCommentsQuery` and pass it any options that fit your needs. - * When your component renders, `useProposalPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useProposalPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -14890,7 +14331,7 @@ export const ReferendumPostAndCommentsDocument = gql` * __useReferendumPostAndCommentsQuery__ * * To run a query within a React component, call `useReferendumPostAndCommentsQuery` and pass it any options that fit your needs. - * When your component renders, `useReferendumPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useReferendumPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; @@ -15326,7 +14767,7 @@ export const TreasuryProposalPostAndCommentsDocument = gql` * __useTreasuryProposalPostAndCommentsQuery__ * * To run a query within a React component, call `useTreasuryProposalPostAndCommentsQuery` and pass it any options that fit your needs. - * When your component renders, `useTreasuryProposalPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * When your component renders, `useTreasuryProposalPostAndCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; diff --git a/front-end/src/hooks/useCurrentBlock.ts b/front-end/src/hooks/useCurrentBlock.ts new file mode 100644 index 000000000..1dee09f58 --- /dev/null +++ b/front-end/src/hooks/useCurrentBlock.ts @@ -0,0 +1,32 @@ +// Copyright 2019-2020 @paritytech/polkassembly authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { ApiPromiseContext } from '@substrate/context'; +import BN from 'bn.js'; +import { useContext, useEffect,useMemo, useState } from 'react'; + +export default function () { + const [currentBlock, setCurrentBlock] = useState(undefined); + const { api, isApiReady } = useContext(ApiPromiseContext); + + useEffect(() => { + if (!isApiReady) { + return; + } + + let unsubscribe: () => void; + + api.derive.chain.bestNumber((number) => { + setCurrentBlock(number); + }) + .then(unsub => {unsubscribe = unsub;}) + .catch(e => console.error(e)); + + return () => unsubscribe && unsubscribe(); + }, [api, isApiReady]); + + return useMemo(() => { + return currentBlock; + }, [currentBlock]); +} diff --git a/front-end/src/screens/CreatePost/index.tsx b/front-end/src/screens/CreatePost/index.tsx index f1ef538a9..19f4f613f 100644 --- a/front-end/src/screens/CreatePost/index.tsx +++ b/front-end/src/screens/CreatePost/index.tsx @@ -6,12 +6,13 @@ import styled from '@xstyled/styled-components'; import React, { useContext, useState } from 'react'; import { Controller,useForm } from 'react-hook-form'; import { Checkbox, CheckboxProps, Grid } from 'semantic-ui-react'; +import useCurrentBlock from 'src/hooks/useCurrentBlock'; import ContentForm from '../../components/ContentForm'; import TitleForm from '../../components/TitleForm'; import { NotificationContext } from '../../context/NotificationContext'; import { UserDetailsContext } from '../../context/UserDetailsContext'; -import { useCreatePollMutation, useCreatePostMutation, useGetCurrentBlockNumberQuery, usePostSubscribeMutation } from '../../generated/graphql'; +import { useCreatePollMutation, useCreatePostMutation, usePostSubscribeMutation } from '../../generated/graphql'; import { useBlockTime, useRouter } from '../../hooks'; import { NotificationStatus } from '../../types'; import Button from '../../ui-components/Button'; @@ -35,7 +36,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { const { control, errors, handleSubmit } = useForm(); const { blocktime } = useBlockTime(); - const { data } = useGetCurrentBlockNumberQuery(); + const currenBlockNumber = useCurrentBlock()?.toNumber(); const [createPostMutation, { loading, error }] = useCreatePostMutation(); const [createPollMutation] = useCreatePollMutation(); const [postSubscribeMutation] = usePostSubscribeMutation(); @@ -65,9 +66,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { return; } - const blockNumber = data?.blockNumbers?.[0]?.number; - - if (!blockNumber) { + if (!currenBlockNumber) { queueNotification({ header: 'Failed to get current block number. Poll creation failed!', message: 'Failed', @@ -76,7 +75,7 @@ const CreatePost = ({ className }:Props): JSX.Element => { return; } - const blockEnd = blockNumber + Math.floor(TWO_WEEKS / blocktime); + const blockEnd = currenBlockNumber + Math.floor(TWO_WEEKS / blocktime); createPollMutation({ variables: { diff --git a/front-end/src/screens/CreatePost/query.ts b/front-end/src/screens/CreatePost/query.ts index 319d11283..0becdb1dd 100644 --- a/front-end/src/screens/CreatePost/query.ts +++ b/front-end/src/screens/CreatePost/query.ts @@ -45,11 +45,3 @@ export const GET_POST_TOPICS = gql` } ${topic_fragment} `; - -export const GET_CURRENT_BLOCK_NUMBER = gql` - query getCurrentBlockNumber { - blockNumbers(orderBy: number_DESC, first: 1) { - number - } - } -`;