Skip to content
Discussion options

You must be logged in to vote

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:

import { GeneratedType } from './generated-types';

interface ExtendedType extends GeneratedType {
  $id: string;
}

Check if your schema includes metadata:
Sometimes, metadata fields like $id ar…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Maryusz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants