# Adherence

The `adherence` object contains details about an item's [Adherence Score](https://docs.suggestic.com/graphql/start-here/core-concepts/adherence-score).

You may find this object in a [recipe](https://docs.suggestic.com/graphql/query/queries/recipes/recipe-by-id) and in a [menuitem](https://docs.suggestic.com/graphql/query/queries/restaurants/menu-item-by-id).

### List of Fields

| Field           | Type           | Note                                                                                                                           |
| --------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `score`         | Float          | Item's score. From 0 to 100.                                                                                                   |
| `color`         | adherenceColor | <p>Possible values: </p><p><code>Blue</code>, <code>Yellow</code>, <code>Red</code>, <code>Green</code>, <code>Grey</code></p> |
| `icon`          | Icon           | Possible Values: `Cross`, `Unknown`, `Alert`                                                                                   |
| `title`         | String         | General recommendation about the item                                                                                          |
| `reason`        | String         | List of matching rules that define the score                                                                                   |
| `isRecommended` | Boolean        | **False** if the item falls outside of a user's program rules or personal preferences and restrictions                         |

### Considerations

* A score of 0 can be caused by no match between a program's rules and the ingredients in the recipe or menu item. i.e. if a program has a single rule like "increase tomato" and the recipe has no tomato in it, then the item scores 0 for that program.
* Meaning of colors
  * Green: high score, recommended item
  * Yellow:  medium score, recommended item
  * Red:  low score, not recommended item
  * Grey: not enough information to calculate a score
  * Blue: may contain ingredients not allowed by the program or the user's restrictions
* Meaning of icons
  * Cross: associated with the color red. This item is not recommended.&#x20;
  * Unknown: associated with the color blue. Not enough information to calculate a score.
  * Alert: associated with the color blue. May contain ingredients not allowed by the program or the user's restrictions.

### Example

{% tabs %}
{% tab title="Query" %}

```graphql
{
  recipe(id: "UmVjaXBlOmFmMDkzMjQ0LWZkZTMtNGE3Yy1iMTA4LWUxODExNTBkNmNiZQ==") {
    name
    author
    adherenceDetails {
      score
      color
      icon
      title
      reason
      isRecommended
    }
  }
}
```

{% endtab %}

{% tab title="Results" %}

```graphql
{
  "data": {
    "recipe": {
      "name": "Tropical Storm Detox Shake",
      "author": "Dr. William Davis",
      "adherenceDetails": {
        "score": 0,
        "color": "RED",
        "icon": "CROSS",
        "title": "Outside of your program and/or restrictions.",
        "reason": "It contains: sweetener",
        "isRecommended": false
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}
