setRules - Examples

In the following, an example request and the according response using the setRules endpoint are shown.

POST https://api.danube.ai/graphql

body: {
  "query": "mutation ($id: String!, $override: Boolean, $rules: [ClientRule]!) { setRules(id: $id, override: $override, rules: $rules) }",
  "variables": {
    "id": "my-rules-set-1",
    "override": true,
    "rules": [
      {
        "property": "salaryFrom",
        "type": "PERCENTAGE"
      },
      {
        "property": "salaryTo",
        "type": "PERCENTAGE"
      },
      {
        "property": "daysAgo",
        "type": "INVERSE_PERCENTAGE"
      },
      {
      "property": "companyType",
      "type": "EQUALS",
      "equalityScores": [
          {
            "value": "Startup",
            "score": 1
          },
          {
            "value": "Digital agency",
            "score": 2
          },
          {
            "value": "Established company",
            "score": 3
          }
        ]
      },
      {
        "property": "jobLevel",
        "type": "EQUALS",
        "equalityScores": [
          {
            "value": "Junior",
            "score": 1
          },
          {
            "value": "Experienced",
            "score": 2
          },
          {
            "value": "Senior",
            "score": 3
          },
          {
            "value": "Lead",
            "score": 4
          }
        ]
      },
      {
        "property": "technologies",
        "type": "OVERLAP_GLOBAL"
      },
      {
        "property": "benefits",
        "type": "OVERLAP_LOCAL"
      }
    ]
  }
}

Returns

{
  "data": {
    "setRules": true
  }
}