# Recipe

### List of Fields

Please note that fields not documented here may be out of date or deprecated. Not finding what you are looking for? Shoot us an [email](mailto:developers@suggestic.com).

| Field                         | Type                                                                                               | Note                                                                                                                                                                                                                                                                     |
| ----------------------------- | -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`                          | ID!                                                                                                | The recipe's id                                                                                                                                                                                                                                                          |
| `databaseId`                  | String                                                                                             | The database id of the recipe                                                                                                                                                                                                                                            |
| `totalTime`                   | String                                                                                             | <p>Total preparation and cooking time in text format</p><p>E.g., 5 minutes</p>                                                                                                                                                                                           |
| `totalTimeInSeconds`          | Int                                                                                                | Total preparation and cooking time in seconds                                                                                                                                                                                                                            |
| `name`                        | String                                                                                             | Name of the recipe                                                                                                                                                                                                                                                       |
| `numberOfServings`            | Int                                                                                                | Original recipe number of servings                                                                                                                                                                                                                                       |
| `ingredientsCount`            | Int                                                                                                | Quantity of ingredients in the recipe                                                                                                                                                                                                                                    |
| `ingredients`                 | \[[Ingredient](https://production.suggestic.com/documentation#objects-ingredient)]                 | List of the recipe's ingredients                                                                                                                                                                                                                                         |
| `ingredientLines`             | \[String]                                                                                          | <p>Complete ingredient lines including quantity</p><p>E.g. 1/4 cup coconut oil, melted</p>                                                                                                                                                                               |
| `parsedIngredientLines`       | [IngredientLine](https://docs.suggestic.com/graphql/objects/recipe/parsed-ingredient-lines)        | Structured representation of the ingredient lines                                                                                                                                                                                                                        |
| `language`                    | String                                                                                             | Language code of the recipe                                                                                                                                                                                                                                              |
| `courses`                     | \[String]                                                                                          | Tags representing the courses associated with the recipe.                                                                                                                                                                                                                |
| `cuisines`                    | \[String]                                                                                          | Tags representing the cuisines associated with the recipe.                                                                                                                                                                                                               |
| `mealTags`                    | String                                                                                             | Tags representing the meal of the day of the recipe. Options are: "Breakfast", "Lunch", "Dinner", "Snack", "Snacks", "Side dishes".                                                                                                                                      |
| `source`                      | [Source](https://docs.suggestic.com/graphql/objects/recipe/source)                                 | Source information for the recipe, including the source's URL                                                                                                                                                                                                            |
| `mainImage`                   | String                                                                                             | URL of recipe's main image                                                                                                                                                                                                                                               |
| `author`                      | String                                                                                             | Recipe's author-name                                                                                                                                                                                                                                                     |
| `authorAvatar`                | String                                                                                             | URL of the image representing the author of the recipe                                                                                                                                                                                                                   |
| `adherence (deprecated)`      | Float                                                                                              | [Adherence Score](https://docs.suggestic.com/graphql/start-here/core-concepts/adherence-score) for the recipe                                                                                                                                                            |
| `adherenceDetails`            | [Adherence](https://docs.suggestic.com/graphql/objects/common/adherence)                           | Explain the recipe's [Adherence Score](https://docs.suggestic.com/graphql/start-here/core-concepts/adherence-score) and the reasoning behind it                                                                                                                          |
| `isUserFavorite`              | Boolean                                                                                            | Has this recipe been marked as a favorite by the user                                                                                                                                                                                                                    |
| `inUserShoppingList`          | Boolean                                                                                            | Is this recipe currently contained in the user's shopping list                                                                                                                                                                                                           |
| `weightInGrams`               | Float                                                                                              | Total weight of the recipe expressed in grams                                                                                                                                                                                                                            |
| `servingWeight`               | Float                                                                                              | Weight, in grams, of each serving                                                                                                                                                                                                                                        |
| `isLogged`                    | Boolean                                                                                            | True if the recipe has been recently logged by the requesting user                                                                                                                                                                                                       |
| `instructions`                | \[String]                                                                                          | <p>An array of cooking instruction lines. </p><p>If this field is null then it means it is a "<a href="../../start-here/core-concepts/datasets">recipe from the internet</a>" and you should redirect to the recipeURL in the <a href="source">source </a>object.</p>    |
| `nutritionalInfo`             | [NutritionalInfo](https://docs.suggestic.com/graphql/objects/recipe/nutritional-info)              | Nutritional information per gram of recipe. For most use cases, the nutrientsPerServing object should be preferred.                                                                                                                                                      |
| `nutrientsPerServing`         | [nutrientsPerServing](https://docs.suggestic.com/graphql/objects/recipe/nutrientsperserving)       | Nutritional information per serving                                                                                                                                                                                                                                      |
| `caloriesPerServing`          | [caloriesPerServing](https://docs.suggestic.com/graphql/objects/recipe/caloriesperserving)         | Per serving caloric value of each nutrient                                                                                                                                                                                                                               |
| `sourceUrlWorks (deprecated)` | Boolean                                                                                            | <p><strong>True</strong> if the URL is working. Otherwise displays <strong>False</strong>. <br>There are meal plans already created show recipes with URLs not working or invalid. This will help users to check recipes before rendering them to an external site. </p> |
| `externalId`                  | String                                                                                             | `Id` of any external meal information which will help to associate the recipes in the external database with ours.                                                                                                                                                       |
| `relativeCalories`            | [RelativeCalories](https://docs.suggestic.com/graphql/objects/recipe/relative-calories-deprecated) | Relative caloric value of each macronutrient as a percentage of total calories per serving.                                                                                                                                                                              |

### Simple Example

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

```graphql
{
  recipe(id: "UmVjaXBlOmFmMDkzMjQ0LWZkZTMtNGE3Yy1iMTA4LWUxODExNTBkNmNiZQ==") {
    name
    author
    nutritionalInfo {
      calories
      protein
      carbs
      fat
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "recipe": {
      "name": "Tropical Storm Detox Shake",
      "author": "Dr. William Davis",
      "nutritionalInfo": {
        "calories": 1.48,
        "protein": 0.01,
        "carbs": 0.09,
        "fat": 0.13
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Full Example

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

```graphql
{
  recipe(id: "UmVjaXBlOjA2YjM1ODcwLTNlYTctNDYxZC1iZGMwLWIwNmY1ZGZmOTJhMw==") {
    databaseId
    totalTime
    totalTimeInSeconds
    name
    rating
    numberOfServings
    ingredientLines
    ingredients {
      name
    }
    language
    courses
    cuisines
    source {
      siteUrl
      displayName
      recipeUrl
    }
    mainImage
    isPremium
    isFeatured
    author
    authorAvatar
    ingredientsCount
    favoritesCount
    isUserFavorite
    inUserShoppingList
    weightInGrams
    servingWeight
    isLogged
    relativeCalories {
      carbs
      fat
      protein
      fat
    }
    instructions
    nutritionalInfo {
      calories
      protein
      carbs
      fat
      sugar
      fiber
      saturatedFat
      monounsaturatedFat
      polyunsaturatedFat
      transFat
      cholesterol
      sodium
      potassium
      vitaminA
      vitaminC
      calcium
      iron
      netcarbs
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "recipe": {
      "databaseId": "06b35870-3ea7-461d-bdc0-b06f5dff92a3",
      "totalTime": "30 minutes",
      "totalTimeInSeconds": 1800,
      "name": "Garlic-Seafood Stew",
      "rating": null,
      "numberOfServings": 2,
      "ingredientLines": [
        "1 tbsp olive oil",
        "1 small onion, diced",
        "5 garlic cloves, minced",
        "14 oz can diced tomatoes",
        "1 cup clam juice",
        "1 bay leaf",
        "1 tsp salt",
        "5 oz clams",
        "6 oz mussels",
        "4 oz shrimp, peeled and deveined",
        "3 oz calamari, sliced into rings",
        "2 tbsp chopped parsley"
      ],
      "ingredients": [
        {
          "name": "Olive oil"
        },
        {
          "name": "Onion"
        },
        {
          "name": "Garlic cloves"
        },
        {
          "name": "Tomatoes"
        },
        {
          "name": "Clam juice"
        },
        {
          "name": "Bay leaf"
        },
        {
          "name": "Salt"
        },
        {
          "name": "Clam"
        },
        {
          "name": "Mussels"
        },
        {
          "name": "Shrimp"
        },
        {
          "name": "Calamari"
        },
        {
          "name": "Parsley"
        }
      ],
      "language": null,
      "courses": [],
      "cuisines": null,
      "source": null,
      "mainImage": "https://storage.googleapis.com/sg-uploads/a97716f2e53c45c4be16d617de6c98e8.jpg",
      "isPremium": null,
      "isFeatured": null,
      "author": "Suggestic Premium",
      "authorAvatar": "https://sg-data.storage.googleapis.com/author/suggestic-premium.png",
      "ingredientsCount": 12,
      "favoritesCount": 1,
      "isUserFavorite": false,
      "inUserShoppingList": false,
      "weightInGrams": 1359.48474,
      "servingWeight": 679.74237,
      "isLogged": false,
      "relativeCalories": {
        "carbs": 0.2728,
        "fat": 0.2892,
        "protein": 0.438
      },
      "instructions": [
        "In a large stock pot, heat oil over medium high heat. Add the onions and cook for 3 minutes. Add garlic and saute for another minute.",
        "Add 1 cup of water, tomatoes, clam juice, bay leaf and salt. Bring to a boil, then reduce heat to medium and simmer for 20 minutes.",
        "Add in all the seafood at once and stir to combine. Cook until shrimp is pink and cooked through and mussels and clams have opened, about 7 minutes.",
        "Garnish with parsley and serve immediately"
      ],
      "nutritionalInfo": {
        "calories": 0.5185,
        "protein": 0.0568,
        "carbs": 0.0354,
        "fat": 0.0167,
        "sugar": 0.0126,
        "fiber": 0.0035,
        "saturatedFat": 0.0024,
        "monounsaturatedFat": 0.0081,
        "polyunsaturatedFat": 0.0021,
        "transFat": 0,
        "cholesterol": 0.3353,
        "sodium": 3.6826,
        "potassium": 1.2871,
        "vitaminA": 0,
        "vitaminC": 0.2328,
        "calcium": 0.2102,
        "iron": 0.0111,
        "netcarbs": 0.03
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}
