Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit a57418b

Browse files
Removing the GraphQL Library because it's unused
1 parent ba38b91 commit a57418b

11 files changed

+0
-111
lines changed

src/BCC.Web/BCC.Web.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
<PackageReference Include="morelinq" Version="3.0.0" />
2727
<PackageReference Include="Nito.AsyncEx" Version="5.0.0-pre-05" />
2828
<PackageReference Include="Octokit" Version="0.32.0" />
29-
<PackageReference Include="Octokit.GraphQL" Version="0.1.2-beta" />
3029
<PackageReference Include="Swashbuckle.AspNetCore" Version="3.0.0" />
3130
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="3.0.0" />
3231
<PackageReference Include="System.IO.Abstractions" Version="2.1.0.256" />

src/BCC.Web/Interfaces/GitHub/IGitHubAppClientFactory.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,11 @@ public interface IGitHubAppClientFactory
1616
/// <returns>A client</returns>
1717
Task<IGitHubClient> CreateAppClientForLoginAsync(ITokenGenerator tokenGenerator, string login);
1818

19-
/// <summary>
20-
/// Create a IGitHubGraphQLClient configured for GitHub App Installation Authentication.
21-
/// </summary>
22-
/// <param name="tokenGenerator">A token generator configured for the GitHub App.</param>
23-
/// <param name="login">The login to authenticate.</param>
24-
/// <returns>A graphql client</returns>
25-
Task<IGitHubGraphQLClient> CreateAppGraphQLClientForLoginAsync(ITokenGenerator tokenGenerator, string login);
26-
2719
/// <summary>
2820
/// Create a IGitHubClient configured for GitHub App Authentication.
2921
/// </summary>
3022
/// <param name="tokenGenerator">A token generator configured for the GitHub App.</param>
3123
/// <returns>A client</returns>
3224
IGitHubClient CreateAppClient(ITokenGenerator tokenGenerator);
33-
34-
/// <summary>
35-
/// Create a IGitHubGraphQLClient configured for GitHub App Authentication.
36-
/// </summary>
37-
/// <param name="tokenGenerator">A token generator configured for the GitHub App.</param>
38-
/// <returns>A graphql client</returns>
39-
IGitHubGraphQLClient CreateAppGraphQLClient(ITokenGenerator tokenGenerator);
4025
}
4126
}

src/BCC.Web/Interfaces/GitHub/IGitHubClientFactory.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,5 @@ public interface IGitHubClientFactory
1313
/// <param name="token">The token.</param>
1414
/// <returns>A client</returns>
1515
IGitHubClient CreateClient(string token);
16-
17-
/// <summary>
18-
/// Create a IGitHubGraphQLClient configured with a token for Authentication.
19-
/// </summary>
20-
/// <param name="token">The token.</param>
21-
/// <returns>A graphql client</returns>
22-
IGitHubGraphQLClient CreateGraphQLClient(string token);
2316
}
2417
}

src/BCC.Web/Interfaces/GitHub/IGitHubGraphQLClient.cs

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/BCC.Web/Interfaces/GitHub/IGitHubUserClientFactory.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,5 @@ public interface IGitHubUserClientFactory
1313
/// </summary>
1414
/// <returns>A client</returns>
1515
Task<IGitHubClient> CreateClient();
16-
17-
/// <summary>
18-
/// Create a IGitHubGraphQLClient configured for GitHub App User-To-Server Authentication.
19-
/// </summary>
20-
/// <returns>A graphql client</returns>
21-
Task<IGitHubGraphQLClient> CreateGraphQLClient();
2216
}
2317
}

src/BCC.Web/Services/GitHub/GitHubAppClientFactory.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Threading.Tasks;
44
using Octokit;
55
using IGitHubAppClientFactory = BCC.Web.Interfaces.GitHub.IGitHubAppClientFactory;
6-
using IGitHubGraphQLClient = BCC.Web.Interfaces.GitHub.IGitHubGraphQLClient;
76
using ITokenGenerator = BCC.Web.Interfaces.GitHub.ITokenGenerator;
87

98
namespace BCC.Web.Services.GitHub
@@ -29,20 +28,6 @@ public IGitHubClient CreateAppClient(ITokenGenerator tokenGenerator)
2928
};
3029
}
3130

