Deferred with Guzzle PromiseInterface #1511
vasily-kartashov
started this conversation in
General
Replies: 1 comment
-
As you mentioned, wrapping it in a Maybe you miss resolving your inner promise in the |
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 cannot fully grasp the following use case. A node, which we'll call
User::status
, is resolved by sending a Guzzle request to an HTTP microservice. This microservice expects a list ofuserIds
as input. Therefore, the most efficient solution appears to be returning aDeferred
that resolves to aPromiseInterface
. TheDeferred
would accumulateuserIds
, and once alluserIds
have been collected, it would send a request to the HTTP microservice, immediately returning a promise. The GraphQL library should then be intelligent enough to recognize that this is aPromise
/Thenable
result, and proceed to resolve other nodes before returning to wait for the promise's resolution.I am using vanilla PHP (without AMP, Swoole, or similar technologies). Is the above scenario feasible? How can I implement it?
Beta Was this translation helpful? Give feedback.
All reactions