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

ContributionFlow: Information requirement resolvers #10661

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Conversation

kewitz
Copy link
Contributor

@kewitz kewitz commented Jan 23, 2025

Adds CONTRIBUTOR_INFO_THRESHOLDS policy and ContributorProfile.totalContributedToHost resolver.

server/graphql/v2/object/ContributorProfile.ts Outdated Show resolved Hide resolved
server/graphql/v2/object/ContributorProfile.ts Outdated Show resolved Hide resolved
server/graphql/v2/object/ContributorProfile.ts Outdated Show resolved Hide resolved
server/graphql/v2/object/Policies.ts Show resolved Hide resolved
Comment on lines +24 to +35
totalContributedToHost: {
buildLoader: ({
since,
hostId,
}: {
hostId: number;
since: Date | string;
}): DataLoader<
number,
{ CollectiveId: number; amount: number; currency: SupportedCurrency; HostCollectiveId: number }
> => {
const key = compact([hostId, since]).join('-');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the benefit of using buildLoader rather than just a regular loader here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I'm tripping, but isn't this required for sharing the since and hostId parameters across multiple DataLoader calls.

@kewitz kewitz merged commit 194dda0 into main Feb 7, 2025
20 checks passed
@kewitz kewitz deleted the refact/policies branch February 7, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants