Cant use nested fiel resolvers with typegoose #1447
Unanswered
angelhodar
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I would suggest looking for a way to transform graphql result before sending the result as json response in docs of graphql server you're using. |
Beta Was this translation helpful? Give feedback.
2 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I have just run into a situation where the integration middleware with typegoose has a problem with field resolvers in subdocuments. I have this example model:
Now the problem is that this line:
always returns false because the typegoose middleware has already converted the interests documents into plain objects so the
ìsImportant
function is not present. Here I paste the typegoose middleware for reference:This could be solved by applying the middleware AFTER all the field resolvers have been executed, but I have no idea how to do that or if its even possible to check the resolver stack position. Thanks in advance!!
Beta Was this translation helpful? Give feedback.
All reactions