{"action":"created","issue":{"url":"https://api.github.com/repos/artsy/metaphysics/issues/184","repository_url":"https://api.github.com/repos/artsy/metaphysics","labels_url":"https://api.github.com/repos/artsy/metaphysics/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/artsy/metaphysics/issues/184/comments","events_url":"https://api.github.com/repos/artsy/metaphysics/issues/184/events","html_url":"https://github.com/artsy/metaphysics/pull/184","id":146751874,"number":184,"title":"@dzucconi - home page modules (rails)","user":{"login":"broskoski","id":821469,"avatar_url":"https://avatars.githubusercontent.com/u/821469?v=3","gravatar_id":"","url":"https://api.github.com/users/broskoski","html_url":"https://github.com/broskoski","followers_url":"https://api.github.com/users/broskoski/followers","following_url":"https://api.github.com/users/broskoski/following{/other_user}","gists_url":"https://api.github.com/users/broskoski/gists{/gist_id}","starred_url":"https://api.github.com/users/broskoski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broskoski/subscriptions","organizations_url":"https://api.github.com/users/broskoski/orgs","repos_url":"https://api.github.com/users/broskoski/repos","events_url":"https://api.github.com/users/broskoski/events{/privacy}","received_events_url":"https://api.github.com/users/broskoski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-07T21:49:08Z","updated_at":"2016-04-08T15:40:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/artsy/metaphysics/pulls/184","html_url":"https://github.com/artsy/metaphysics/pull/184","diff_url":"https://github.com/artsy/metaphysics/pull/184.diff","patch_url":"https://github.com/artsy/metaphysics/pull/184.patch"},"body":"cc @alloy @mzikherman \r\n\r\nStill working on this but want to keep some feedback before I get too deep in. \r\n\r\nMy current thinking is:\r\n\r\n### 1. On initial load\r\n\r\n```\r\nquery {\r\n  me{\r\n    id\r\n    home_page_modules{\r\n      key\r\n      display\r\n      title\r\n    }\r\n  }\r\n}\r\n```\r\n(would return something like):\r\n\r\n```\r\n{\r\n  \"data\": {\r\n    \"me\": {\r\n      \"id\": \"547e891d7261691220dc0000\",\r\n      \"home_page_modules\": [\r\n        {\r\n          \"key\": \"followed_artists\",\r\n          \"display\": \"true\",\r\n          \"title\": \"Works by Artists you Follow\"\r\n        },\r\n        {\r\n          \"key\": \"followed_galleries\",\r\n          \"display\": \"true\",\r\n          \"title\": \"Works from Galleries you Follow\"\r\n        },\r\n        {\r\n          \"key\": \"saved_works\",\r\n          \"display\": \"true\",\r\n          \"title\": \"Recently Saved Works\"\r\n        },\r\n        {\r\n          \"key\": \"recommended_works\",\r\n          \"display\": \"true\",\r\n          \"title\": \"Recommended Works for You\"\r\n        },\r\n        {\r\n          \"key\": \"live_auctions\",\r\n          \"display\": \"true\",\r\n          \"title\": \"At auction: Art in General: Benefit Auction 2016\"\r\n        },\r\n        {\r\n          \"key\": \"current_fairs\",\r\n          \"display\": \"true\",\r\n          \"title\": \"Art Fair: SP-Arte 2016\"\r\n        },\r\n        {\r\n          \"key\": \"related_artists\",\r\n          \"display\": \"true\",\r\n          \"title\": \"Works by Related Artists\"\r\n        }\r\n      ]\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n### 2. Then client side, for each key returned: \r\n\r\n```\r\nquery {\r\n  me{\r\n    id\r\n    home_page_modules(include_keys: [\"recommended_works\"]){\r\n      results{\r\n        id\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nThis way, each rail has all the information it needs to render itself.\r\n\r\nThere's some weird things about this implementation (most obviously, passing the `accessToken` around), so feel free to let me know where things are non-optimal.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/artsy/metaphysics/issues/comments/207484757","html_url":"https://github.com/artsy/metaphysics/pull/184#issuecomment-207484757","issue_url":"https://api.github.com/repos/artsy/metaphysics/issues/184","id":207484757,"user":{"login":"broskoski","id":821469,"avatar_url":"https://avatars.githubusercontent.com/u/821469?v=3","gravatar_id":"","url":"https://api.github.com/users/broskoski","html_url":"https://github.com/broskoski","followers_url":"https://api.github.com/users/broskoski/followers","following_url":"https://api.github.com/users/broskoski/following{/other_user}","gists_url":"https://api.github.com/users/broskoski/gists{/gist_id}","starred_url":"https://api.github.com/users/broskoski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broskoski/subscriptions","organizations_url":"https://api.github.com/users/broskoski/orgs","repos_url":"https://api.github.com/users/broskoski/repos","events_url":"https://api.github.com/users/broskoski/events{/privacy}","received_events_url":"https://api.github.com/users/broskoski/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T15:40:47Z","updated_at":"2016-04-08T15:40:47Z","body":"Ok then, if you both don't mind I'm going to merge and see how well this approach works on Force."}}