{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/relay/issues/381","labels_url":"https://api.github.com/repos/facebook/relay/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/facebook/relay/issues/381/comments","events_url":"https://api.github.com/repos/facebook/relay/issues/381/events","html_url":"https://github.com/facebook/relay/issues/381","id":108071398,"number":381,"title":"pageInfo does not get pulled in when edges are only included via fragment","user":{"login":"taion","id":3112159,"avatar_url":"https://avatars.githubusercontent.com/u/3112159?v=3","gravatar_id":"","url":"https://api.github.com/users/taion","html_url":"https://github.com/taion","followers_url":"https://api.github.com/users/taion/followers","following_url":"https://api.github.com/users/taion/following{/other_user}","gists_url":"https://api.github.com/users/taion/gists{/gist_id}","starred_url":"https://api.github.com/users/taion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taion/subscriptions","organizations_url":"https://api.github.com/users/taion/orgs","repos_url":"https://api.github.com/users/taion/repos","events_url":"https://api.github.com/users/taion/events{/privacy}","received_events_url":"https://api.github.com/users/taion/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/relay/labels/good%20first%20bug","name":"good first bug","color":"006b75"},{"url":"https://api.github.com/repos/facebook/relay/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-24T06:59:51Z","updated_at":"2015-09-29T01:53:32Z","closed_at":"2015-09-29T01:53:32Z","body":"This looks like a bug in babel-relay-plugin. The logic here: https://github.com/facebook/relay/blob/615787490db3bd62b15e8bf22d9c46b2d59bbf73/scripts/babel-relay-plugin/src/GraphQLPrinter.js#L503 for pulling in `pageInfo` on connections doesn't seem to work when the connection `edges` are only pulled in via a fragment.\r\n\r\nFor example, in the current (non-routing) TodoMVC example, if you remove these lines: https://github.com/facebook/relay/blob/58e45dbb9fd08215884597171ce072551f344c06/examples/todo/js/components/TodoApp.js#L64-L68 (the data fetched there isn't actually used by the `TodoApp` component at all, so naively that part of the GraphQL query seems vestigial), you can see that the GraphQL query sent to the server does not request `pageInfo`, and correspondingly does not request `hasNextPage` or `hasPreviousPage`, and consequently, Relay assumes that those fields are false, and pagination doesn't work (or wouldn't work, in more elaborate cases that involve pagination)."}}