fix(governance): paginate rewards as well as delegations data (#3288)
This commit is contained in:
parent
8863209342
commit
5c17045752
@ -21,6 +21,12 @@ export const EpochIndividualRewards = () => {
|
||||
first: Number(delegationsPagination),
|
||||
}
|
||||
: undefined,
|
||||
// we can use the same value for rewardsPagination as delegationsPagination
|
||||
rewardsPagination: delegationsPagination
|
||||
? {
|
||||
first: Number(delegationsPagination),
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
skip: !pubKey,
|
||||
});
|
||||
|
@ -21,10 +21,14 @@ fragment DelegationFields on Delegation {
|
||||
epoch
|
||||
}
|
||||
|
||||
query Rewards($partyId: ID!, $delegationsPagination: Pagination) {
|
||||
query Rewards(
|
||||
$partyId: ID!
|
||||
$delegationsPagination: Pagination
|
||||
$rewardsPagination: Pagination
|
||||
) {
|
||||
party(id: $partyId) {
|
||||
id
|
||||
rewardsConnection {
|
||||
rewardsConnection(pagination: $rewardsPagination) {
|
||||
edges {
|
||||
node {
|
||||
...RewardFields
|
||||
|
@ -10,6 +10,7 @@ export type DelegationFieldsFragment = { __typename?: 'Delegation', amount: stri
|
||||
export type RewardsQueryVariables = Types.Exact<{
|
||||
partyId: Types.Scalars['ID'];
|
||||
delegationsPagination?: Types.InputMaybe<Types.Pagination>;
|
||||
rewardsPagination?: Types.InputMaybe<Types.Pagination>;
|
||||
}>;
|
||||
|
||||
|
||||
@ -75,10 +76,10 @@ export const EpochFieldsFragmentDoc = gql`
|
||||
}
|
||||
`;
|
||||
export const RewardsDocument = gql`
|
||||
query Rewards($partyId: ID!, $delegationsPagination: Pagination) {
|
||||
query Rewards($partyId: ID!, $delegationsPagination: Pagination, $rewardsPagination: Pagination) {
|
||||
party(id: $partyId) {
|
||||
id
|
||||
rewardsConnection {
|
||||
rewardsConnection(pagination: $rewardsPagination) {
|
||||
edges {
|
||||
node {
|
||||
...RewardFields
|
||||
@ -119,6 +120,7 @@ ${DelegationFieldsFragmentDoc}`;
|
||||
* variables: {
|
||||
* partyId: // value for 'partyId'
|
||||
* delegationsPagination: // value for 'delegationsPagination'
|
||||
* rewardsPagination: // value for 'rewardsPagination'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user