I have a type that stores an amount field and an interval field:
type Commitment {
id: ID
amount: Float!
intervals: Float!
}
We use this to track commitments as commitments can be weekly, bi-monthly, monthly, quarterly, yearly. The intervals is a set ratio against a year. This allows for commitments to span over several years as well.
What I want to do is to filter commitments to all that average at least $100/mo.
Hoping I could do something like:
node(func: (gt(math(Commitment.amount * Commitment.intervals / 12), 100))) {
uid
}
But, it appears that I cannot do this kind of math in a function like gt.
I get the error:
Expected comma or language but got: 1