Open tlaverdure opened 3 years ago
I am all over the graphql-php
codebase, mostly working on strict typing and uncovering/fixing bugs. Have not paid particular attention to async execution.
Your assumption seems sound, I think it is very much possible and useful for Lighthouse to allow alternative executors. Open for pull requests 😉
Cool, I'll dig in once I find some time. Thanks for the feedback.
async php & react php are converging; you might want to implement this in php v8.1 fibers
i think async execution would be a great improvement for lighthouse. perhaps laravel octane could help to reach that behaviour
@mathiasmoser how would laravel octane help with this?
What problem does this feature proposal attempt to solve?
It looks like webonyx/graphql-php can fetch data asynchronously. https://webonyx.github.io/graphql-php/data-fetching/#async-php
I'm not sure if batched queries are currently executed synchronously or asynchronously, but I could imagine there would be great performance benefits if they were resolved asynchronously. @spawnia could you confirm? It looks like you have been working on the
ReactPromiseAdapter
recently and I'm not sure if that is related. 👀https://github.com/webonyx/graphql-php/commits/master/src/Executor/Promise/Adapter/ReactPromiseAdapter.php
Which possible solutions should be considered?
I assume we could allow an alternate path for execution here if we wanted to use
promiseToExecute()
: https://github.com/nuwave/lighthouse/blob/985d39e4c0a513453e964bb1e04a97252d8e9665/src/GraphQL.php#L159-L165And I'm also naively assuming that it should just work but let me know what you think.