Filter by Individual / Groups and gender

22 views
Skip to first unread message

Sam T

unread,
Jan 29, 2020, 10:35:19 PM1/29/20
to build-kiva
Hi Kiva,

Within my app users use were able to filter by gender and borrower_type (individual or group).  

For gender, I can use the filters to filter on gender using the GenderEnum.
For Borrower Type, borrower type is no longer available?  So, I can use the borrowerCount variable but how do I filter?  Can I use the queryString?

If I wanted to get female groups from Kenya, what do I put for the queryString, ie queryString: "borrowerCount>0"  ?  or is there another way to do this query?

{
lend {
        loans(filters: {status: fundraising, country: "KE", gender: female}, queryString???, sortBy: newest, limit:10, offset:0) {
            values {
                id
                name
                status
                loanFundraisingInfo {
                    fundedAmount
                }
                image {
                    id
                }
                activity {
                    name
                }
                sector {
                    name
                }
                use
                geocode {
                    city
                    country {
                        name
                        isoCode
                    }
                }
                loanAmount
                ... on LoanPartner {
                    partnerId
                }
                description
                gender
                borrowerCount
                lenderRepaymentTerm
                repaymentInterval
                disbursalDate
                fundraisingDate
                delinquent
                plannedExpirationDate
            }
        }
    }
}

mfab

unread,
Jan 30, 2020, 2:19:05 PM1/30/20
to build-kiva
Hi Sam, 

Thanks for your question. I think the isGroup filter would work for the issue you're describing. 
You can try 

loans(filters: {status: fundraising, country: "KE", gender: female, isGroup: true})

And I think that would get you the information you're interested in. 

Good luck!

Sam T

unread,
Jan 30, 2020, 5:52:56 PM1/30/20
to build-kiva
Thankyou! I totally missed it, that is perfect :)
Reply all
Reply to author
Forward
0 new messages