M
Manifest•3w ago
inlustra

"with" and opposite relationship

Hi guys! Loving Manifest at the moment. After reading the documentation, it's clear that all relationships are bi-directional. However, I'm having trouble querying them. This is my example:
Table:
properties:
- { name: name, type: string }
- { name: seats, type: number }
- { name: closedAt, type: timestamp }
validation:
name: { required: true }
seats: { required: true }

Tab:
belongsTo:
- { name: table, entity: Table }
- { name: createdBy, entity: Staff }
Table:
properties:
- { name: name, type: string }
- { name: seats, type: number }
- { name: closedAt, type: timestamp }
validation:
name: { required: true }
seats: { required: true }

Tab:
belongsTo:
- { name: table, entity: Table }
- { name: createdBy, entity: Staff }
client
.from("tables")
.where("closedAt = null")
.with(["tabs", "tabs.id"])
.find<Table>()
client
.from("tables")
.where("closedAt = null")
.with(["tabs", "tabs.id"])
.find<Table>()
However, this doesn't seem to be returning anything. Given that I want to query the opposite relationship. How can I name the other side of that relationship? I've tried "Tab", "Tabs", "tab" and "tabs" with no luck. Is it possible to query in this direction? I'm hoping so!
2 Replies
inlustra
inlustraOP•3w ago
Solved - this was totally my fault. Forget I asked! I'm running a proxy route so set cookies and totally forgot to include search params in the proxy path. Derp. If the team sees this - happy to jump into a call to discuss anything (Noting the "e one of 50 developers for a quick video call and shape the product with your insights!")
SebConejo
SebConejo•3w ago
@inlustra I sent you a DM 😉

Did you find this page helpful?