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

Unexpected & inconsistent type generation when source of Multi-Options field is set to Languages #77

Open
suateneskoc opened this issue Nov 8, 2024 · 3 comments

Comments

@suateneskoc
Copy link

Type of a field that is used in many of our blocks in our schema has started to be generated differently.

Many of our blocks include a field we call hidden_for_languages. Field type of these fields is Multi-Options and Source of options is set to Languages.

The type generated for such fields that were created in the past is generated as such

hidden_for_languages?: (
    | 'nl'
    | 'en'
    | 'fi'
    | 'fr'
    | 'de'
    | 'it'
    | 'pt'
    | 'es'
  )[];

However, the following type is being generated for the most recent instances of hidden_for_languages with exactly same settings as before

hidden_for_languages?: string[];

The new type is not only worse, but also inconsistent with hidden_for_languages fields created in the past. Could you please support? 🙏🏻

@dohomi
Copy link
Owner

dohomi commented Nov 11, 2024

I am not aware of any change in the API, could you point me from which version onwards this issue occurs? Is this a change on the Storyblok side?

@suateneskoc
Copy link
Author

I suspect it to be a change on Storyblok side. Can't tell approximately when, but Languages was added as a Source option not too long ago. Although we have been on the latest version of storyblok-generate-ts (2.1.0) for the last 6 months, only noticed this behaviour recently.

@dohomi
Copy link
Owner

dohomi commented Nov 15, 2024

I don't use that feature you describing at all in my setup, so I really don't know where to look at. You can always overwrite the created interfaces to be more precise, otherwise it would be great to chat with some devs from Storyblok what might be the reason for this

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

No branches or pull requests

2 participants