private GetPullRequestsOfRepositoryQueryResponse ParseGetPullRequestsOfRepositoryQueryResponse(JsonTextReader reader)
        {
            var response = new GetPullRequestsOfRepositoryQueryResponse();

            JsonSerializer serializer      = new JsonSerializer();
            var            rawPullRequests = serializer.Deserialize <JObject>(reader);

            try
            {
                response.Cursor      = rawPullRequests["data"]["repository"]["pullRequests"]["pageInfo"]["endCursor"].Value <string>();
                response.HasNextPage = rawPullRequests["data"]["repository"]["pullRequests"]["pageInfo"]["hasNextPage"].Value <bool>();

                var edges = rawPullRequests["data"]["repository"]["pullRequests"]["edges"];

                var rawPullRequest = edges.First;

                while (rawPullRequest != null)
                {
                    ParseRecord(response, rawPullRequest);
                    rawPullRequest = rawPullRequest.Next;
                }
            }
            catch (Exception e)
            {
                throw;
            }

            return(response);
        }
        private static void ParseRecord(GetPullRequestsOfRepositoryQueryResponse response, JToken rawPullRequest)
        {
            try
            {
                var pullRequest = new PullRequestInfo();
                pullRequest.Number = rawPullRequest["node"].Value <int>("number");
                pullRequest.TotalPullRequestFiles = rawPullRequest["node"]["files"]["totalCount"].Value <int>();
                pullRequest.SubmitterLogin        = rawPullRequest["node"]["author"].HasValues ? rawPullRequest["node"]["author"]["login"].ToString() : null;
                pullRequest.MergedDateTime        = rawPullRequest["node"].Value <DateTime?>("mergedAt");
                pullRequest.MergeCommitSha        = rawPullRequest["node"]["mergeCommit"].HasValues ? rawPullRequest["node"]["mergeCommit"]["oid"].ToString() : null;

                pullRequest.PullRequestReviewers = rawPullRequest["node"]["reviews"]["nodes"].Children().Select(c => new PullRequestReviewer()
                {
                    Login = c["author"].HasValues ? c["author"]["login"].Value <string>() : null,
                }).Distinct().ToArray();

                pullRequest.PullRequestFiles = rawPullRequest["node"]["files"]["nodes"].Children().Select(c => new PullRequestFile()
                {
                    Path      = c.Value <string>("path"),
                    Additions = c.Value <int>("additions"),
                    Deletions = c.Value <int>("deletions"),
                }).ToArray();

                response.AddPullRequestInfo(pullRequest);
                rawPullRequest = rawPullRequest.Next;
            }
            catch (Exception e)
            {
                // TODO
            }
        }