Closed melissapthai closed 3 months ago
@melissapthai is attempting to deploy a commit to the openbeta-dev Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
open-tacos | ✅ Ready (Inspect) | Visit Preview | Mar 22, 2024 3:06pm |
@melissapthai the build is failing on Vercel.com. Does this link work for you?
https://vercel.com/openbeta-dev/open-tacos/AmGt7PPiKqKqwWL9aDTfREn8S7eR#L33
@vnugent that link works, but I get a 404 on https://vercel.com/openbeta-dev/open-tacos and https://vercel.com/openbeta-dev/
Also, I fixed the build issue and now it's green.
@all-contributors add @melissapthai for code
@vnugent
I've put up a pull request to add @melissapthai! :tada:
What type of PR is this?(check all applicable)
Description
Currently, if you go to an area whose uuid doesn't exist in the database, it'll throw a server error (ex: https://openbeta.io/area/f92d68ca-1b6f-5bc7-8d1f-16b3961b3cce):
And if you go to an area with an invalid uuid, it'll throw a 404 (ex: https://openbeta.io/area/asdfasdf):
I believe this is occurring because of the way Apollo Server handles validation errors (like invalid uuids) vs resolver errors (area uuid doesn't exist in database).
What this PR achieves
This PR remediates this issue by wrapping the graphql query made in
getArea
in a try/catch. If the query errors out, return a null area. And when rendering the area page, returnnotFound()
for a null area.Since the
AreaPageDataProps
interface was changed to accommodate for the area being nullable, I had to update a number of other places in the code that use this:Related Issues
Issue #1100
Notes