I am trying to figure out how to query "less than"/"greater than" using GraphQL towards strapi backend (using React/Apollo). Basically I would like the amount of bonus to be "not smaller" than $min_bonus, and "not greater" then $max_bonus...
What would be a good solution to this?
My Query:
import { gql } from "@apollo/client";
const BONUSES_QUERY = gql`
query bonuses($min_bonus, $max_bonus, $welcome_bonus: Boolean, $deposit_bonus: Boolean, $monthly_bonus: Boolean, $weekly_bonus: Boolean, $slots_bonus: Boolean, $nodeposit_bonus: Boolean ) {
welcome_bonuses: bonuses(where:
{
welcome_bonus: $welcome_bonus
})
{
...BonusParts
}
deposit_bonuses: bonuses(where: { deposit_bonus: $deposit_bonus })
{
...BonusParts
}
monthly_bonuses: bonuses(where: { monthly_bonus: $monthly_bonus })
{
...BonusParts
}
weekly_bonuses: bonuses(where: { weekly_bonus: $weekly_bonus })
{
...BonusParts
}
slots_bonuses: bonuses(where: { slots_bonus: $slots_bonus })
{
...BonusParts
}
nodeposit_bonuses: bonuses(where: { nodeposit_bonus: $nodeposit_bonus })
{
...BonusParts
}
}
fragment BonusParts on Bonuses {
name
casino {
name
aff_link
logo {
url
}
}
slug
title
amount
code
min_deposit
value
wager
cashable
bonus_type {
name
}
}
`;
export default BONUSES_QUERY;