nuwave / nuwave/lighthouse

Async Batched Queries

Open
#1,918 5 comments 0 reactions 1 assignee View on GitHub

@tlaverdure is already working on this.

Since Aug 17, 2021.

enhancement performance
Dominant language
PHP
Stars
3.5k
Forks
468
Avg merge
3h 9m
Merged PRs (30d)
2

Description

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-L165

And I'm also naively assuming that it should just work but let me know what you think.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.