In typescript, the types of nullable field are just made possibly undefined. But there is missing the | null in the type.
For example, the avatar of a DirectusUser has the following type: avatar?: string | DirectusFiles; But it should have this type: avatar: string | DirectusFiles | null;
I think it would be a good approach on this. In the meanwhile, we can check those fields for falsy values.
Btw, thank you for this great extension! Currently, there is no other tool, that satisfies my needs for type generation for Directus.
In typescript, the types of nullable field are just made possibly undefined. But there is missing the
| null
in the type. For example, the avatar of a DirectusUser has the following type:avatar?: string | DirectusFiles;
But it should have this type:avatar: string | DirectusFiles | null;
I think it would be a good approach on this. In the meanwhile, we can check those fields for falsy values.
Btw, thank you for this great extension! Currently, there is no other tool, that satisfies my needs for type generation for Directus.