Improve documentation on dataLoader using GraphQlBundle#20
Open
Ciloe wants to merge 1 commit intooverblog:masterfrom
Ciloe:improve_doc_dataloader
Open
Improve documentation on dataLoader using GraphQlBundle#20Ciloe wants to merge 1 commit intooverblog:masterfrom Ciloe:improve_doc_dataloader
Ciloe wants to merge 1 commit intooverblog:masterfrom
Ciloe:improve_doc_dataloader
Conversation
Signed-off-by: Jimmy ESCRICH <jimmy.escrich@medelse.com>
ruudk
reviewed
Mar 26, 2019
| services: | ||
| graphql_promise_adapter: | ||
| class: Overblog\DataLoader\Promise\Adapter\Webonyx\GraphQL\SyncPromiseAdapter | ||
| public: true |
ruudk
reviewed
Mar 26, 2019
| class: Overblog\PromiseAdapter\Adapter\WebonyxGraphQLSyncPromiseAdapter | ||
| arguments: | ||
| - "@graphql_promise_adapter" | ||
|
|
Contributor
There was a problem hiding this comment.
Seems very verbose, this was the only configuration that I needed:
Overblog\DataLoader\Promise\Adapter\Webonyx\GraphQL\SyncPromiseAdapter: ~
Overblog\PromiseAdapter\Adapter\WebonyxGraphQLSyncPromiseAdapter: ~
Overblog\PromiseAdapter\PromiseAdapterInterface: '@Overblog\PromiseAdapter\Adapter\WebonyxGraphQLSyncPromiseAdapter'Why not just register this out of the box?
| function ($ids) use ($promiseAdapter) { | ||
| return $promiseAdapter->createAll($this->find($ids)); | ||
| }, | ||
| $promiseAdapter |
There was a problem hiding this comment.
So you are creating a callable? The batch_load_fn option is supposed to take care of this. Did this ever work? @mcg-web we're a bit lost I think.
There was a problem hiding this comment.
So I went around the barn the long way, and concluded that while the original example isn't terrific, this new one is doing it wrong.
You are not supposed to inherit from Dataloader -- this bundle will create services which are instances of Dataloader, and those services will call the callable you define in "batch_load_fn".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.