public async Task <(string login, string name, Uri avatarUri)> GetCurrentUserInfo(CancellationToken cancellationToken)
        {
            var token = await _gitHubUserService.GetGitHubToken().ConfigureAwait(false);

            var data = await ExecuteGraphQLRequest(() => _githubApiClient.ViewerLoginQuery(new ViewerLoginQueryContent(), GetGitHubBearerTokenHeader(token)), cancellationToken).ConfigureAwait(false);

            return(data.Viewer.Alias, data.Viewer.Name, data.Viewer.AvatarUri);
        }
Esempio n. 2
0
 public Task <ApiResponse <GraphQLResponse <GitHubViewerLoginResponse> > > ViewerLoginQuery(string token, CancellationToken cancellationToken) =>
 AttemptAndRetry_Functions(() => _gitHubGraphQLClient.ViewerLoginQuery(new ViewerLoginQueryContent(), $"Bearer {token}"), cancellationToken);