Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Subgraph Events Sorting #2972

Merged
merged 20 commits into from
Dec 1, 2021
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e095b0d
Fix: `ColonyActions`/`ColonyEvents` don't limit at 100
rdig Nov 26, 2021
6c74b97
Update: `subgrahp` to the lastest working changes
rdig Nov 26, 2021
dcf447e
Refactor: subscription queries to support sorting natively
rdig Nov 29, 2021
45d6130
Refactor: `ColonyEvents` handle true pagination
rdig Nov 29, 2021
177f737
Refactor: all subgraph events subscription to support sort
rdig Nov 29, 2021
dcbbd75
Refactor: `ColonyActions` use the new subscriptions args
rdig Nov 29, 2021
8180afd
Chore: separate `recovery` queries into own file
rdig Nov 29, 2021
ed188b9
Chore: separate `motions` queries into own file
rdig Nov 29, 2021
9eb1643
Chore: add subgraph events queries ability to sort natively
rdig Nov 29, 2021
9b09ff3
Refactor: `coinMachine` resolvers remove client sorting
rdig Nov 29, 2021
c96148b
Refactor: `roles` resolvers remove client sorting
rdig Nov 29, 2021
38f7edf
Refactor: `extensions` resolvers remove client sorting
rdig Nov 29, 2021
8db6de0
Refactor: `motions` resolvers remove client sorting
rdig Nov 29, 2021
598d638
Refactor: `recovery` resolvers remove client sorting
rdig Nov 29, 2021
80a5085
Refactor: `whitelist` resolvers remove client sorting
rdig Nov 29, 2021
20d6050
Refactor: `getAnnotationFromSubgraph` remove client sorting
rdig Nov 29, 2021
d5ce046
Remove: unused `sortSubgraphEventByIndex` util
rdig Nov 29, 2021
f073c2e
Fix: `coinMachineSalePeriods` resolver events ordering
rdig Nov 29, 2021
8a5826e
Chore: regenerate graphql hooks after rebase
rdig Nov 29, 2021
41db368
Fix: `ColonyActions` wrong prop passed to query
rdig Nov 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor: getAnnotationFromSubgraph remove client sorting
  • Loading branch information
rdig committed Dec 1, 2021
commit 20d60505d6bd8d111aec8cd0fb7997107232331e
8 changes: 3 additions & 5 deletions src/utils/events/getAnnotationFromSubgraph.ts
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@ import {
SubgraphAnnotationEventsQueryVariables,
SubgraphAnnotationEventsDocument,
} from '~data/index';
import { Address, SortDirection } from '~types/index';
import { Address } from '~types/index';

import { parseSubgraphEvent, sortSubgraphEventByIndex } from './subgraphEvents';
import { parseSubgraphEvent } from './subgraphEvents';

export const getAnnotationFromSubgraph = async (
userAddress: Address,
@@ -21,6 +21,7 @@ export const getAnnotationFromSubgraph = async (
query: SubgraphAnnotationEventsDocument,
variables: {
transactionHash,
sortDirection: 'desc',
},
});

@@ -36,9 +37,6 @@ export const getAnnotationFromSubgraph = async (
.filter(
({ values: { agent, address } }) =>
agent === userAddress || address === userAddress,
)
.sort((firstEvent, secondEvent) =>
sortSubgraphEventByIndex(firstEvent, secondEvent, SortDirection.DESC),
) || [];

return mostRecentAnnotation;