Type generation metadata #10121
-
|
Hi, appwrite types [options] <output-directory>which is the best way to obtain metadata like $id? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi Maryusz, When using appwrite types to generate types, the tool primarily creates type definitions based on your database or API schemas, but it doesn’t automatically include metadata fields like $id in the generated types by default. To include metadata such as $id in your types, here are some approaches: Extend generated types manually: Check if your schema includes metadata: Use runtime typings: Consult Appwrite documentation or feature requests: |
Beta Was this translation helpful? Give feedback.
Hi Maryusz,
When using appwrite types to generate types, the tool primarily creates type definitions based on your database or API schemas, but it doesn’t automatically include metadata fields like $id in the generated types by default.
To include metadata such as $id in your types, here are some approaches:
Extend generated types manually:
After generating types, you can create your own TypeScript interfaces or types that extend the generated ones and add the $id field where needed. For example:
Check if your schema includes metadata:
Sometimes, metadata fields like $id ar…