# Common Foods Search

The `commonFoods` query allows users to search for any type of common food. Within the search, food can be filtered by using [tags](https://docs.suggestic.com/graphql/objects/food-logs/food-filter#available-fields).&#x20;

**Common foods** are known as the most intake foods on a daily basis. Among these common foods, we can find apples, cookies, milk, rice, sugar, noodles, etc.

### Characteristics

Within the common food search you are able to:

* Get the [nutritional information](#undefined) for a specific food&#x20;
* Use [pagination](https://docs.suggestic.com/graphql/query/search/food-search-for-food-log/common-foods-search#use-pagination-to-get-the-first-results-of-foods-that-contain-bread)
* Filter the information to retrieve the following results
  * [Tags](https://docs.suggestic.com/graphql/query/search/food-search-for-food-log/common-foods-search#filter-all-the-common-foods-that-include-the-fat-free-tag)
  * [Nutrients](https://docs.suggestic.com/graphql/query/search/food-search-for-food-log/common-foods-search#get-all-the-common-foods-that-contain-vitamin-a-and-folic-acid)
  * Name
  * Barcode
  * Meal time
  * Ingredients

### How to calculate the nutrient according to a food portion

Common food nutrients are per each `100g.` The value can be different depending on the portion of each food. For example, the weight of a small banana can be `20g,` while a big banana can weigh 30g. To calculate the nutrients, use the following equation:

$$
nutrient value \*weight/100
$$

Where:

* `weight` is equivalent the `gramWeight`field included within the [`portions` ](https://docs.suggestic.com/graphql/objects/food-logs/portions)object

### Available Arguments

{% hint style="info" %}
Define at least one argument within the query.
{% endhint %}

| **Argument Name** | **Type**                                                                       | **Description**                                                                                                                                                                                                                     |
| ----------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `query`           | Query                                                                          | Name or keyword of the food. It is possible to add more than one value. The query is *case insensitive.*                                                                                                                            |
| `filter`          | [FoodFilter](https://docs.suggestic.com/graphql/objects/food-logs/food-filter) | <p>Object that filters food according to different criteria. Use this object to filter:</p><ul><li>Id</li><li>externalId</li><li>Barcode</li><li>Name</li><li>Tags</li><li>Nutrients</li><li>mealTime</li><li>Ingredients</li></ul> |
| `after`           | String                                                                         | See [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination)                                                                                                                               |
| `before`          | String                                                                         | See [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination)                                                                                                                               |
| `first`           | String                                                                         | Retrieves the first results from the list.                                                                                                                                                                                          |
| `last`            | String                                                                         | See [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination)                                                                                                                               |

### Available Fields

| **Field Name** | **Type**                                                                    | **Description**                                                                                                                                                                                                              |
| -------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`           | ID                                                                          | Id of the food                                                                                                                                                                                                               |
| `description`  | String                                                                      | Description of the food                                                                                                                                                                                                      |
| `foodDataId`   | String                                                                      | Food Id to use in the `addFoodLog` mutation                                                                                                                                                                                  |
| `name`         | String                                                                      | Name of the food                                                                                                                                                                                                             |
| `nutrients`    | [nutrients](https://docs.suggestic.com/graphql/objects/food-logs/nutrients) | Object that retrieves the information of the nutrients of the food. For more information on how to use nutrients, see [this example](https://docs.suggestic.com/graphql/objects/food-logs/food-filter#how-to-use-nutrients). |
| `portions`     | [portions](https://docs.suggestic.com/graphql/objects/food-logs/portions)   | Object that retrieves the information of the food portions                                                                                                                                                                   |
| `tags`         | String                                                                      | Displays the available [tags ](https://docs.suggestic.com/graphql/objects/food-logs/food-filter#how-to-use-tags)                                                                                                             |

### Pagination

The `commonFood` query supports the use of [pagination](https://docs.suggestic.com/graphql/start-here/tutorials-and-walkthroughs/pagination). The following fields can be used

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

```graphql
 pageInfo{
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
```

{% endtab %}
{% endtabs %}

## Example

### Get the nutritional information of a specific food

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

```graphql
{
  commonFoods(
    filter: {
      id: "Q29tbW9uRm9vZE5vZGU6N2QyYTY0NDUtN2MwZi00ZTYxLTlkNjctYTA4ZWI2NDhlNTY3"
    }
  ) {
    edges {
      node {
        id
        name
        description
        nutrients {
          type
          amount
          name
          unit
        }
        portions {
          amount
          gramWeight
          modifier
        }
      }
    }
  }
}

```

{% endtab %}

{% tab title="Result" %}

```graphql
{
  "data": {
    "commonFoods": {
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6N2QyYTY0NDUtN2MwZi00ZTYxLTlkNjctYTA4ZWI2NDhlNTY3",
            "name": "Milk crackers",
            "description": "Crackers, milk",
            "nutrients": [
              {
                "type": "VITAMIN_A_IU",
                "amount": 58,
                "name": "Vitamin A, IU",
                "unit": "IU"
              },
              {
                "type": "VITAMIN_K_PHYLLOQUINONE",
                "amount": 3.8,
                "name": "Vitamin K (phylloquinone)",
                "unit": "UG"
              },
              {
                "type": "CHOLINE_TOTAL",
                "amount": 10.8,
                "name": "Choline, total",
                "unit": "MG"
              },
              {
                "type": "FOLIC_ACID",
                "amount": 70,
                "name": "Folic acid",
                "unit": "UG"
              },
              {
                "type": "FOLATE_DFE",
                "amount": 139,
                "name": "Folate, DFE",
                "unit": "UG"
              },
              {
                "type": "FOLATE_FOOD",
                "amount": 20,
                "name": "Folate, food",
                "unit": "UG"
              },
              {
                "type": "SODIUM_NA",
                "amount": 687,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "type": "TRYPTOPHAN",
                "amount": 0.1,
                "name": "Tryptophan",
                "unit": "G"
              },
              {
                "type": "THREONINE",
                "amount": 0.221,
                "name": "Threonine",
                "unit": "G"
              },
              {
                "type": "METHIONINE",
                "amount": 0.138,
                "name": "Methionine",
                "unit": "G"
              },
              {
                "type": "PHENYLALANINE",
                "amount": 0.376,
                "name": "Phenylalanine",
                "unit": "G"
              },
              {
                "type": "TYROSINE",
                "amount": 0.237,
                "name": "Tyrosine",
                "unit": "G"
              },
              {
                "type": "ALANINE",
                "amount": 0.246,
                "name": "Alanine",
                "unit": "G"
              },
              {
                "type": "GLUTAMIC_ACID",
                "amount": 2.482,
                "name": "Glutamic acid",
                "unit": "G"
              },
              {
                "type": "GLYCINE",
                "amount": 0.264,
                "name": "Glycine",
                "unit": "G"
              },
              {
                "type": "PROLINE",
                "amount": 0.858,
                "name": "Proline",
                "unit": "G"
              },
              {
                "type": "THIAMIN",
                "amount": 0.538,
                "name": "Thiamin",
                "unit": "MG"
              },
              {
                "type": "RIBOFLAVIN",
                "amount": 0.418,
                "name": "Riboflavin",
                "unit": "MG"
              },
              {
                "type": "DHA",
                "amount": 0.001,
                "name": "22:6 n-3 (DHA)",
                "unit": "G"
              },
              {
                "type": "PROTEIN",
                "amount": 7.6,
                "name": "Protein",
                "unit": "G"
              },
              {
                "type": "ASH",
                "amount": 2.2,
                "name": "Ash",
                "unit": "G"
              },
              {
                "type": "COPPER_CU",
                "amount": 0.227,
                "name": "Copper, Cu",
                "unit": "MG"
              },
              {
                "type": "MANGANESE_MN",
                "amount": 0.552,
                "name": "Manganese, Mn",
                "unit": "MG"
              },
              {
                "type": "IRON_FE",
                "amount": 3.58,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "type": "MAGNESIUM",
                "amount": 22,
                "name": "Magnesium, Mg",
                "unit": "MG"
              },
              {
                "type": "PHOSPHORUS_P",
                "amount": 303,
                "name": "Phosphorus, P",
                "unit": "MG"
              },
              {
                "type": "WATER",
                "amount": 4.7,
                "name": "Water",
                "unit": "G"
              },
              {
                "type": "CALCIUM_CA",
                "amount": 172,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "type": "POTASSIUM_K",
                "amount": 114,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "type": "ZINC_ZN",
                "amount": 0.67,
                "name": "Zinc, Zn",
                "unit": "MG"
              },
              {
                "type": "ISOLEUCINE",
                "amount": 0.289,
                "name": "Isoleucine",
                "unit": "G"
              },
              {
                "type": "LEUCINE",
                "amount": 0.541,
                "name": "Leucine",
                "unit": "G"
              },
              {
                "type": "LYSINE",
                "amount": 0.241,
                "name": "Lysine",
                "unit": "G"
              },
              {
                "type": "CYSTINE",
                "amount": 0.159,
                "name": "Cystine",
                "unit": "G"
              },
              {
                "type": "VALINE",
                "amount": 0.333,
                "name": "Valine",
                "unit": "G"
              },
              {
                "type": "ARGININE",
                "amount": 0.307,
                "name": "Arginine",
                "unit": "G"
              },
              {
                "type": "HISTIDINE",
                "amount": 0.167,
                "name": "Histidine",
                "unit": "G"
              },
              {
                "type": "ASPARTIC_ACID",
                "amount": 0.345,
                "name": "Aspartic acid",
                "unit": "G"
              },
              {
                "type": "SERINE",
                "amount": 0.399,
                "name": "Serine",
                "unit": "G"
              },
              {
                "type": "NIACIN",
                "amount": 4.43,
                "name": "Niacin",
                "unit": "MG"
              },
              {
                "type": "FIBER_TOTAL_DIETARY",
                "amount": 3.4,
                "name": "Fiber, total dietary",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_SATURATED",
                "amount": 2.912,
                "name": "Fatty acids, total saturated",
                "unit": "G"
              },
              {
                "type": "FAT",
                "amount": 13.77,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "type": "CARBS",
                "amount": 71.73,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "type": "ENERGY",
                "amount": 446,
                "name": "Energy",
                "unit": "KCAL"
              },
              {
                "type": "SUGARS_TOTAL_INCLUDING_NLEA",
                "amount": 10.32,
                "name": "Sugars, total including NLEA",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_MONOUNSATURATED",
                "amount": 5.485,
                "name": "Fatty acids, total monounsaturated",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_POLYUNSATURATED",
                "amount": 4.867,
                "name": "Fatty acids, total polyunsaturated",
                "unit": "G"
              },
              {
                "type": "VITAMIN_B_12_ADDED",
                "amount": 0,
                "name": "Vitamin B-12, added",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_E_ADDED",
                "amount": 0,
                "name": "Vitamin E, added",
                "unit": "MG"
              },
              {
                "type": "CHOLESTEROL",
                "amount": 11,
                "name": "Cholesterol",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_C_TOTAL_ASCORBIC_ACID",
                "amount": 0.2,
                "name": "Vitamin C, total ascorbic acid",
                "unit": "MG"
              },
              {
                "type": "EPA",
                "amount": 0.001,
                "name": "20:5 n-3 (EPA)",
                "unit": "G"
              },
              {
                "type": "VITAMIN_B_12",
                "amount": 0.08,
                "name": "Vitamin B-12",
                "unit": "UG"
              },
              {
                "type": "PANTOTHENIC_ACID",
                "amount": 0.407,
                "name": "Pantothenic acid",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_B_6",
                "amount": 0.037,
                "name": "Vitamin B-6",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_D_D2_D3",
                "amount": 0,
                "name": "Vitamin D (D2 + D3)",
                "unit": "UG"
              },
              {
                "type": "SELENIUM_SE",
                "amount": 15.9,
                "name": "Selenium, Se",
                "unit": "UG"
              }
            ],
            "portions": [
              {
                "amount": 1,
                "gramWeight": 11,
                "modifier": "cracker",
                "unit": "undetermined"
              },
              {
                "amount": 0.5,
                "gramWeight": 14.2,
                "modifier": "oz",
                "unit": "undetermined"
              }
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Get the list of foods that contain "milk chocolate"

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

```graphql
{
  commonFoods(query: "milk chocolate", first: 1) {
    edges {
      node {
        id
        name
        portions {
          modifier
          amount
          gramWeight
        }
        nutrients {
          type
          amount
          name
          unit
        }
      }
    }
  }
}

```

{% endtab %}

{% tab title="Result" %}

```graphql
{
  "data": {
    "commonFoods": {
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MWFkZjRlMmYtYjQxZi00YmNmLTg2M2MtNjcwYTAyYzMxY2Zi",
            "name": "Milk chocolate candies",
            "portions": [
              {
                "modifier": "cup chips",
                "amount": 1,
                "gramWeight": 168
              },
              {
                "modifier": "bar (1.55 oz)",
                "amount": 1,
                "gramWeight": 44
              },
              {
                "modifier": "bar, miniature",
                "amount": 1,
                "gramWeight": 7
              }
            ],
            "nutrients": [
              {
                "type": "FATTY_ACIDS_TOTAL_SATURATED",
                "amount": 18.509,
                "name": "Fatty acids, total saturated",
                "unit": "G"
              },
              {
                "type": "DHA",
                "amount": 0,
                "name": "22:6 n-3 (DHA)",
                "unit": "G"
              },
              {
                "type": "EPA",
                "amount": 0,
                "name": "20:5 n-3 (EPA)",
                "unit": "G"
              },
              {
                "type": "DPA",
                "amount": 0,
                "name": "22:5 n-3 (DPA)",
                "unit": "G"
              },
              {
                "type": "WATER",
                "amount": 1.5,
                "name": "Water",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_MONOUNSATURATED",
                "amount": 7.186,
                "name": "Fatty acids, total monounsaturated",
                "unit": "G"
              },
              {
                "type": "FATTY_ACIDS_TOTAL_POLYUNSATURATED",
                "amount": 1.376,
                "name": "Fatty acids, total polyunsaturated",
                "unit": "G"
              },
              {
                "type": "STIGMASTEROL",
                "amount": 16,
                "name": "Stigmasterol",
                "unit": "MG"
              },
              {
                "type": "BETA_SITOSTEROL",
                "amount": 37,
                "name": "Beta-sitosterol",
                "unit": "MG"
              },
              {
                "type": "CAFFEINE",
                "amount": 20,
                "name": "Caffeine",
                "unit": "MG"
              },
              {
                "type": "THEOBROMINE",
                "amount": 205,
                "name": "Theobromine",
                "unit": "MG"
              },
              {
                "type": "FAT",
                "amount": 29.66,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "type": "CALCIUM_CA",
                "amount": 189,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "type": "POTASSIUM_K",
                "amount": 372,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "type": "SELENIUM_SE",
                "amount": 4.5,
                "name": "Selenium, Se",
                "unit": "UG"
              },
              {
                "type": "NIACIN",
                "amount": 0.386,
                "name": "Niacin",
                "unit": "MG"
              },
              {
                "type": "PANTOTHENIC_ACID",
                "amount": 0.472,
                "name": "Pantothenic acid",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_B_6",
                "amount": 0.036,
                "name": "Vitamin B-6",
                "unit": "MG"
              },
              {
                "type": "CAMPESTEROL",
                "amount": 6,
                "name": "Campesterol",
                "unit": "MG"
              },
              {
                "type": "FIBER_TOTAL_DIETARY",
                "amount": 3.4,
                "name": "Fiber, total dietary",
                "unit": "G"
              },
              {
                "type": "IRON_FE",
                "amount": 2.35,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "type": "MAGNESIUM",
                "amount": 63,
                "name": "Magnesium, Mg",
                "unit": "MG"
              },
              {
                "type": "PHOSPHORUS_P",
                "amount": 208,
                "name": "Phosphorus, P",
                "unit": "MG"
              },
              {
                "type": "SODIUM_NA",
                "amount": 79,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "type": "COPPER_CU",
                "amount": 0.491,
                "name": "Copper, Cu",
                "unit": "MG"
              },
              {
                "type": "MANGANESE_MN",
                "amount": 0.471,
                "name": "Manganese, Mn",
                "unit": "MG"
              },
              {
                "type": "PROTEIN",
                "amount": 7.65,
                "name": "Protein",
                "unit": "G"
              },
              {
                "type": "ASH",
                "amount": 1.78,
                "name": "Ash",
                "unit": "G"
              },
              {
                "type": "CRYPTOXANTHIN_BETA",
                "amount": 0,
                "name": "Cryptoxanthin, beta",
                "unit": "UG"
              },
              {
                "type": "LYCOPENE",
                "amount": 0,
                "name": "Lycopene",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_C_TOTAL_ASCORBIC_ACID",
                "amount": 0,
                "name": "Vitamin C, total ascorbic acid",
                "unit": "MG"
              },
              {
                "type": "THIAMIN",
                "amount": 0.112,
                "name": "Thiamin",
                "unit": "MG"
              },
              {
                "type": "RIBOFLAVIN",
                "amount": 0.298,
                "name": "Riboflavin",
                "unit": "MG"
              },
              {
                "type": "FOLATE_TOTAL",
                "amount": 12,
                "name": "Folate, total",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_K_DIHYDROPHYLLOQUINONE",
                "amount": 0,
                "name": "Vitamin K (Dihydrophylloquinone)",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_K_PHYLLOQUINONE",
                "amount": 5.7,
                "name": "Vitamin K (phylloquinone)",
                "unit": "UG"
              },
              {
                "type": "CAROTENE_BETA",
                "amount": 0,
                "name": "Carotene, beta",
                "unit": "UG"
              },
              {
                "type": "CAROTENE_ALPHA",
                "amount": 0,
                "name": "Carotene, alpha",
                "unit": "UG"
              },
              {
                "type": "CHOLESTEROL",
                "amount": 23,
                "name": "Cholesterol",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_D_D2_D3_INTERNATIONAL_UNITS",
                "amount": 0,
                "name": "Vitamin D (D2 + D3), International Units",
                "unit": "IU"
              },
              {
                "type": "FLUORIDE_F",
                "amount": 5,
                "name": "Fluoride, F",
                "unit": "UG"
              },
              {
                "type": "SUGARS_TOTAL_INCLUDING_NLEA",
                "amount": 51.5,
                "name": "Sugars, total including NLEA",
                "unit": "G"
              },
              {
                "type": "FOLATE_DFE",
                "amount": 11,
                "name": "Folate, DFE",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_A_IU",
                "amount": 195,
                "name": "Vitamin A, IU",
                "unit": "IU"
              },
              {
                "type": "VITAMIN_A_RAE",
                "amount": 59,
                "name": "Vitamin A, RAE",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_D_D2_D3",
                "amount": 0,
                "name": "Vitamin D (D2 + D3)",
                "unit": "UG"
              },
              {
                "type": "BETAINE",
                "amount": 2.6,
                "name": "Betaine",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_E_ADDED",
                "amount": 0,
                "name": "Vitamin E, added",
                "unit": "MG"
              },
              {
                "type": "VITAMIN_E_ALPHA_TOCOPHEROL",
                "amount": 0.51,
                "name": "Vitamin E (alpha-tocopherol)",
                "unit": "MG"
              },
              {
                "type": "ZINC_ZN",
                "amount": 2.3,
                "name": "Zinc, Zn",
                "unit": "MG"
              },
              {
                "type": "CARBS",
                "amount": 59.4,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "type": "ENERGY",
                "amount": 535,
                "name": "Energy",
                "unit": "KCAL"
              },
              {
                "type": "LUTEIN_ZEAXANTHIN",
                "amount": 6,
                "name": "Lutein + zeaxanthin",
                "unit": "UG"
              },
              {
                "type": "TOCOPHEROL_BETA",
                "amount": 0,
                "name": "Tocopherol, beta",
                "unit": "MG"
              },
              {
                "type": "TOCOPHEROL_GAMMA",
                "amount": 0.92,
                "name": "Tocopherol, gamma",
                "unit": "MG"
              },
              {
                "type": "CHOLINE_TOTAL",
                "amount": 46.1,
                "name": "Choline, total",
                "unit": "MG"
              },
              {
                "type": "FOLIC_ACID",
                "amount": 0,
                "name": "Folic acid",
                "unit": "UG"
              },
              {
                "type": "FOLATE_FOOD",
                "amount": 11,
                "name": "Folate, food",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_B_12_ADDED",
                "amount": 0,
                "name": "Vitamin B-12, added",
                "unit": "UG"
              },
              {
                "type": "VITAMIN_B_12",
                "amount": 0.75,
                "name": "Vitamin B-12",
                "unit": "UG"
              },
              {
                "type": "ALCOHOL_ETHYL",
                "amount": 0,
                "name": "Alcohol, ethyl",
                "unit": "G"
              },
              {
                "type": "RETINOL",
                "amount": 59,
                "name": "Retinol",
                "unit": "UG"
              }
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

#### UI/UX example

In the same way, we have code examples, this is an implementation example in which see results of the API execution in the Suggestic App.&#x20;

Login to the App, tap on the **Food Log +** option, choose the Candies, Milk chocolate recipe (the same recipe retrieved in the above example) and the **nutrition information** is displayed along with the different available **portions** for the given recipe:

![](https://920729701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LwqSnBDpAb6mFZYLsuB%2Fuploads%2F5w1YGtyXtWfPX9BiefA5%2Fiphone_mockup.gif?alt=media\&token=04c960d5-d045-40ae-870a-0e99a9b012c7)

### Use pagination to get the first results of foods that contain bread

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

```graphql
{
  commonFoods(query: "bread", first: 2) {
    edges {
      node {
        id
        name
        description
        portions {
          amount
          modifier
          gramWeight
        }
        nutrients {
          id
          amount
          name
          unit
        }
      }
       }
     pageInfo{
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    }
    
  }
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "brandedFoods": {
      "edges": [
        {
          "node": {
            "id": "QnJhbmRlZEZvb2ROb2RlOjM1MDcyNw==",
            "name": "Nabisco oreo cookies oreo 1x10.700 oz",
            "gtinUpc": "00044000042554",
            "brandOwner": "Mondelez Int. US (0074819091009)",
            "servingSize": 29,
            "servingSizeUnit": "g",
            "nutrients": [
              {
                "id": 1162,
                "amount": 0,
                "name": "Vitamin C, total ascorbic acid",
                "unit": "MG"
              },
              {
                "id": 1004,
                "amount": 20.69,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "id": 1005,
                "amount": 72.41,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "id": 2000,
                "amount": 44.83,
                "name": "Sugars, total including NLEA",
                "unit": "G"
              },
              {
                "id": 1087,
                "amount": 40,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "id": 1089,
                "amount": 3.48,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "id": 1092,
                "amount": 138,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "id": 1093,
                "amount": 345,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "id": 1253,
                "amount": 0,
                "name": "Cholesterol",
                "unit": "MG"
              },
              {
                "id": 1257,
                "amount": 0,
                "name": "Fatty acids, total trans",
                "unit": "G"
              },
              {
                "id": 1258,
                "amount": 6.9,
                "name": "Fatty acids, total saturated",
                "unit": "G"
              },
              {
                "id": 1003,
                "amount": 3.45,
                "name": "Protein",
                "unit": "G"
              },
              {
                "id": 1079,
                "amount": 3.4,
                "name": "Fiber, total dietary",
                "unit": "G"
              }
            ]
          }
        },
        {
          "node": {
            "id": "QnJhbmRlZEZvb2ROb2RlOjM1MTUwOA==",
            "name": "Nabisco oreo cookies oreo 1x45.000 oz",
            "gtinUpc": "00044000013103",
            "brandOwner": "Mondelez Int. US (0074819091009)",
            "servingSize": 42,
            "servingSizeUnit": "g",
            "nutrients": [
              {
                "id": 1162,
                "amount": 0,
                "name": "Vitamin C, total ascorbic acid",
                "unit": "MG"
              },
              {
                "id": 1003,
                "amount": 4.76,
                "name": "Protein",
                "unit": "G"
              },
              {
                "id": 1004,
                "amount": 19.05,
                "name": "Total lipid (fat)",
                "unit": "G"
              },
              {
                "id": 1005,
                "amount": 71.43,
                "name": "Carbohydrate, by difference",
                "unit": "G"
              },
              {
                "id": 2000,
                "amount": 40.48,
                "name": "Sugars, total including NLEA",
                "unit": "G"
              },
              {
                "id": 1087,
                "amount": 44,
                "name": "Calcium, Ca",
                "unit": "MG"
              },
              {
                "id": 1089,
                "amount": 5.19,
                "name": "Iron, Fe",
                "unit": "MG"
              },
              {
                "id": 1092,
                "amount": 155,
                "name": "Potassium, K",
                "unit": "MG"
              },
              {
                "id": 1093,
                "amount": 405,
                "name": "Sodium, Na",
                "unit": "MG"
              },
              {
                "id": 1253,
                "amount": 0,
                "name": "Cholesterol",
                "unit": "MG"
              },
              {
                "id": 1257,
                "amount": 0,
                "name": "Fatty acids, total trans",
                "unit": "G"
              },
              {
                "id": 1258,
                "amount": 4.76,
                "name": "Fatty acids, total saturated",
                "unit": "G"
              },
              {
                "id": 1079,
                "amount": 2.4,
                "name": "Fiber, total dietary",
                "unit": "G"
              }
            ]
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": false,
        "startCursor": "YXJyYXljb25uZWN0aW9uOjE=",
        "endCursor": "YXJyYXljb25uZWN0aW9uOjI="
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Filter all the common foods that include the "fat-free" tag

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

```graphql
{
  commonFoods(
  filter: {
      tags: ["fat-free"]
    }
  ) {
    count
    edges {
      node {
        id
        name
        description
        tags

      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "commonFoods": {
      "count": 1,
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTczNDQ0",
            "name": "Fat free sour cream",
            "description": "Sour cream, fat free",
            "tags": [
              "fat-free"
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Filter all the common foods that include the "fat-free" and "caffeine-free" tags

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

```graphql
{
  commonFoods(
      filter: {
      tags: ["fat-free", "caffeine-free"]
    }
  ) {
    count
    edges {
      node {
        id
        name
        description
        tags

      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "commonFoods": {
      "count": 2,
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTc0ODI2",
            "name": "Caffeine free cola zevia beverages",
            "description": "Beverages, ZEVIA, cola, caffeine free",
            "tags": [
              "caffeine-free"
            ]
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTczNDQ0",
            "name": "Fat free sour cream",
            "description": "Sour cream, fat free",
            "tags": [
              "fat-free"
            ]
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Get all the common foods that contain Vitamin A and Folic Acid

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

```graphql
{
  commonFoods(filter: {
      nutrients: [
        {nutrient:VITAMIN_A_RAE range: {lte: 100}}
        {nutrient:FOLIC_ACID range: {gte: 10}}
      ]
    }
  )
    {
    count
    edges {
      node {
        id
        name
        description
        foodDataId
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "commonFoods": {
      "count": 679,
      "edges": [
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyNjk0",
            "name": "Commercially prepared angelfood cake",
            "description": "Cake, angelfood, commercially prepared",
            "foodDataId": "172694"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTczMTM2",
            "name": "All flavors snickers marathon energy bar mars snackfood us formulated bar",
            "description": "Formulated bar, MARS SNACKFOOD US, SNICKERS MARATHON Energy Bar, all flavors",
            "foodDataId": "173136"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxNjcz",
            "name": "With salt cooked with water enriched quick regular yellow corn grits cereals",
            "description": "Cereals, corn grits, yellow, regular, quick, enriched, cooked with water, with salt",
            "foodDataId": "171673"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxOTU3",
            "name": "Breaded and fried cooked atlantic croaker fish",
            "description": "Fish, croaker, Atlantic, cooked, breaded and fried",
            "foodDataId": "171957"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyMzg2",
            "name": "Batter fried cooked meat and skin thigh broilers or fryers chicken",
            "description": "Chicken, broilers or fryers, thigh, meat and skin, cooked, fried, batter",
            "foodDataId": "172386"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxMTcx",
            "name": "Powder dry mushroom gravy",
            "description": "Gravy, mushroom, dry, powder",
            "foodDataId": "171171"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyMjI4",
            "name": "Flavors other than chocolate with nuts chocolate covered ice cream cone",
            "description": "Ice cream cone, chocolate covered, with nuts, flavors other than chocolate",
            "foodDataId": "172228"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTY4OTYw",
            "name": "Unprepared frozen cheese lasagna",
            "description": "Lasagna, cheese, frozen, unprepared",
            "foodDataId": "168960"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTc0OTM5",
            "name": "Commercially prepared fruitcake cake",
            "description": "Cake, fruitcake, commercially prepared",
            "foodDataId": "174939"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyNzE2",
            "name": "Enriched higher fat regular commercially prepared chocolate chip cookies",
            "description": "Cookies, chocolate chip, commercially prepared, regular, higher fat, enriched",
            "foodDataId": "172716"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxMjkz",
            "name": "Chocolate soft serve light ice cream",
            "description": "Ice cream, light, soft serve, chocolate",
            "foodDataId": "171293"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyODA5",
            "name": "Toasted (includes gluten) protein bread",
            "description": "Bread, protein, (includes gluten), toasted",
            "foodDataId": "172809"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcyNzA5",
            "name": "Prepared from recipe without frosting white cake",
            "description": "Cake, white, prepared from recipe without frosting",
            "foodDataId": "172709"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcwMjk0",
            "name": "Large patty; plain cheeseburger; single fast foods",
            "description": "Fast foods, cheeseburger; single, large patty; plain",
            "foodDataId": "170294"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTczMTQ5",
            "name": "Oats and chocolate chewy high fiber formulated bar",
            "description": "Formulated bar, high fiber, chewy, oats and chocolate",
            "foodDataId": "173149"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTcxODQy",
            "name": "With creme filling oatmeal sandwich cookies",
            "description": "Cookies, oatmeal sandwich, with creme filling",
            "foodDataId": "171842"
          }
        },
        {
          "node": {
            "id": "Q29tbW9uRm9vZE5vZGU6MTc0MTQ3",
            "name": "Cran cherry ocean spray beverages",
            "description": "Beverages, OCEAN SPRAY, Cran Cherry",
            "foodDataId": "174147"
          }
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}
