maxfi
Reverse links typescript
Hi there. I'm wondering if it's possible to
read
a ShoppingCart
by it's id
and also get all it's ShoppingCartLineItems
in one query. I'm trying to avoid making multiple queries to the database.
I've had a look at https://xata.io/blog/navigating-many-to-one and https://xata.io/docs/concepts/data-model#links-and-relationships but I'm still not sure how to do this.
Schema:
What seems to work is:
However, record
doesn't have a lineItems
prop. 🤔7 replies
Remix v2.8.1 (vite) on Vercel serverless function timeout when making xata db calls
The app is deploying properly and I can't see any issues in the runtime logs on Vercel. The serverless function (Node.js 20x) just timeouts after 60 seconds. Via console.logs I'm pretty sure it's related to a xata query.
In the build logs I see the following warnings (not sure if this is related):
I've checked that
process.env.XATA_API_KEY
and process.env.XATA_BRANCH
are defined in the serverless function (via console.log) and they are.
I get the xata client like so: export const xata = getXataClient();
Potentiall other relavant parts of the Vercel build logs:
I'm using "@xata.io/client": "^0.29.3",
in package.json.
Any ideas how to further troubleshoot this? Thanks in advance!27 replies