Extending Generated Resolvers With Relations #104
tradical-allstripes
started this conversation in
General
Replies: 1 comment 3 replies
-
In TypeGraphQL (and GraphQL implementations at all) you never can't access the data resolved in other field resolved. I probably should remove |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I apologize if this is documented somewhere, but I couldn't find it.
I'm currently trying to add a field resolver to one of the types generated by this plugin, and running into some trouble. Specifically, the relations do not resolve properly. Here is my first attempt with any confidential information removed:
The issue I'm seeing is that
barObj
is undefined. I have also confirmed that none of the relation fields are populated. We also have a separate field for thebar
string id, which is being populated as expected. Note that I am including theFooRelationsResolver
in the schema registry, as the documentation says. Relations resolve as expected using the raw generated resolver. I've tried adding the following (and registering it) with no change in behavior:What am I doing wrong? Is what I'm trying to do even possible?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions