How to write GraphQL-Prisma queries for Next-Auth User obejcts. #3978
-
Question 💬I'd like to write some GraphQL Nexus queries on behalf of the User object Next-Auth creates. I don't really know where to start though considering I don't have a I'd like to query for all the favorite animals of the current user. I can edit the fields just fine in prisma studio, but where can I edit and extend upon these queries. Next-Auth doesn't create a file that you can look at and adjust. I have a Animals.ts file where I define the objectType and write the logic for the queries and mutations. How / where can I do something similar for the User model Next-Auth creates for me? How to reproduce ☕️//prisma.schema
//Animals.ts
Contributing 🙌🏽No, I am afraid I cannot help regarding this |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As it turns out, all I had to do was create a //User.ts
This works fine and pull up all the correct data from the Next-Auth user |
Beta Was this translation helpful? Give feedback.
As it turns out, all I had to do was create a
User
object type and export it just like I did with the Animal.ts file.I guess I was worrying for no reason
//User.ts