graphql-composition 0.12.2

An implementation of GraphQL federated schema composition
Documentation
---
source: crates/graphql-composition/tests/composition_tests.rs
expression: API SDL
input_file: crates/graphql-composition/tests/composition/descriptions_basic/test.md
---
"""
Defines different types of tofu.
"""
enum TofuType {
  """
  Silken tofu - soft and smooth, often used in soups and sauces.
  """
  SILKEN
  """
  Firm tofu - holds its shape well, good for grilling and frying.
  """
  FIRM
  """
  Extra firm tofu - very dense and solid, ideal for stir-fries.
  """
  EXTRA_FIRM
}

"""
The Tofu type represents various properties of tofu.
"""
type Tofu {
  """
  The unique ID of the tofu.
  """
  id: ID!
  """
  The name of the tofu.
  """
  name: String!
  """
  Nutritional information about the tofu.
  """
  nutrition: Nutrition
  """
  List of recipes that include this tofu.
  """
  recipes("Which recipes to include. See [RecipeFilter]." filter: RecipeFilter): [Recipe]
  """
  The texture profile of the tofu, expressed through a custom scalar.
  """
  texture: TextureProfile
  """
  The type of tofu (e.g., silken, firm).
  """
  type: TofuType
}

"""
Nutritional information for tofu.
"""
type Nutrition {
  """
  The amount of calories per serving.
  """
  calories: Int
  """
  Total fat content per serving.
  """
  fat: Float
  """
  The amount of protein per serving.
  """
  protein: Float
}

"""
A recipe that includes tofu as an ingredient.
"""
type Recipe {
  """
  Description of the recipe.
  """
  description: String
  """
  The unique ID of the recipe.
  """
  id: ID!
  """
  The ingredients used in the recipe, including tofu.
  """
  ingredients: [FoodItem]
  """
  The name of the recipe.
  """
  name: String!
  """
  The main type of tofu used in this recipe.
  """
  tofuType: TofuType
}

"""
Vegetable type used in tofu recipes.
"""
type Vegetable {
  """
  Name of the vegetable.
  """
  name: String
  """
  Nutritional information of the vegetable.
  """
  nutrition: Nutrition
}

"""
Spice type used in tofu recipes.
"""
type Spice {
  """
  Description of the spice's flavor.
  """
  flavorDescription: String
  """
  Name of the spice.
  """
  name: String
}

type Query {
  allTheTofus: [Tofu]
}

"""
Filter criteria for tofu recipes.
"""
input RecipeFilter {
  """
  Minimum required protein content.
  """
  minProtein: Float
  """
  Maximum allowed calorie count.
  """
  maxCalories: Int
}

"""
Union representing different food items that can be part of a recipe.
"""
union FoodItem = Tofu | Vegetable | Spice

"""
Custom scalar to represent the texture profile of tofu.
"""
scalar TextureProfile