{"action":"created","comment":{"url":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/comments/53969256","id":53969256,"diff_hunk":"@@ -347,6 +358,96 @@ if (helper.sequelize.dialect.name === 'postgres') {\n         expect(lastResult.data.user.tasks.pageInfo.hasNextPage).to.equal(false);\n       });\n \n+      it('should support in-query slicing and pagination with first and CUSTOM orderBy', async function () {\n+        const correctOrder = await graphql(this.schema, `\n+          {\n+            user(id: ${this.userA.id}) {\n+              tasks(first: 9, orderBy: CUSTOM) {\n+                edges {\n+                  cursor\n+                  node {\n+                    id\n+                    name\n+                  }\n+                }\n+                pageInfo {\n+                  hasNextPage\n+                  endCursor\n+                }\n+              }\n+            }\n+          }\n+        `);\n+        const reordered = correctOrder.data.user.tasks.edges.map(({node}) => {\n+          const targetId = fromGlobalId(node.id).id;\n+          return this.userA.tasks.find(task => {\n+            return task.id === Number(targetId);\n+          });\n+        });","path":"test/integration/relay/connection.test.js","position":75,"original_position":75,"commit_id":"bf1fd5cc9b1f7138b9c9067659a064c524a40cdf","original_commit_id":"bf1fd5cc9b1f7138b9c9067659a064c524a40cdf","user":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"body":"Should we extend this test to also verify that the order from the custom orderBy is correct?","created_at":"2016-02-24T16:56:39Z","updated_at":"2016-02-24T16:56:39Z","html_url":"https://github.com/mickhansen/graphql-sequelize/pull/165#discussion_r53969256","pull_request_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/comments/53969256"},"html":{"href":"https://github.com/mickhansen/graphql-sequelize/pull/165#discussion_r53969256"},"pull_request":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/165","id":60256957,"html_url":"https://github.com/mickhansen/graphql-sequelize/pull/165","diff_url":"https://github.com/mickhansen/graphql-sequelize/pull/165.diff","patch_url":"https://github.com/mickhansen/graphql-sequelize/pull/165.patch","issue_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/issues/165","number":165,"state":"open","locked":false,"title":"Cursor Reconfigure For Order","user":{"login":"brad-decker","id":4448075,"avatar_url":"https://avatars.githubusercontent.com/u/4448075?v=3","gravatar_id":"","url":"https://api.github.com/users/brad-decker","html_url":"https://github.com/brad-decker","followers_url":"https://api.github.com/users/brad-decker/followers","following_url":"https://api.github.com/users/brad-decker/following{/other_user}","gists_url":"https://api.github.com/users/brad-decker/gists{/gist_id}","starred_url":"https://api.github.com/users/brad-decker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brad-decker/subscriptions","organizations_url":"https://api.github.com/users/brad-decker/orgs","repos_url":"https://api.github.com/users/brad-decker/repos","events_url":"https://api.github.com/users/brad-decker/events{/privacy}","received_events_url":"https://api.github.com/users/brad-decker/received_events","type":"User","site_admin":false},"body":"### Updates\r\n1. Removed the base64 encoding of order attribute from the cursor. Replaced with the index of the item itself.\r\n2. Updated all the logic based on this to provide true pagination regardless of the order by statement.\r\n3. Added a test case in integration/connections for custom queries and made sure all tests pass there.\r\n\r\n### Caveats\r\n1. Need more test cases to make sure nothing can break the pagination. \r\n2. A unit test for $parent failed on simplifyAST but i haven't touched that. \r\nSigned-off-by: brad-decker <bhdecker84@gmail.com>","created_at":"2016-02-22T22:58:45Z","updated_at":"2016-02-24T16:56:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5ac5606a10345b27d7ddad5882d4940d82f5710","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/165/commits","review_comments_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/165/comments","review_comment_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/issues/165/comments","statuses_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/statuses/bf1fd5cc9b1f7138b9c9067659a064c524a40cdf","head":{"label":"ConciergeAuctions:master","ref":"master","sha":"bf1fd5cc9b1f7138b9c9067659a064c524a40cdf","user":{"login":"ConciergeAuctions","id":10405966,"avatar_url":"https://avatars.githubusercontent.com/u/10405966?v=3","gravatar_id":"","url":"https://api.github.com/users/ConciergeAuctions","html_url":"https://github.com/ConciergeAuctions","followers_url":"https://api.github.com/users/ConciergeAuctions/followers","following_url":"https://api.github.com/users/ConciergeAuctions/following{/other_user}","gists_url":"https://api.github.com/users/ConciergeAuctions/gists{/gist_id}","starred_url":"https://api.github.com/users/ConciergeAuctions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ConciergeAuctions/subscriptions","organizations_url":"https://api.github.com/users/ConciergeAuctions/orgs","repos_url":"https://api.github.com/users/ConciergeAuctions/repos","events_url":"https://api.github.com/users/ConciergeAuctions/events{/privacy}","received_events_url":"https://api.github.com/users/ConciergeAuctions/received_events","type":"Organization","site_admin":false},"repo":{"id":42682940,"name":"graphql-sequelize","full_name":"ConciergeAuctions/graphql-sequelize","owner":{"login":"ConciergeAuctions","id":10405966,"avatar_url":"https://avatars.githubusercontent.com/u/10405966?v=3","gravatar_id":"","url":"https://api.github.com/users/ConciergeAuctions","html_url":"https://github.com/ConciergeAuctions","followers_url":"https://api.github.com/users/ConciergeAuctions/followers","following_url":"https://api.github.com/users/ConciergeAuctions/following{/other_user}","gists_url":"https://api.github.com/users/ConciergeAuctions/gists{/gist_id}","starred_url":"https://api.github.com/users/ConciergeAuctions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ConciergeAuctions/subscriptions","organizations_url":"https://api.github.com/users/ConciergeAuctions/orgs","repos_url":"https://api.github.com/users/ConciergeAuctions/repos","events_url":"https://api.github.com/users/ConciergeAuctions/events{/privacy}","received_events_url":"https://api.github.com/users/ConciergeAuctions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ConciergeAuctions/graphql-sequelize","description":"Sequelize helpers for GraphQL","fork":true,"url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize","forks_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/forks","keys_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/teams","hooks_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/hooks","issue_events_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/events","assignees_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/tags","blobs_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/languages","stargazers_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/stargazers","contributors_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/contributors","subscribers_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/subscribers","subscription_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/subscription","commits_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/merges","archive_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/downloads","issues_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/labels{/name}","releases_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/releases{/id}","deployments_url":"https://api.github.com/repos/ConciergeAuctions/graphql-sequelize/deployments","created_at":"2015-09-17T21:28:37Z","updated_at":"2016-02-22T22:11:18Z","pushed_at":"2016-02-23T16:00:11Z","git_url":"git://github.com/ConciergeAuctions/graphql-sequelize.git","ssh_url":"git@github.com:ConciergeAuctions/graphql-sequelize.git","clone_url":"https://github.com/ConciergeAuctions/graphql-sequelize.git","svn_url":"https://github.com/ConciergeAuctions/graphql-sequelize","homepage":"","size":245,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mickhansen:master","ref":"master","sha":"cd1d56399e13de31325a25a851b3ccdcd62f1cde","user":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"repo":{"id":35042996,"name":"graphql-sequelize","full_name":"mickhansen/graphql-sequelize","owner":{"login":"mickhansen","id":699049,"avatar_url":"https://avatars.githubusercontent.com/u/699049?v=3","gravatar_id":"","url":"https://api.github.com/users/mickhansen","html_url":"https://github.com/mickhansen","followers_url":"https://api.github.com/users/mickhansen/followers","following_url":"https://api.github.com/users/mickhansen/following{/other_user}","gists_url":"https://api.github.com/users/mickhansen/gists{/gist_id}","starred_url":"https://api.github.com/users/mickhansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mickhansen/subscriptions","organizations_url":"https://api.github.com/users/mickhansen/orgs","repos_url":"https://api.github.com/users/mickhansen/repos","events_url":"https://api.github.com/users/mickhansen/events{/privacy}","received_events_url":"https://api.github.com/users/mickhansen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mickhansen/graphql-sequelize","description":"GraphQL & Relay for MySQL & Postgres via Sequelize","fork":false,"url":"https://api.github.com/repos/mickhansen/graphql-sequelize","forks_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/forks","keys_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/teams","hooks_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/hooks","issue_events_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/events","assignees_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/tags","blobs_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/languages","stargazers_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/stargazers","contributors_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/contributors","subscribers_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/subscribers","subscription_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/subscription","commits_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/merges","archive_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/downloads","issues_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/labels{/name}","releases_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/releases{/id}","deployments_url":"https://api.github.com/repos/mickhansen/graphql-sequelize/deployments","created_at":"2015-05-04T15:31:41Z","updated_at":"2016-02-24T15:43:20Z","pushed_at":"2016-02-23T16:00:12Z","git_url":"git://github.com/mickhansen/graphql-sequelize.git","ssh_url":"git@github.com:mickhansen/graphql-sequelize.git","clone_url":"https://github.com/mickhansen/graphql-sequelize.git","svn_url":"https://github.com/mickhansen/graphql-sequelize","homepage":"","size":274,"stargazers_count":164,"watchers_count":164,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":39,"forks":19,"open_issues":39,"watchers":164,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/165"},"html":{"href":"https://github.com/mickhansen/graphql-sequelize/pull/165"},"issue":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/issues/165"},"comments":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/mickhansen/graphql-sequelize/statuses/bf1fd5cc9b1f7138b9c9067659a064c524a40cdf"}}}}