Hey guys, I'm having difficulty using a *Connectio...
# orm-help
c
Hey guys, I'm having difficulty using a *Connection query with prisma-client (after switching from prisma-binding). When I was using prisma-binding, my query worked fine, but now i'm being told my *Connection query must have a sub-selection. I'll post details in a thread
ItemConnection is the query that is having issues (screenshot below)
Here's my implemented resolver (using prisma-client). Not using
forwardTo('db')
anymore because that's not possible with prisma-client
Here's the simplest possible query I could make in playground. (note the lack of static errors picked up. I'm matching the schema properly in this query) edit: file upload not working
And here is the error that I get:
help would be appreciated!! I'm going to be switching back to prisma-binding until I can get this working
s
Where did you define type ItemConnection, buddy ? I think you didn't pass the info object to prisma resolver function which you used as db.itemsConnection.
c
ahhhh i'm getting it from the generated graphql file:
# import * from './generated/prisma.graphql'
That makes a lot of sense! I might have to define ItemConnection manually
prisma looks at my
datamodel.graphql
then makes
prisma.graphql
which has
ItemConnection
I was hoping that, in the next step, prisma-client would have
prisma.graphql
at the ready for the import
because ItemConnection's type is pretttty big
is there a way around having to define
ItemConnection
manually? Because it would be a bit of a hassle otherwise
for what it's worth, I finally managed to get this query working by doing the following:
then my resolvers:
It works, but it's not a very nice solution so if anyone has any help to give I would greatly appreciate it
I'm still using prisma-client for everything else that can't just be forwarded to the db. If anyone can point out something dangerously wrong with what I've done, please let me know 🙂