{"action":"created","issue":{"url":"https://api.github.com/repos/graphcool/dashboard/issues/295","repository_url":"https://api.github.com/repos/graphcool/dashboard","labels_url":"https://api.github.com/repos/graphcool/dashboard/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/graphcool/dashboard/issues/295/comments","events_url":"https://api.github.com/repos/graphcool/dashboard/issues/295/events","html_url":"https://github.com/graphcool/dashboard/issues/295","id":185311351,"number":295,"title":"Avoid forcing the use of Relay REQUIRED_CHILDREN?","user":{"login":"sedubois","id":4217871,"avatar_url":"https://avatars.githubusercontent.com/u/4217871?v=3","gravatar_id":"","url":"https://api.github.com/users/sedubois","html_url":"https://github.com/sedubois","followers_url":"https://api.github.com/users/sedubois/followers","following_url":"https://api.github.com/users/sedubois/following{/other_user}","gists_url":"https://api.github.com/users/sedubois/gists{/gist_id}","starred_url":"https://api.github.com/users/sedubois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sedubois/subscriptions","organizations_url":"https://api.github.com/users/sedubois/orgs","repos_url":"https://api.github.com/users/sedubois/repos","events_url":"https://api.github.com/users/sedubois/events{/privacy}","received_events_url":"https://api.github.com/users/sedubois/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-26T06:55:57Z","updated_at":"2016-10-26T07:02:54Z","closed_at":null,"body":"I'm trying to get my head around this, my understanding so far is in this [Relay issue](https://github.com/facebook/relay/issues/1430): AFAIK, I have trouble getting my Relay store to update after authentication because I'm forced to use `REQUIRED_CHILDREN` to indicate which data to return, but that doesn't update the store because it's not yet aware of any component consuming that data. In general using `REQUIRED_CHILDREN` seems quite cumbersome, and the [Learn Relay tutorial](https://learnrelay.org/mutations/mutation-types/) says: \"Note that this type is rarely used and is only applicable in very specific use cases.\" It would be great to be able to avoid it.\r\n\r\nIf I understand the problem right (hem), a clean alternative could be to make sure a `user` field always exists on `viewer`, even before authentication (with a `null` value or something), so that it already has a dataID and enables subsequently using `FIELDS_CHANGE` to update it: \"Any field in the payload that can be correlated by DataID with one or more records in the client-side store will be merged with the record(s) in the store.\"\r\n\r\nI could maybe in that case pass this user ID to the `createUser`/`signinUser` mutations and do:\r\n\r\n```\r\ntype: 'FIELDS_CHANGE',\r\nfieldIDs: {\r\n  user: this.props.userId,\r\n},\r\n```"},"comment":{"url":"https://api.github.com/repos/graphcool/dashboard/issues/comments/256265730","html_url":"https://github.com/graphcool/dashboard/issues/295#issuecomment-256265730","issue_url":"https://api.github.com/repos/graphcool/dashboard/issues/295","id":256265730,"user":{"login":"schickling","id":1567498,"avatar_url":"https://avatars.githubusercontent.com/u/1567498?v=3","gravatar_id":"","url":"https://api.github.com/users/schickling","html_url":"https://github.com/schickling","followers_url":"https://api.github.com/users/schickling/followers","following_url":"https://api.github.com/users/schickling/following{/other_user}","gists_url":"https://api.github.com/users/schickling/gists{/gist_id}","starred_url":"https://api.github.com/users/schickling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schickling/subscriptions","organizations_url":"https://api.github.com/users/schickling/orgs","repos_url":"https://api.github.com/users/schickling/repos","events_url":"https://api.github.com/users/schickling/events{/privacy}","received_events_url":"https://api.github.com/users/schickling/received_events","type":"User","site_admin":false},"created_at":"2016-10-26T07:02:54Z","updated_at":"2016-10-26T07:02:54Z","body":"Are you referring to the usage of `REQUIRED_CHILDREN` in [this file](https://github.com/graphcool/dashboard/blob/master/src/mutations/LoginMutation.ts). For general questions about Relay + Graphcool we'd love to answer your questions [on Stackoverflow](http://stackoverflow.com/questions/tagged/graphcool) to keep this repo focussed on the dashboard of Graphcool. "}}
{"actor":{"display_login":"schickling"}}