{"action":"created","issue":{"url":"https://api.github.com/repos/apollostack/apollo-client/issues/961","repository_url":"https://api.github.com/repos/apollostack/apollo-client","labels_url":"https://api.github.com/repos/apollostack/apollo-client/issues/961/labels{/name}","comments_url":"https://api.github.com/repos/apollostack/apollo-client/issues/961/comments","events_url":"https://api.github.com/repos/apollostack/apollo-client/issues/961/events","html_url":"https://github.com/apollostack/apollo-client/issues/961","id":191726829,"number":961,"title":"Forcing returnPartialData in fragmentMatcher is causing inconsistent behaviour","user":{"login":"msimulcik","id":6518872,"avatar_url":"https://avatars.githubusercontent.com/u/6518872?v=3","gravatar_id":"","url":"https://api.github.com/users/msimulcik","html_url":"https://github.com/msimulcik","followers_url":"https://api.github.com/users/msimulcik/followers","following_url":"https://api.github.com/users/msimulcik/following{/other_user}","gists_url":"https://api.github.com/users/msimulcik/gists{/gist_id}","starred_url":"https://api.github.com/users/msimulcik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msimulcik/subscriptions","organizations_url":"https://api.github.com/users/msimulcik/orgs","repos_url":"https://api.github.com/users/msimulcik/repos","events_url":"https://api.github.com/users/msimulcik/events{/privacy}","received_events_url":"https://api.github.com/users/msimulcik/received_events","type":"User","site_admin":false},"labels":[{"id":332593317,"url":"https://api.github.com/repos/apollostack/apollo-client/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-11-25T15:41:41Z","updated_at":"2016-12-21T04:54:07Z","closed_at":null,"body":"1. I have observable query that is being refetched due to variables changes. It contains union type which is causing that returnPartialData is forced to true in fragmentMatcher ([here](https://github.com/apollostack/apollo-client/blob/5ffe05d75a02aa976d3bc873f83b5c3416b406e0/src/data/readFromStore.ts#L131))\r\n2. Later in readStoreResolver ([here](https://github.com/apollostack/apollo-client/blob/5ffe05d75a02aa976d3bc873f83b5c3416b406e0/src/data/readFromStore.ts#L163)), throwing of error is skipped even if some data is missing\r\n3. As a consequence, getCurrentQueryResult ([here](https://github.com/apollostack/apollo-client/blob/f7c2d95c6ee7f62b2cba79da8c4fedf87d43adef/src/core/QueryManager.ts#L745)) ends up returning `partial: false` which is obviously inconsistent.\r\n4. Therefore also loading state calculation is wrong in currentResult ([here](https://github.com/apollostack/apollo-client/blob/1196777131838e90530e00820d7060360298f7fc/src/core/ObservableQuery.ts#L135))\r\n5. Finally in react, instead of displaying loader, it fails to render results due to missing data. This is why I started to investigate.\r\n"},"comment":{"url":"https://api.github.com/repos/apollostack/apollo-client/issues/comments/268435234","html_url":"https://github.com/apollostack/apollo-client/issues/961#issuecomment-268435234","issue_url":"https://api.github.com/repos/apollostack/apollo-client/issues/961","id":268435234,"user":{"login":"tmeasday","id":132554,"avatar_url":"https://avatars.githubusercontent.com/u/132554?v=3","gravatar_id":"","url":"https://api.github.com/users/tmeasday","html_url":"https://github.com/tmeasday","followers_url":"https://api.github.com/users/tmeasday/followers","following_url":"https://api.github.com/users/tmeasday/following{/other_user}","gists_url":"https://api.github.com/users/tmeasday/gists{/gist_id}","starred_url":"https://api.github.com/users/tmeasday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmeasday/subscriptions","organizations_url":"https://api.github.com/users/tmeasday/orgs","repos_url":"https://api.github.com/users/tmeasday/repos","events_url":"https://api.github.com/users/tmeasday/events{/privacy}","received_events_url":"https://api.github.com/users/tmeasday/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T04:54:07Z","updated_at":"2016-12-21T04:54:07Z","body":"I think the simplest unit test to add would be one that highlights that the API contract \r\n\r\n> `readQueryFromStore({ ..., returnPartialData: false })` throws an exception if incomplete data is is in the store\r\n\r\nis actually incorrect in the case of union fragments. "}}
{"actor":{"display_login":"tmeasday"}}