{"action":"created","issue":{"url":"https://api.github.com/repos/artsy/exchange/issues/136","repository_url":"https://api.github.com/repos/artsy/exchange","labels_url":"https://api.github.com/repos/artsy/exchange/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/artsy/exchange/issues/136/comments","events_url":"https://api.github.com/repos/artsy/exchange/issues/136/events","html_url":"https://github.com/artsy/exchange/pull/136","id":355187382,"node_id":"MDExOlB1bGxSZXF1ZXN0MjExNzczNzkz","number":136,"title":"Add support for totalCount on orders","user":{"login":"ashkan18","id":1230819,"node_id":"MDQ6VXNlcjEyMzA4MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/1230819?v=4","gravatar_id":"","url":"https://api.github.com/users/ashkan18","html_url":"https://github.com/ashkan18","followers_url":"https://api.github.com/users/ashkan18/followers","following_url":"https://api.github.com/users/ashkan18/following{/other_user}","gists_url":"https://api.github.com/users/ashkan18/gists{/gist_id}","starred_url":"https://api.github.com/users/ashkan18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashkan18/subscriptions","organizations_url":"https://api.github.com/users/ashkan18/orgs","repos_url":"https://api.github.com/users/ashkan18/repos","events_url":"https://api.github.com/users/ashkan18/events{/privacy}","received_events_url":"https://api.github.com/users/ashkan18/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"orta","id":49038,"node_id":"MDQ6VXNlcjQ5MDM4","avatar_url":"https://avatars2.githubusercontent.com/u/49038?v=4","gravatar_id":"","url":"https://api.github.com/users/orta","html_url":"https://github.com/orta","followers_url":"https://api.github.com/users/orta/followers","following_url":"https://api.github.com/users/orta/following{/other_user}","gists_url":"https://api.github.com/users/orta/gists{/gist_id}","starred_url":"https://api.github.com/users/orta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orta/subscriptions","organizations_url":"https://api.github.com/users/orta/orgs","repos_url":"https://api.github.com/users/orta/repos","events_url":"https://api.github.com/users/orta/events{/privacy}","received_events_url":"https://api.github.com/users/orta/received_events","type":"User","site_admin":false},"assignees":[{"login":"orta","id":49038,"node_id":"MDQ6VXNlcjQ5MDM4","avatar_url":"https://avatars2.githubusercontent.com/u/49038?v=4","gravatar_id":"","url":"https://api.github.com/users/orta","html_url":"https://github.com/orta","followers_url":"https://api.github.com/users/orta/followers","following_url":"https://api.github.com/users/orta/following{/other_user}","gists_url":"https://api.github.com/users/orta/gists{/gist_id}","starred_url":"https://api.github.com/users/orta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orta/subscriptions","organizations_url":"https://api.github.com/users/orta/orgs","repos_url":"https://api.github.com/users/orta/repos","events_url":"https://api.github.com/users/orta/events{/privacy}","received_events_url":"https://api.github.com/users/orta/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-08-29T14:27:05Z","updated_at":"2018-08-29T14:27:32Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/artsy/exchange/pulls/136","html_url":"https://github.com/artsy/exchange/pull/136","diff_url":"https://github.com/artsy/exchange/pull/136.diff","patch_url":"https://github.com/artsy/exchange/pull/136.patch"},"body":"# Problem\r\nhttps://artsyproduct.atlassian.net/browse/PLATFORM-835\r\nFrom clients we sometimes want to show just the total count of specific query.\r\n\r\n# Solution\r\nAdded a custom connection type for our `Order` model which defines `total_count` field and used it in returning `orders` query. You can ask for `totalCounts` now on the same level as edges.\r\n```graphql\r\nquery($sellerId: String, $buyerId: String, $state: OrderStateEnum, $sort: OrderConnectionSortEnum) {\r\n            orders(sellerId: $sellerId, buyerId: $buyerId, state: $state, sort: $sort, first: 2) {\r\n              totalCount\r\n              edges {\r\n                node {\r\n                  id\r\n                }\r\n              }\r\n            }\r\n          }\r\n```\r\nIn sample ☝️ we'll only get first 2 orders (note `first: 2` in the query)back but we'll get total count of all orders."},"comment":{"url":"https://api.github.com/repos/artsy/exchange/issues/comments/416973844","html_url":"https://github.com/artsy/exchange/pull/136#issuecomment-416973844","issue_url":"https://api.github.com/repos/artsy/exchange/issues/136","id":416973844,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjk3Mzg0NA==","user":{"login":"peril-staging[bot]","id":34651588,"node_id":"MDM6Qm90MzQ2NTE1ODg=","avatar_url":"https://avatars3.githubusercontent.com/u/17147106?v=4","gravatar_id":"","url":"https://api.github.com/users/peril-staging%5Bbot%5D","html_url":"https://github.com/apps/peril-staging","followers_url":"https://api.github.com/users/peril-staging%5Bbot%5D/followers","following_url":"https://api.github.com/users/peril-staging%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/peril-staging%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/peril-staging%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peril-staging%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/peril-staging%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/peril-staging%5Bbot%5D/repos","events_url":"https://api.github.com/users/peril-staging%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/peril-staging%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-08-29T14:27:32Z","updated_at":"2018-08-29T14:27:32Z","author_association":"CONTRIBUTOR","body":"\n<!--\n  0 failure: \n  0 warning: \n  \n  1 markdown notices\n  DangerID: danger-id-peril;\n-->\n\n\n\nDanger run resulted in 1 warning; to find out more, see the [checks page](https://github.com/artsy/exchange/runs/14597349).\n<p align=\"right\">\n  Generated by :no_entry_sign: <a href=\"http://github.com/danger/danger-js/\">dangerJS</a>\n</p>\n"}}
{"actor":{"display_login":"peril-staging"}}