{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/relay/issues/232","repository_url":"https://api.github.com/repos/facebook/relay","labels_url":"https://api.github.com/repos/facebook/relay/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/facebook/relay/issues/232/comments","events_url":"https://api.github.com/repos/facebook/relay/issues/232/events","html_url":"https://github.com/facebook/relay/issues/232","id":104712581,"number":232,"title":"Validate the shape of mutation configs","user":{"login":"sgwilym","id":579491,"avatar_url":"https://avatars.githubusercontent.com/u/579491?v=3","gravatar_id":"","url":"https://api.github.com/users/sgwilym","html_url":"https://github.com/sgwilym","followers_url":"https://api.github.com/users/sgwilym/followers","following_url":"https://api.github.com/users/sgwilym/following{/other_user}","gists_url":"https://api.github.com/users/sgwilym/gists{/gist_id}","starred_url":"https://api.github.com/users/sgwilym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgwilym/subscriptions","organizations_url":"https://api.github.com/users/sgwilym/orgs","repos_url":"https://api.github.com/users/sgwilym/repos","events_url":"https://api.github.com/users/sgwilym/events{/privacy}","received_events_url":"https://api.github.com/users/sgwilym/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/relay/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/facebook/relay/labels/mutations","name":"mutations","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2015-09-03T14:46:18Z","updated_at":"2016-09-03T00:10:05Z","closed_at":"2016-09-03T00:10:05Z","body":"This has happened to me a couple times now — a mutation will silently fail if a key in a config is spelled incorrectly.\r\n\r\nThis works: \r\n```\r\n  getConfigs() {\r\n    return [{\r\n      type: 'FIELDS_CHANGE',\r\n      fieldIDs: { updatedThing: this.props.thing.id }\r\n    }]\r\n  }\r\n```\r\n\r\nBut this will just silently cause half of the mutation query to go missing:\r\n```\r\n  getConfigs() {\r\n    return [{\r\n      type: 'FIELDS_CHANGE',\r\n      fieldIDS: { updatedThing: this.props.thing.id }\r\n    }]\r\n  }\r\n```\r\n\r\nSame thing goes for the very British mistake of specifying `rangeBehaviours` instead of `rangeBehaviors` — a truly insidious problem!"},"comment":{"url":"https://api.github.com/repos/facebook/relay/issues/comments/244513739","html_url":"https://github.com/facebook/relay/issues/232#issuecomment-244513739","issue_url":"https://api.github.com/repos/facebook/relay/issues/232","id":244513739,"user":{"login":"wincent","id":7074,"avatar_url":"https://avatars.githubusercontent.com/u/7074?v=3","gravatar_id":"","url":"https://api.github.com/users/wincent","html_url":"https://github.com/wincent","followers_url":"https://api.github.com/users/wincent/followers","following_url":"https://api.github.com/users/wincent/following{/other_user}","gists_url":"https://api.github.com/users/wincent/gists{/gist_id}","starred_url":"https://api.github.com/users/wincent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wincent/subscriptions","organizations_url":"https://api.github.com/users/wincent/orgs","repos_url":"https://api.github.com/users/wincent/repos","events_url":"https://api.github.com/users/wincent/events{/privacy}","received_events_url":"https://api.github.com/users/wincent/received_events","type":"User","site_admin":false},"created_at":"2016-09-03T00:10:05Z","updated_at":"2016-09-03T00:10:05Z","body":"Closing this thread as it is pretty stale. We added a bunch of validation for mutation configs in [v0.8.0](https://github.com/facebook/relay/releases/tag/v0.8.0), and mutation configs as such are going away entirely in [Relay 2](https://speakerdeck.com/wincent/relay-2-simpler-faster-more-predictable), being replaced by a new API.\r\n\r\nThanks to @sgwilym and @jkettmann for chiming in."}}
{"actor":{"display_login":"wincent"}}