-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Feature Request] Generate Types of Datasources #40
Comments
I am open for any PR - meanwhile you also extend the typings like I did in the examples https://github.com/dohomi/storyblok-generate-ts#resolve-relations |
@dohomi "schema": {
"versusCategory": {
"datasource_slug": "versuscategory",
"...": "..."
}
}, But the actual values of the datasource are not listed. So there is no way to generate those types, exept, this package would have to do a HTTP request to the Storyblok API, which would also need an API key then. Not sure if this is still in the scope of this package, since this would include larger rewrite. Maybe I can file a feature request to the storyblok team including datasource values somewhere in the generated JSON. What do you think? |
@madebyfabian sure you can ping them, not sure why there is no native tooling around the API for creating types. In my opinion this should be handled via GraphQL but the endpoint only delivers root page typings last time I checked. |
Hi there! First of all, thanks for your work on this package. It's really great.
I started to use the Datasources Feature of Storyblok more for my
Single-Option
fields.It's great because you can share field options between components, to keep them consistent.
However though, I noticed that when having "locally"/inside the component defined
Single-Option
fields, they are typed with a union of the possible field values. When using Datasources, I just get a string type out of them, which isn't that helpful.If it's technically possible, it would be great to have the datasources also typed. If you like, I can offer to help with integrating this feature.
The text was updated successfully, but these errors were encountered: