I am using a Qraphql code generator that generates the schema types in typescript and would like to use those types inside the model.
My question is how can I use a typescript type inside the Mobx state tree model like this
type AssignedFilter = {
id: number
name: string
email: string
}
const SearchStore = types
.model('Search', {
text: '',
assigned: // how to use the AssignedFilter type here??
})
A
typeis a pure TypeScript concept, so it's not possible to use atypeto define what MST type a property should be.You can however do it the other way around and create a
typefrom your MST models, if that suits your use case.Example