Help on schema.unionType #675
Unanswered
decosvaldo
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody.
I'm using the new Nexus framework with prisma client. My question is:
I have three Models/Database tables: albumreview, bookreview and moviereview.
I want to combine them inside an union type called Publications, so I can make use of sorting and pagination.
I created the object as said in the documentation. Here it is:
Now I'm a little lost on how to perform a simple query on the client side/playground, like get last 10 publications.
My schema objects are defined this way:
They need to be separate objects inside my database.
My basic queries are configured this way:
The union definition is defined only on the Nexus side, since the prisma.schema was created by introspection.
Can anyone please help me to build a simple query definition where I can return the objects together with the correct model and __typename information and also with the exposed args from the prisma schema (last, skip, etc)?
I appreciate your help. Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions