{"action":"opened","number":34,"pull_request":{"url":"https://api.github.com/repos/duffelhq/paginator/pulls/34","id":228038217,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MDM4MjE3","html_url":"https://github.com/duffelhq/paginator/pull/34","diff_url":"https://github.com/duffelhq/paginator/pull/34.diff","patch_url":"https://github.com/duffelhq/paginator/pull/34.patch","issue_url":"https://api.github.com/repos/duffelhq/paginator/issues/34","number":34,"state":"open","locked":false,"title":"Add ability to have diferent directions per field","user":{"login":"Nickforall","id":4987698,"node_id":"MDQ6VXNlcjQ5ODc2OTg=","avatar_url":"https://avatars1.githubusercontent.com/u/4987698?v=4","gravatar_id":"","url":"https://api.github.com/users/Nickforall","html_url":"https://github.com/Nickforall","followers_url":"https://api.github.com/users/Nickforall/followers","following_url":"https://api.github.com/users/Nickforall/following{/other_user}","gists_url":"https://api.github.com/users/Nickforall/gists{/gist_id}","starred_url":"https://api.github.com/users/Nickforall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nickforall/subscriptions","organizations_url":"https://api.github.com/users/Nickforall/orgs","repos_url":"https://api.github.com/users/Nickforall/repos","events_url":"https://api.github.com/users/Nickforall/events{/privacy}","received_events_url":"https://api.github.com/users/Nickforall/received_events","type":"User","site_admin":false},"body":"Hey there, first of all: thanks for your great library! We have been using it for a while and it works like a charm. \r\n\r\nI built this feature because we have some queries that have fields sorting in both ascending order and descending order. \r\n\r\n### Example use\r\n```elixir\r\n      Notifications.get_all_query(user)\r\n      |> order_by(asc: :is_read, desc: :created_at, desc: :id)\r\n      |> Sketchql.Repo.paginate(\r\n        cursor_fields: [:is_read, :created_at, :id],\r\n        sort_direction: [is_read: :asc, created_at: :desc, id: :desc]\r\n      )\r\n```\r\n\r\n`sort_direction` can still be a single `:asc` or `:desc`\r\n\r\n### Behaviour for queries\r\nIf an `after` cursor field is `:asc`, it will create a where statement in which it compares whether values are less than the cursor field.\r\nIf that cursor field is `:desc` it will compare whether values are greater than the cursor field.\r\n\r\nThe same applies for `before cursors`, but the other way around :)\r\n\r\nI'm happy to make any changes, if you have any suggestions/ideas on how to improve this feature, and am also more than happy to write documentation for this feature as soon as it gets approved.","created_at":"2018-11-02T19:32:12Z","updated_at":"2018-11-02T19:32:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/duffelhq/paginator/pulls/34/commits","review_comments_url":"https://api.github.com/repos/duffelhq/paginator/pulls/34/comments","review_comment_url":"https://api.github.com/repos/duffelhq/paginator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/duffelhq/paginator/issues/34/comments","statuses_url":"https://api.github.com/repos/duffelhq/paginator/statuses/99fefde7d0f527caee056a8527d356acdc3e072d","head":{"label":"Nickforall:feature/cursor-field-directions","ref":"feature/cursor-field-directions","sha":"99fefde7d0f527caee056a8527d356acdc3e072d","user":{"login":"Nickforall","id":4987698,"node_id":"MDQ6VXNlcjQ5ODc2OTg=","avatar_url":"https://avatars1.githubusercontent.com/u/4987698?v=4","gravatar_id":"","url":"https://api.github.com/users/Nickforall","html_url":"https://github.com/Nickforall","followers_url":"https://api.github.com/users/Nickforall/followers","following_url":"https://api.github.com/users/Nickforall/following{/other_user}","gists_url":"https://api.github.com/users/Nickforall/gists{/gist_id}","starred_url":"https://api.github.com/users/Nickforall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nickforall/subscriptions","organizations_url":"https://api.github.com/users/Nickforall/orgs","repos_url":"https://api.github.com/users/Nickforall/repos","events_url":"https://api.github.com/users/Nickforall/events{/privacy}","received_events_url":"https://api.github.com/users/Nickforall/received_events","type":"User","site_admin":false},"repo":{"id":155839625,"node_id":"MDEwOlJlcG9zaXRvcnkxNTU4Mzk2MjU=","name":"paginator","full_name":"Nickforall/paginator","private":false,"owner":{"login":"Nickforall","id":4987698,"node_id":"MDQ6VXNlcjQ5ODc2OTg=","avatar_url":"https://avatars1.githubusercontent.com/u/4987698?v=4","gravatar_id":"","url":"https://api.github.com/users/Nickforall","html_url":"https://github.com/Nickforall","followers_url":"https://api.github.com/users/Nickforall/followers","following_url":"https://api.github.com/users/Nickforall/following{/other_user}","gists_url":"https://api.github.com/users/Nickforall/gists{/gist_id}","starred_url":"https://api.github.com/users/Nickforall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nickforall/subscriptions","organizations_url":"https://api.github.com/users/Nickforall/orgs","repos_url":"https://api.github.com/users/Nickforall/repos","events_url":"https://api.github.com/users/Nickforall/events{/privacy}","received_events_url":"https://api.github.com/users/Nickforall/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Nickforall/paginator","description":"Cursor-based pagination for Elixir Ecto","fork":true,"url":"https://api.github.com/repos/Nickforall/paginator","forks_url":"https://api.github.com/repos/Nickforall/paginator/forks","keys_url":"https://api.github.com/repos/Nickforall/paginator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nickforall/paginator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nickforall/paginator/teams","hooks_url":"https://api.github.com/repos/Nickforall/paginator/hooks","issue_events_url":"https://api.github.com/repos/Nickforall/paginator/issues/events{/number}","events_url":"https://api.github.com/repos/Nickforall/paginator/events","assignees_url":"https://api.github.com/repos/Nickforall/paginator/assignees{/user}","branches_url":"https://api.github.com/repos/Nickforall/paginator/branches{/branch}","tags_url":"https://api.github.com/repos/Nickforall/paginator/tags","blobs_url":"https://api.github.com/repos/Nickforall/paginator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nickforall/paginator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nickforall/paginator/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nickforall/paginator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nickforall/paginator/statuses/{sha}","languages_url":"https://api.github.com/repos/Nickforall/paginator/languages","stargazers_url":"https://api.github.com/repos/Nickforall/paginator/stargazers","contributors_url":"https://api.github.com/repos/Nickforall/paginator/contributors","subscribers_url":"https://api.github.com/repos/Nickforall/paginator/subscribers","subscription_url":"https://api.github.com/repos/Nickforall/paginator/subscription","commits_url":"https://api.github.com/repos/Nickforall/paginator/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nickforall/paginator/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nickforall/paginator/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nickforall/paginator/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nickforall/paginator/contents/{+path}","compare_url":"https://api.github.com/repos/Nickforall/paginator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nickforall/paginator/merges","archive_url":"https://api.github.com/repos/Nickforall/paginator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nickforall/paginator/downloads","issues_url":"https://api.github.com/repos/Nickforall/paginator/issues{/number}","pulls_url":"https://api.github.com/repos/Nickforall/paginator/pulls{/number}","milestones_url":"https://api.github.com/repos/Nickforall/paginator/milestones{/number}","notifications_url":"https://api.github.com/repos/Nickforall/paginator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nickforall/paginator/labels{/name}","releases_url":"https://api.github.com/repos/Nickforall/paginator/releases{/id}","deployments_url":"https://api.github.com/repos/Nickforall/paginator/deployments","created_at":"2018-11-02T08:56:07Z","updated_at":"2018-11-02T08:56:09Z","pushed_at":"2018-11-02T19:22:48Z","git_url":"git://github.com/Nickforall/paginator.git","ssh_url":"git@github.com:Nickforall/paginator.git","clone_url":"https://github.com/Nickforall/paginator.git","svn_url":"https://github.com/Nickforall/paginator","homepage":null,"size":81,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"duffelhq:master","ref":"master","sha":"6a2058fe7a4bbd6cae096619636af35d2426fdf0","user":{"login":"duffelhq","id":33351166,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMzUxMTY2","avatar_url":"https://avatars2.githubusercontent.com/u/33351166?v=4","gravatar_id":"","url":"https://api.github.com/users/duffelhq","html_url":"https://github.com/duffelhq","followers_url":"https://api.github.com/users/duffelhq/followers","following_url":"https://api.github.com/users/duffelhq/following{/other_user}","gists_url":"https://api.github.com/users/duffelhq/gists{/gist_id}","starred_url":"https://api.github.com/users/duffelhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duffelhq/subscriptions","organizations_url":"https://api.github.com/users/duffelhq/orgs","repos_url":"https://api.github.com/users/duffelhq/repos","events_url":"https://api.github.com/users/duffelhq/events{/privacy}","received_events_url":"https://api.github.com/users/duffelhq/received_events","type":"Organization","site_admin":false},"repo":{"id":92597883,"node_id":"MDEwOlJlcG9zaXRvcnk5MjU5Nzg4Mw==","name":"paginator","full_name":"duffelhq/paginator","private":false,"owner":{"login":"duffelhq","id":33351166,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMzUxMTY2","avatar_url":"https://avatars2.githubusercontent.com/u/33351166?v=4","gravatar_id":"","url":"https://api.github.com/users/duffelhq","html_url":"https://github.com/duffelhq","followers_url":"https://api.github.com/users/duffelhq/followers","following_url":"https://api.github.com/users/duffelhq/following{/other_user}","gists_url":"https://api.github.com/users/duffelhq/gists{/gist_id}","starred_url":"https://api.github.com/users/duffelhq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duffelhq/subscriptions","organizations_url":"https://api.github.com/users/duffelhq/orgs","repos_url":"https://api.github.com/users/duffelhq/repos","events_url":"https://api.github.com/users/duffelhq/events{/privacy}","received_events_url":"https://api.github.com/users/duffelhq/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/duffelhq/paginator","description":"Cursor-based pagination for Elixir Ecto","fork":false,"url":"https://api.github.com/repos/duffelhq/paginator","forks_url":"https://api.github.com/repos/duffelhq/paginator/forks","keys_url":"https://api.github.com/repos/duffelhq/paginator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duffelhq/paginator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duffelhq/paginator/teams","hooks_url":"https://api.github.com/repos/duffelhq/paginator/hooks","issue_events_url":"https://api.github.com/repos/duffelhq/paginator/issues/events{/number}","events_url":"https://api.github.com/repos/duffelhq/paginator/events","assignees_url":"https://api.github.com/repos/duffelhq/paginator/assignees{/user}","branches_url":"https://api.github.com/repos/duffelhq/paginator/branches{/branch}","tags_url":"https://api.github.com/repos/duffelhq/paginator/tags","blobs_url":"https://api.github.com/repos/duffelhq/paginator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duffelhq/paginator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duffelhq/paginator/git/refs{/sha}","trees_url":"https://api.github.com/repos/duffelhq/paginator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duffelhq/paginator/statuses/{sha}","languages_url":"https://api.github.com/repos/duffelhq/paginator/languages","stargazers_url":"https://api.github.com/repos/duffelhq/paginator/stargazers","contributors_url":"https://api.github.com/repos/duffelhq/paginator/contributors","subscribers_url":"https://api.github.com/repos/duffelhq/paginator/subscribers","subscription_url":"https://api.github.com/repos/duffelhq/paginator/subscription","commits_url":"https://api.github.com/repos/duffelhq/paginator/commits{/sha}","git_commits_url":"https://api.github.com/repos/duffelhq/paginator/git/commits{/sha}","comments_url":"https://api.github.com/repos/duffelhq/paginator/comments{/number}","issue_comment_url":"https://api.github.com/repos/duffelhq/paginator/issues/comments{/number}","contents_url":"https://api.github.com/repos/duffelhq/paginator/contents/{+path}","compare_url":"https://api.github.com/repos/duffelhq/paginator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duffelhq/paginator/merges","archive_url":"https://api.github.com/repos/duffelhq/paginator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duffelhq/paginator/downloads","issues_url":"https://api.github.com/repos/duffelhq/paginator/issues{/number}","pulls_url":"https://api.github.com/repos/duffelhq/paginator/pulls{/number}","milestones_url":"https://api.github.com/repos/duffelhq/paginator/milestones{/number}","notifications_url":"https://api.github.com/repos/duffelhq/paginator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duffelhq/paginator/labels{/name}","releases_url":"https://api.github.com/repos/duffelhq/paginator/releases{/id}","deployments_url":"https://api.github.com/repos/duffelhq/paginator/deployments","created_at":"2017-05-27T12:39:32Z","updated_at":"2018-10-31T21:54:57Z","pushed_at":"2018-10-31T21:56:50Z","git_url":"git://github.com/duffelhq/paginator.git","ssh_url":"git@github.com:duffelhq/paginator.git","clone_url":"https://github.com/duffelhq/paginator.git","svn_url":"https://github.com/duffelhq/paginator","homepage":null,"size":78,"stargazers_count":98,"watchers_count":98,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":14,"open_issues":2,"watchers":98,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/duffelhq/paginator/pulls/34"},"html":{"href":"https://github.com/duffelhq/paginator/pull/34"},"issue":{"href":"https://api.github.com/repos/duffelhq/paginator/issues/34"},"comments":{"href":"https://api.github.com/repos/duffelhq/paginator/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/duffelhq/paginator/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/duffelhq/paginator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/duffelhq/paginator/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/duffelhq/paginator/statuses/99fefde7d0f527caee056a8527d356acdc3e072d"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":4,"additions":210,"deletions":14,"changed_files":3}}
{"actor":{"display_login":"Nickforall"}}