{"action":"created","issue":{"url":"https://api.github.com/repos/overblog/dataloader-bundle/issues/15","repository_url":"https://api.github.com/repos/overblog/dataloader-bundle","labels_url":"https://api.github.com/repos/overblog/dataloader-bundle/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/overblog/dataloader-bundle/issues/15/comments","events_url":"https://api.github.com/repos/overblog/dataloader-bundle/issues/15/events","html_url":"https://github.com/overblog/dataloader-bundle/issues/15","id":288078898,"number":15,"title":"What is the point of this bundle","user":{"login":"akomm","id":2409779,"avatar_url":"https://avatars0.githubusercontent.com/u/2409779?v=4","gravatar_id":"","url":"https://api.github.com/users/akomm","html_url":"https://github.com/akomm","followers_url":"https://api.github.com/users/akomm/followers","following_url":"https://api.github.com/users/akomm/following{/other_user}","gists_url":"https://api.github.com/users/akomm/gists{/gist_id}","starred_url":"https://api.github.com/users/akomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akomm/subscriptions","organizations_url":"https://api.github.com/users/akomm/orgs","repos_url":"https://api.github.com/users/akomm/repos","events_url":"https://api.github.com/users/akomm/events{/privacy}","received_events_url":"https://api.github.com/users/akomm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-01-12T10:46:59Z","updated_at":"2018-05-02T11:06:37Z","closed_at":"2018-01-12T17:54:51Z","author_association":"NONE","body":"1. The following does not require this bundle, except the adapter, which purpose is neither explained nor obvious from readme:\r\n```yml\r\nservices:\r\n    app.graph.ship_repository:\r\n        class: AppBundle\\Entity\\Repository\\ShipRepository\r\n        factory: [\"@doctrine.orm.entity_manager\", getRepository]\r\n        arguments:\r\n            - AppBundle\\Entity\\Ship\r\n\r\n    app.graph.ships_loader:\r\n        class: AppBundle\\GraphQL\\Loader\\ShipLoader\r\n        arguments:\r\n            - \"@overblog_graphql.promise_adapter\"\r\n            - \"@app.graph.ship_repository\"\r\n```\r\n\r\n2. Why do I need to define the adapter in another bundle:\r\n```yml\r\n#graphql\r\noverblog_graphql:\r\n    definitions:\r\n        schema:\r\n            query: Query\r\n    services:\r\n        promise_adapter: \"webonyx_graphql.sync_promise_adapter\"\r\n```\r\n\r\n3. \r\n```yml\r\n#dataloader\r\noverblog_dataloader:\r\n    defaults:\r\n        promise_adapter: \"overblog_dataloader.webonyx_graphql_sync_promise_adapter\"\r\n    loaders:\r\n        ships:\r\n            alias: \"ships_loader\"\r\n            batch_load_fn: \"@app.graph.ships_loader:all\"\r\n```\r\nAgain, what is the purpose of the adapter? I create service, to create a service which lets the adapter call a load_fn, but it seems from the following example, that I still have to somehow collect the IDs:\r\n\r\n```php\r\n    public function resolveShip($shipsID)\r\n    {\r\n        $promise = $this->container->get('ships_loader')->load($shipsID);\r\n\r\n        return $promise;\r\n    }\r\n```\r\n\r\nSo I could simply spare a lot of config and simply use the deffered from webonyx and collect my ids anyway. I could create a single service (instead of two) with almost zero config (using autoconfig/autowire) which does exactly this. Also the resolver usage does magically get shipIds, while actually the resolver would not get IDs, but the value/data being resolved.\r\n\r\nThe resolver usage combined with previous explanation feels like an \"1. do this 2. ??? 3. profit?\" currently ;(."},"comment":{"url":"https://api.github.com/repos/overblog/dataloader-bundle/issues/comments/385941685","html_url":"https://github.com/overblog/dataloader-bundle/issues/15#issuecomment-385941685","issue_url":"https://api.github.com/repos/overblog/dataloader-bundle/issues/15","id":385941685,"user":{"login":"ivoba","id":471254,"avatar_url":"https://avatars0.githubusercontent.com/u/471254?v=4","gravatar_id":"","url":"https://api.github.com/users/ivoba","html_url":"https://github.com/ivoba","followers_url":"https://api.github.com/users/ivoba/followers","following_url":"https://api.github.com/users/ivoba/following{/other_user}","gists_url":"https://api.github.com/users/ivoba/gists{/gist_id}","starred_url":"https://api.github.com/users/ivoba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivoba/subscriptions","organizations_url":"https://api.github.com/users/ivoba/orgs","repos_url":"https://api.github.com/users/ivoba/repos","events_url":"https://api.github.com/users/ivoba/events{/privacy}","received_events_url":"https://api.github.com/users/ivoba/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T11:06:37Z","updated_at":"2018-05-02T11:06:37Z","author_association":"NONE","body":"@mcg-web i can fix the typo, sure.\r\nBut i still dont understand how to chain an id in the `load` method.\r\nCan you explain this maybe?"}}
{"actor":{"display_login":"ivoba"}}