Hello folks. I’m running into an issue with a sele...
# orm-help
h
Hello folks. I’m running into an issue with a select on a relation. It appears to be the same one as documented here https://github.com/prisma/prisma/discussions/14523 but I cannot find anything on github tracking this as an issue or potential workarounds if it’s related to schema generation. changing our queries wont work for our case we have some generated deeply nested/dynamic items. Any help would be appriciated.
1
I’m wondering if the available types which is empty is part of the issue. Unknown arg
where
in select.Recipe.where for type Recipe. Did you mean
select
? Available args: type Recipe { } But i havent dug that deeply into Prisma’s implementation. We’re on 4.0.0 for reference.
a
Hey Hayley! If you could share your full Prisma schema and the query you are attempting, I can dig into this further 🙂.
h
hey @Austin I figured out the difference its just quite strange to me. If it’s a list, the where clauses sits with the select. of that object. If its not a list, the where clause isn’t an argument and has to sit at a higher level.
i’m still trying to make that fly with a dynamic query generator, but it is consistent and digging deep enough to the documentation i did find that seems to match the docs. i wish i wasn’t that way but, wishes aren’t bugs. 🙂
(although the higher level docs about clausues and relationships could probably use a link to the more in depth rules of relationships if there isn’t one and i just missed it)
a
Ah, that’s interesting. I’ll bring this up internally to see if we can make our docs clearer 👍. Thanks!
👍 1
h
np. tbh if it’s not intentional that non lists cant have a where with their select, that would be very useful to have. at least in our case.