Async returns in extendType - Query #1163
Unanswered
MaximilianGaedke
asked this question in
Q&A
Replies: 1 comment
-
Do you have a code example of your resolver? It sounds like you'd need to map the return value of each async call to an array, then use Promise.all to return your data when these have resolved. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an async function in a for loop that I want to run first and then return data.
If I just return it normally, it simply returns the initial data, without the changes from the for loop or the function inside.
Does anyone have an idea where I could solve this?
Thank you very much for your help!
(+ I use Apollo GraphQL and Prisma)
Beta Was this translation helpful? Give feedback.
All reactions