-
Im creating an app for managing players on soccer teams. Heres a simplified db diagram: This is my team resolver
And the user to team resolver:
Im using typeorm, here are the models: Team
Model
This is the error im seeing: I suppose what i was expecting is that because im querying the user field of a team model it would hit the field resolver of the user to team resolver because the players field resolver resolvers to a userToTeamModel:
and the userToteam resolver has the return type defined :
so even though the userToTeam players field resolver doesnt return a model with the player field populated it would defer to the field resolver for that field. Am i just fundamentally mistaken about how the field resolvers work? How would i go about implementing this? I could, of course populate the user relation in the userToTeam field resolver of the team resolver, but that user itself will have fields that are queryable i will want to defer to the field resolvers on the user resolver for. The un-simplified code is here: https://github.com/quirkles/madrid_reds_graphql/tree/main/src, the models are in the datalayer folder. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Turns out im a completle idiot, i was simply not registering the necessary resolver: |
Beta Was this translation helpful? Give feedback.
Turns out im a completle idiot, i was simply not registering the necessary resolver: