{"action":"closed","issue":{"url":"https://api.github.com/repos/vslinko/ripster/issues/14","labels_url":"https://api.github.com/repos/vslinko/ripster/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/vslinko/ripster/issues/14/comments","events_url":"https://api.github.com/repos/vslinko/ripster/issues/14/events","html_url":"https://github.com/vslinko/ripster/issues/14","id":108734512,"number":14,"title":"technical details #2","user":{"login":"bsr203","id":1966521,"avatar_url":"https://avatars.githubusercontent.com/u/1966521?v=3","gravatar_id":"","url":"https://api.github.com/users/bsr203","html_url":"https://github.com/bsr203","followers_url":"https://api.github.com/users/bsr203/followers","following_url":"https://api.github.com/users/bsr203/following{/other_user}","gists_url":"https://api.github.com/users/bsr203/gists{/gist_id}","starred_url":"https://api.github.com/users/bsr203/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsr203/subscriptions","organizations_url":"https://api.github.com/users/bsr203/orgs","repos_url":"https://api.github.com/users/bsr203/repos","events_url":"https://api.github.com/users/bsr203/events{/privacy}","received_events_url":"https://api.github.com/users/bsr203/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-28T19:55:49Z","updated_at":"2015-10-02T00:31:11Z","closed_at":"2015-10-02T00:31:10Z","body":"Hi,\r\n\r\ncouple of qns.\r\n\r\n1. frontend: What does the decorator `childrenToProps` do? I see it copy all children as pass it as props, but why?\r\n\r\n2. graphql : schema/index.js\r\n```\r\nconst refCreators = {\r\n  rootQuery,\r\n  rootMutation,\r\n  ...types,\r\n};\r\n\r\nconst {nodeInterface, nodeField} = nodeDefinitions(\r\n  (globalId, {rootValue}) => {\r\n    const {type, id} = fromGlobalId(globalId);\r\n\r\n    return rootValue.loaders[type].load(id);\r\n  },\r\n  (object) => {\r\n    const label = object.labels[0];\r\n    const refKey = label[0].toLowerCase() + label.slice(1);\r\n\r\n    return refs[refKey]; // eslint-disable-line no-use-before-define\r\n  }\r\n);\r\n\r\nconst refs = Object.keys(refCreators)\r\n  .reduce((acc, key) => (\r\n    acc[key] = refCreators[key](acc),\r\n    acc[key + 'Connection'] = connectionDefinitions({\r\n      name: acc[key].name,\r\n      nodeType: acc[key],\r\n    }).connectionType,\r\n    acc\r\n  ), {nodeInterface, nodeField});\r\n```\r\n\r\ni)  `const label = object.labels[0];` where are this `labels` set? \r\nii) can you please explain the `reduce` function. I could see that you are adding `connection` automatically to all the rootQuery, rootMutation and types. why do we need to add connection to all, but not just to query types. I am totally confused as why the reduce is not in the form\r\n\r\nreduce((a, b) => a + b)\r\nreduce((a, b) =>  { ..., return a + b})\r\n\r\n```\r\n  .reduce((acc, key) => (     //-- is this a function (no curley !!) or a tuple ??\r\n    acc[key] = refCreators[key](acc),\r\n    acc[key + 'Connection'] = connectionDefinitions({\r\n      name: acc[key].name,\r\n      nodeType: acc[key],\r\n    }).connectionType,\r\n    acc\r\n  ), {nodeInterface, nodeField});  //--> initial value, so include them too..\r\n\r\n```\r\n\r\n3.) How do you plan to use redux along with relay. IS redux is for local state only or you think it is better to keep a copy of all state changes for debugging etc.\r\n\r\nsorry, I am new to frontend development and JS.\r\n\r\nthanks again :-)"}}