Replies: 1 comment
-
Short answer is that the simpleObject plugin is designed for simple objects that don't have fields that require resolvers. The whole point is to NOT have things like prismaFields. That being said, I can understand why this would be useful. See this comment for an example of how to do this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all, I'm really enjoying using pothos. Thank you for such a great library!
What is a right way to include
prismaField
inside ofsimpleObject
?I'm using
simpleObject
to pass prisma model and additional information to client in a single request.Currently I'm using following code.
It works well as expected, but as it is not using
prismaField
for declaring mutation, it seems it does not having benefit from prisma plugin's pre-load functionality and falls back tofindUnique
method which will issue a another query. Is there a way to somehow spreadquery
into nested simple object and avoids issuing another query for resolving nested prisma object?Beta Was this translation helpful? Give feedback.
All reactions