{"action":"created","issue":{"url":"https://api.github.com/repos/Akryum/vue-apollo/issues/7","repository_url":"https://api.github.com/repos/Akryum/vue-apollo","labels_url":"https://api.github.com/repos/Akryum/vue-apollo/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Akryum/vue-apollo/issues/7/comments","events_url":"https://api.github.com/repos/Akryum/vue-apollo/issues/7/events","html_url":"https://github.com/Akryum/vue-apollo/issues/7","id":180939219,"number":7,"title":"does vue-apollo work with vuex?","user":{"login":"DougDavenport","id":553233,"avatar_url":"https://avatars.githubusercontent.com/u/553233?v=3","gravatar_id":"","url":"https://api.github.com/users/DougDavenport","html_url":"https://github.com/DougDavenport","followers_url":"https://api.github.com/users/DougDavenport/followers","following_url":"https://api.github.com/users/DougDavenport/following{/other_user}","gists_url":"https://api.github.com/users/DougDavenport/gists{/gist_id}","starred_url":"https://api.github.com/users/DougDavenport/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DougDavenport/subscriptions","organizations_url":"https://api.github.com/users/DougDavenport/orgs","repos_url":"https://api.github.com/users/DougDavenport/repos","events_url":"https://api.github.com/users/DougDavenport/events{/privacy}","received_events_url":"https://api.github.com/users/DougDavenport/received_events","type":"User","site_admin":false},"labels":[{"id":444858857,"url":"https://api.github.com/repos/Akryum/vue-apollo/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-10-04T16:17:00Z","updated_at":"2016-11-06T16:21:34Z","closed_at":null,"body":"Can / should vue-apollo be used with vuex?\nIf yes then could you please show examples?\n"},"comment":{"url":"https://api.github.com/repos/Akryum/vue-apollo/issues/comments/258691593","html_url":"https://github.com/Akryum/vue-apollo/issues/7#issuecomment-258691593","issue_url":"https://api.github.com/repos/Akryum/vue-apollo/issues/7","id":258691593,"user":{"login":"davenport","id":553302,"avatar_url":"https://avatars.githubusercontent.com/u/553302?v=3","gravatar_id":"","url":"https://api.github.com/users/davenport","html_url":"https://github.com/davenport","followers_url":"https://api.github.com/users/davenport/followers","following_url":"https://api.github.com/users/davenport/following{/other_user}","gists_url":"https://api.github.com/users/davenport/gists{/gist_id}","starred_url":"https://api.github.com/users/davenport/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davenport/subscriptions","organizations_url":"https://api.github.com/users/davenport/orgs","repos_url":"https://api.github.com/users/davenport/repos","events_url":"https://api.github.com/users/davenport/events{/privacy}","received_events_url":"https://api.github.com/users/davenport/received_events","type":"User","site_admin":false},"created_at":"2016-11-06T16:21:34Z","updated_at":"2016-11-06T16:21:34Z","body":"After reviewing vue-apollo, apollo client, and vuex I think there may be an easy way to enhance vue-apollo to allow for vuex support. Currently vue-apollo updates the local state. In vuex the store is modified by committing a mutation. \r\n\r\nWhat if a new option were added to vue-apollo to bypass the local state update and instead call a user supplied function?\r\n\r\nLet's call the new option \"apply\" (or whatever makes more sense). The following updated applyData should be enough to allow support for vuex (or something else):\r\n\r\n    function applyData(data) {\r\n      loadingDone();\r\n\r\n      if (typeof options.apply === 'function') {\r\n        options.apply.call(vm, data);\r\n      } else if (typeof options.update === 'function') {\r\n        vm[key] = options.update.call(vm, data);\r\n      } else if (data[key] === undefined) {\r\n        console.error(`Missing ${key} attribute on result`, data);\r\n      } else {\r\n        vm[key] = data[key];\r\n      }\r\n\r\n      if (typeof options.result === 'function') {\r\n        options.result.call(vm, data);\r\n      }\r\n    }\r\n\r\nWhat do you think?\r\n"}}
{"actor":{"display_login":"davenport"}}