{"action":"created","issue":{"url":"https://api.github.com/repos/apollographql/reason-apollo/issues/34","repository_url":"https://api.github.com/repos/apollographql/reason-apollo","labels_url":"https://api.github.com/repos/apollographql/reason-apollo/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/apollographql/reason-apollo/issues/34/comments","events_url":"https://api.github.com/repos/apollographql/reason-apollo/issues/34/events","html_url":"https://github.com/apollographql/reason-apollo/issues/34","id":295291074,"number":34,"title":"ReasonApolloQuery willRecieveProps will not fire a sendQuery","user":{"login":"Hehk","id":7075897,"avatar_url":"https://avatars2.githubusercontent.com/u/7075897?v=4","gravatar_id":"","url":"https://api.github.com/users/Hehk","html_url":"https://github.com/Hehk","followers_url":"https://api.github.com/users/Hehk/followers","following_url":"https://api.github.com/users/Hehk/following{/other_user}","gists_url":"https://api.github.com/users/Hehk/gists{/gist_id}","starred_url":"https://api.github.com/users/Hehk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hehk/subscriptions","organizations_url":"https://api.github.com/users/Hehk/orgs","repos_url":"https://api.github.com/users/Hehk/repos","events_url":"https://api.github.com/users/Hehk/events{/privacy}","received_events_url":"https://api.github.com/users/Hehk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-07T21:00:42Z","updated_at":"2018-02-18T19:28:11Z","closed_at":"2018-02-17T00:17:41Z","author_association":"NONE","body":"I am trying to update my render whenever the user changes a filter term. \r\n```re\r\nlet make = (~filter=\"\", _children) => {\r\n  ...component,\r\n  render: _self => {\r\n    let snippetQuery = SnippetQuery.make(~filter, ());\r\n    <PageFrame>\r\n      <Query query=snippetQuery>\r\n```\r\n\r\nThe Query element re-renders on change but the graphql response does not. I believe this issue is caused by:\r\n```re\r\nwillReceiveProps: ({state, reduce}) => {\r\n  if(!shallowEqual(asJsObject(q##variables), asJsObject(state.variables))) {\r\n    sendQuery(~query=q, ~reduce);\r\n    state;\r\n  } else {\r\n    state;\r\n  }\r\n},\r\n```\r\nThe sendQuery will never fire from a change in variables, the comparison on JavaScript objects does not appear to work in the way intended for this if block.\r\n\r\nFor example, If you run this in https://reasonml.github.io/en/try.html the output will be false no matter what the input objects are.\r\n```re\r\ntype variables = {. \"filter\": string};\r\nlet x = {\"filter\": \"test\"};\r\nlet y = {\"filter\": \"\"};\r\n\r\nJs.log(x != y);\r\n```\r\n\r\nHopefully I am just using the system wrong but, if not, I am willing to make a PR to fix this issue.\r\n"},"comment":{"url":"https://api.github.com/repos/apollographql/reason-apollo/issues/comments/366540626","html_url":"https://github.com/apollographql/reason-apollo/issues/34#issuecomment-366540626","issue_url":"https://api.github.com/repos/apollographql/reason-apollo/issues/34","id":366540626,"user":{"login":"Hehk","id":7075897,"avatar_url":"https://avatars2.githubusercontent.com/u/7075897?v=4","gravatar_id":"","url":"https://api.github.com/users/Hehk","html_url":"https://github.com/Hehk","followers_url":"https://api.github.com/users/Hehk/followers","following_url":"https://api.github.com/users/Hehk/following{/other_user}","gists_url":"https://api.github.com/users/Hehk/gists{/gist_id}","starred_url":"https://api.github.com/users/Hehk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hehk/subscriptions","organizations_url":"https://api.github.com/users/Hehk/orgs","repos_url":"https://api.github.com/users/Hehk/repos","events_url":"https://api.github.com/users/Hehk/events{/privacy}","received_events_url":"https://api.github.com/users/Hehk/received_events","type":"User","site_admin":false},"created_at":"2018-02-18T19:28:11Z","updated_at":"2018-02-18T19:28:11Z","author_association":"NONE","body":"Yeah. It was fixed in the change in: https://github.com/apollographql/reason-apollo/commit/badba88241b40f99950ec1e66695237bfc06afb0 "}}
{"actor":{"display_login":"Hehk"}}