StefanBOriginal post
Rank 2: Process
How does Appwrite behave in cyclic dependencies?
Consider following (is for multi tenant):
Customer(User, Address, Shop)
Shop(List)
Order(Customer, Shop)
What is the output, if I create a Order and fetch it afterwards.
In my case, I think in the nested json there is the data missing (otherwise it would create infinity children).
- Am I right?
- How to solve this?
Summary
Title: Two-way relationship in Appwrite
Question: How does Appwrite handle cyclic dependencies?
Example: Customer-Shop-Order relationship
TL;DR: When creating an Order and fetching it afterwards, the nested JSON may be missing data due to cyclic dependencies.
1. Correct, the data may be missing in the nested JSON to avoid creating infinite children.
2. To solve this, you can manually fetch the related data using Appwrite's data fetching methods or adjust the data structure to avoid cyclic dependencies.