Skip to content

🐛 ♻️ Daily API doesn't check for null locationRecipesMap #546

@EightBitByte

Description

@EightBitByte

Summary

Some meal periods can potentially have a null locationRecipesMap in the daily API handling. Weekly handles this, but I forgot to copy over the handling to Daily.

EDIT: There's a lot of overlapping code between the two.. we should probably refactor.

Unexpected Response

{
  "data": {
    "getLocationRecipes": {
      "locationRecipesMap": null,
      "products": null
    }
  },
  "params": {
    "date": "2025-11-27",
    "locationUrlKey": "brandywine",
    "mealPeriod": 22,
    "viewType": "DAILY"
  }
}

Query

query getLocationRecipes(
  $locationUrlKey: String!
  $date: String!
  $mealPeriod: Int
  $viewType: Commerce_MenuViewType!
) {
  getLocationRecipes(
    campusUrlKey: \"campus\"
    locationUrlKey: $locationUrlKey
    date: $date
    mealPeriod: $mealPeriod
    viewType: $viewType
  ) {
    locationRecipesMap {
      stationSkuMap {
        id
        skus
      }
    }
    products {
      items {
        productView {
          sku
          name
          images {
            label
            roles
            url
          }
          attributes {
            name
            value
          }
          ... on Search_ComplexProductView {
            attributes {
              name
              value
            }
            options {
              title
              values {
                id
                title
                ... on Search_ProductViewOptionValueProduct {
                  product {
                    name
                    sku
                    attributes {
                      name
                      value
                    }
                  }
                }
              }
            }
          }
        }
      }
      page_info {
        current_page
        page_size
        total_pages
      }
      total_count
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendRelating to tRPC, DB, APIbugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions