{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/relay/issues/618","labels_url":"https://api.github.com/repos/facebook/relay/issues/618/labels{/name}","comments_url":"https://api.github.com/repos/facebook/relay/issues/618/comments","events_url":"https://api.github.com/repos/facebook/relay/issues/618/events","html_url":"https://github.com/facebook/relay/issues/618","id":118056577,"number":618,"title":"getOptimisticResponse does not seem to populate `__typename`","user":{"login":"Globegitter","id":2580254,"avatar_url":"https://avatars.githubusercontent.com/u/2580254?v=3","gravatar_id":"","url":"https://api.github.com/users/Globegitter","html_url":"https://github.com/Globegitter","followers_url":"https://api.github.com/users/Globegitter/followers","following_url":"https://api.github.com/users/Globegitter/following{/other_user}","gists_url":"https://api.github.com/users/Globegitter/gists{/gist_id}","starred_url":"https://api.github.com/users/Globegitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Globegitter/subscriptions","organizations_url":"https://api.github.com/users/Globegitter/orgs","repos_url":"https://api.github.com/users/Globegitter/repos","events_url":"https://api.github.com/users/Globegitter/events{/privacy}","received_events_url":"https://api.github.com/users/Globegitter/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-20T14:51:48Z","updated_at":"2015-11-23T17:59:44Z","closed_at":"2015-11-23T17:59:44Z","body":"I have a mutation which returns an optimistic response as follows:\r\n\r\n```js\r\n getOptimisticResponse() {\r\n    const {dateOfBirth, otherField, otherOtherField} = this.props;\r\n    return {\r\n      customer: {\r\n        dateOfBirth,\r\n        otherField,\r\n        otherOtherField\r\n      }\r\n    };\r\n  }\r\n```\r\n\r\nWhich leads to: `'RelayQueryWriter: Could not find a type name for record `%s`.',` here: 'RelayQueryWriter: Could not find a type name for record `%s`.',\r\n\r\nWhen debugging I can see that the passed-in payload does not have a `__typename`. If I set it manually to `Customer` in the `getOptimisticResponse` the warning disappears.\r\n\r\nI am using a version from master with the commit id `090b2b1c1228fb3337d8af68648b34150da682e6`, so from about 2 days ago,"}}