32-
/// <inheritdoc />
33-
public IGitHubGraphQLClient CreateAppGraphQLClient(ITokenGenerator tokenGenerator)
34-
{
35-
var token = tokenGenerator.GetToken();
36-
return GitHubClientFactoryHelper.GraphQLClient(token, GitHubClientFactory.UserAgent);
37-
}
38-
39-
/// <inheritdoc />
40-
public async Task<IGitHubGraphQLClient> CreateAppGraphQLClientForLoginAsync(ITokenGenerator tokenGenerator, string login)
41-
{
42-
var (installation, token) = await FindInstallationAndGetToken(tokenGenerator, login);
43-
return GitHubClientFactoryHelper.GraphQLClient(token, GetUserAgent(installation));
44-
}
45-
4631
private async Task<ValueTuple<Installation, string>> FindInstallationAndGetToken(ITokenGenerator tokenGenerator, string login)
4732
{
4833
var appClient = CreateAppClient(tokenGenerator);
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Octokit;
22
using IGitHubClientFactory = BCC.Web.Interfaces.GitHub.IGitHubClientFactory;
3-
using IGitHubGraphQLClient = BCC.Web.Interfaces.GitHub.IGitHubGraphQLClient;
43

54
namespace BCC.Web.Services.GitHub
65
{
@@ -14,11 +13,5 @@ public IGitHubClient CreateClient(string token)
1413
{
1514
return GitHubClientFactoryHelper.GitHubClient(token, UserAgent);
1615
}
17-
18-
/// <inheritdoc />
19-
public IGitHubGraphQLClient CreateGraphQLClient(string token)
20-
{
21-
return GitHubClientFactoryHelper.GraphQLClient(token, UserAgent);
22-
}
2316
}
2417
}
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Octokit;
22
using Octokit.Internal;
3-
using IGitHubGraphQLClient = BCC.Web.Interfaces.GitHub.IGitHubGraphQLClient;
43

54
namespace BCC.Web.Services.GitHub
65
{
@@ -12,10 +11,5 @@ public static IGitHubClient GitHubClient(string token, string userAgent)
1211
var credentialStore = new InMemoryCredentialStore(new Credentials(token));
1312
return new GitHubClient(productHeaderValue, credentialStore);
1413
}
15-
16-
public static IGitHubGraphQLClient GraphQLClient(string token, string userAgent)
17-
{
18-
return new GitHubGraphQLClient(new Octokit.GraphQL.ProductHeaderValue(userAgent), token);
19-
}
2014
}
2115
}

src/BCC.Web/Services/GitHub/GitHubGraphQLClient.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/BCC.Web/Services/GitHub/GitHubUserModelService.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Nito.AsyncEx;
66
using Octokit;
77
using AccountType = BCC.Web.Models.GitHub.AccountType;
8-
using IGitHubGraphQLClient = BCC.Web.Interfaces.GitHub.IGitHubGraphQLClient;
98
using IGitHubUserClientFactory = BCC.Web.Interfaces.GitHub.IGitHubUserClientFactory;
109
using IGitHubUserModelService = BCC.Web.Interfaces.GitHub.IGitHubUserModelService;
1110
using Installation = BCC.Web.Models.GitHub.Installation;
@@ -17,12 +16,10 @@ namespace BCC.Web.Services.GitHub
1716
public class GitHubUserModelService : IGitHubUserModelService
1817
{
1918
private readonly AsyncLazy<IGitHubClient> _lazyGitHubUserClient;
20-
private readonly AsyncLazy<IGitHubGraphQLClient> _lazyGitHubUserGraphQLClient;
2119

2220
public GitHubUserModelService(IGitHubUserClientFactory gitHubUserClientFactory)
2321
{
2422
_lazyGitHubUserClient = new AsyncLazy<IGitHubClient>(() => gitHubUserClientFactory.CreateClient());
25-
_lazyGitHubUserGraphQLClient = new AsyncLazy<IGitHubGraphQLClient>(() => gitHubUserClientFactory.CreateGraphQLClient());
2623
}
2724

2825
/// <inheritdoc />

0 commit comments

Comments
 (0)