# Recipe by Id

Use the `recipe`query to retrieve a recipe's details.

## Required Argument

| **Argument Name** | **Type** | **Required** |
| ----------------- | -------- | ------------ |
| `id`              | ID!      | True         |

## Available Fields <a href="#available-fields" id="available-fields"></a>

The following fields will be displayed in the response:

| **Field Name** | **Type**          | **Description**                                                                |
| -------------- | ----------------- | ------------------------------------------------------------------------------ |
| `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> |
| `name`         | <p>String<br></p> | Name of the recipe                                                             |

Refer to [this documentation](https://docs.suggestic.com/graphql/objects/recipe/recipe-object) to get the complete list of recipe fields you can add to the query response

### Simple Example

| **Field Name** | **Type**          | **Description**                                                                |
| -------------- | ----------------- | ------------------------------------------------------------------------------ |
| `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> |
| `name`         | <p>String<br></p> | Name of the recipe                                                             |

Refer to [this documentation](https://docs.suggestic.com/graphql/objects/recipe/recipe-object) to get the complete list of recipe fields you can add to the query response

### Example

### 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 %}
