Hello π, quick question about Type generation and Relationships in Typescript. There might be an "issue" using createDocument for relations, only the parameter $id is required, but the Type generation assigns whole type. What would be the ideal way to deal with it?
appwrite.d.ts
export type Items = Models.Document & {
name: string;
}
export type Users = Models.Document & {
username: string;
}
export type Favorites = Models.Document & {
item: Items;
user: Users;
}
databases.createDocument(
ID.unique(),
{
item: items.$id, // Error: Type string is not assignable to type Items
user: users.$id, // Error: Type string is not assignable to type Users
},
);
And also, the appwrite.d.ts generator write the type name as plural (Items, Users, Favorites) instead of singular (Item, User, Favorite), is it intentional? From source code I found that it uses the collection name, but automatically creating singular from plural would be more appropriate? Is it recommended to use singular name of the collection to avoid this?
Recommended threads
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.
- Download appwrite Docs
Is there is a way to download appwrite Docs ? Because appwrite skill isn't enough to give the agent full understanding about how appwrite works (I noticed this ...
- Appwrite Cloud Project shutdown due to i...
My appwrite projects gets shut down saying due to inactivity, but our platform gets users everyday with many requests to database and storage. so why all of a s...