chad3814
chad3814
Explore posts from servers
PPrisma
Created by chad3814 on 10/23/2024 in #help-and-questions
Introspection in the client extensions
Say I have a client exension:
new PrismaClient({
}).$extends({
query: {
$allModels: {
findFirst({ model, args, query }) {
return query(args);
}
}
}
})
new PrismaClient({
}).$extends({
query: {
$allModels: {
findFirst({ model, args, query }) {
return query(args);
}
}
}
})
The model here is just a string. How can I figure out if there's a unique constraint in the args, and what it is? Anyway to determine if the model has an @id field? I want to make something smarter than just a generic query cache.
4 replies