Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullable fields are only possibly undefined #17

Closed
CodesDoWork opened this issue Dec 21, 2022 · 0 comments · Fixed by #18
Closed

Nullable fields are only possibly undefined #17

CodesDoWork opened this issue Dec 21, 2022 · 0 comments · Fixed by #18

Comments

@CodesDoWork
Copy link

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.

stafyniaksacha added a commit to stafyniaksacha/directus-extension-generate-types that referenced this issue Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant