You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will be very verbose when having large models with lots of references to other collections, because we need to define a very similar field resolver each time. So my question is if anyone has an idea to do this in a generic way? Maybe with a custom decorator to be used instead of the @field decorator? Something like:
This discussion was converted from issue #1239 on March 17, 2022 19:59.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a user model like:
Now I want to be able to populate the profile_image_id through GraphQL so I need to create a field resolver for the profile_image_id param:
user.resolver.ts
This will be very verbose when having large models with lots of references to other collections, because we need to define a very similar field resolver each time. So my question is if anyone has an idea to do this in a generic way? Maybe with a custom decorator to be used instead of the @field decorator? Something like:
Beta Was this translation helpful? Give feedback.
All reactions