For testing, two rules-set are created by sending the requests below.
POST https://api.danube.ai/graphql
{
"query": "mutation ($id: String!, $override: Boolean, $rules: [ClientRule]!) { setRules(id: $id, override: $override, rules: $rules) }",
"variables": {
"id": "test-rules-1",
"override": true,
"rules": [
{
"property": "p1",
"type": "PERCENTAGE"
},
{
"property": "p2",
"type": "INVERSE_PERCENTAGE"
}
]
}
}
{
"query": "mutation ($id: String!, $override: Boolean, $rules: [ClientRule]!) { setRules(id: $id, override: $override, rules: $rules) }",
"variables": {
"id": "test-rules-2",
"override": true,
"rules": [
{
"property": "p3",
"type": "EQUALS",
"equalityScores": [
{
"value": "v1",
"score": 1
},
{
"value": "v2",
"score": 2
}
]
},
{
"property": "p4",
"type": "OVERLAP_GLOBAL"
}
]
}
}
{
"query": "query { getRules { id rules { property type equalityScores { value score } minRuleValue maxRuleValue clamping } } }"
}
{
"data": {
"getRules": [
{
"id": "test-rules-1",
"rules": [
{
"property": "p1",
"type": "PERCENTAGE",
"equalityScores": null,
"minRuleValue": null,
"maxRuleValue": null,
"clamping": null
},
{
"property": "p2",
"type": "INVERSE_PERCENTAGE",
"equalityScores": null,
"minRuleValue": null,
"maxRuleValue": null,
"clamping": null
}
]
},
{
"id": "test-rules-2",
"rules": [
{
"property": "p3",
"type": "EQUALS",
"equalityScores": [
{
"value": "v1",
"score": 1
},
{
"value": "v2",
"score": 2
}
],
"minRuleValue": null,
"maxRuleValue": null,
"clamping": null
},
{
"property": "p4",
"type": "OVERLAP_GLOBAL",
"equalityScores": null,
"minRuleValue": null,
"maxRuleValue": null,
"clamping": null
}
]
}
]
}
}