-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
After some testing I couldn't figure out how to use the Strapi generated types (types/generated/**
) with this module.
I read somewhere that here all the 'attributes' are omitted. Is there a config to keep using the same types just like Strapi generates them?
Or is there a workaround to generate Strapi types like they are provided in this module (I prefer this option 🙂).
import type { ApiHomeHome } from '@mloth/strapi' // A package in my monorepo
const { data } = await useAsyncData('home', () =>
findOne<ApiHomeHome>('home', '', {
locale: locale.value,
populate: [
'hero', // Gives type error but 'data' is correct
'attributes.hero', // No type error, but not in 'data'
],
}),
)
So in short: how to leverage the autogenerated types?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested