Is there anyway to have a single resolver resolve multiple fields? #864
Unanswered
davlee1972
asked this question in
Q&A
Replies: 1 comment 5 replies
-
What's your implementation? Normally the SQL query would occur in resolver for field returning the user, and not in field resolving user's attributes (unless those are separate database entities).
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If there any way to resolve multiple fields with results from a single SQL call? Ideally I don't want to even call the SQL if none of the dependent fields need to be resolved.
Example in theory:
@user.field(["firstName","lastName"])
def resolve_firstName(obj, info):
"""" select first_name, last_name from people_table where user_id = obj["user_id"] """
first_name = "Bob"
last_name = "Marley"
return first_name, last_name
Beta Was this translation helpful? Give feedback.
All reactions