picklemik
Aarktype
•Created by picklemik on 5/3/2025 in #questions
Can't infer type of schema when using "scope"
Thanks anyway, helped a lot
18 replies
Aarktype
•Created by picklemik on 5/3/2025 in #questions
Can't infer type of schema when using "scope"
Okay, will check that out. For now I think I will just "replace" the arktype
type
function with my own scope. Like
Not sure if this is a good idea in the long term, but it is easy and works for now. The string.objectId.parse
works, but I don't get auto complete for these. Maybe the nested scopes/submodules will help there18 replies
Aarktype
•Created by picklemik on 5/3/2025 in #questions
Can't infer type of schema when using "scope"
But not sure if I should create multiple scopes, or just one global scope I use in the whole app
18 replies
Aarktype
•Created by picklemik on 5/3/2025 in #questions
Can't infer type of schema when using "scope"
In this case e.g. it is kind of an "extension" or "plugin" where I want to provide types for mongo db
18 replies
Aarktype
•Created by picklemik on 5/3/2025 in #questions
Can't infer type of schema when using "scope"
Maybe one additional quick question while you are already here 🫣 Where would I best put my
scope
that I would want to reuse often? Should I just put it in some util file and use that instead of the default type
when I create my types or is there something more elegant18 replies
Aarktype
•Created by picklemik on 5/3/2025 in #questions
Can't infer type of schema when using "scope"
Perfect, thanks! I replaced all my
extends Type
with extends type.Any
and I think it works now18 replies
Aarktype
•Created by picklemik on 5/3/2025 in #questions
Can't infer type of schema when using "scope"
Thanks, but that is not really the problem I have. I am already using morph, it has to have something to do with the scope and my generic type in the function. This is the code from the playground, there you can see the type error
18 replies