I'm trying for the first time appwrite on 2 projects and after I've tested appwrite types generation with the cli I'm a little bit confused why it doesn't include or handle the $id field which is fundamental to handle relationships.
I'm not finding anything about it in the documentation and I understand that it is reported that the relationships are in an experimental phase but rather it makes me think that I'm doing something wrong or is it intentional?
What is the best way to relate collections of documents in this case?
Thank you very much ๐
$id and similar attributes are apart of the models provided by appwrite. Your type should extend appwrites base type. Does the type generator not do this?
Similar to this
export type Books = Models.Document & {
name: string;
author: string;
releaseYear: string | null;
category: Category | null;
genre: string[] | null;
isCheckedOut: boolean;
}
We are extending the Models.Document type, which includes $id, $createdAt, etc.
I only saw right now that when generating types with -l ts option it does generate the extended classes, but this doesn't happen for dart and PHP. ๐ค
seems like only ts pulls with the base types. idk if that's intended or not. Seems weird to me.
Recommended threads
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...
- Websites hosted on my appwrite sites hav...
Hello, all my websites hosted on appwrite sites are not running I am getting this message "This site canโt be reached drivehub.appwrite.network took too long t...
- Appwrite Auth & Function don't reveal cl...
When I execute a function or sign in with my Flutter app, Appwrite does not show my real IP: instead, it seems that Appwrite shows Fastly CDN IP address.