Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 86c7f1b

Browse files
authored
Merge pull request #1578 from github/fixes/graphql-enterprise
Use correct GraphQL endpoint for enterprise.
2 parents b32cb7d + 1f4f82b commit 86c7f1b

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/GitHub.Api/GraphQLClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public GraphQLClientFactory(IKeychain keychain, IProgram program)
3535
{
3636
var credentials = new GraphQLKeychainCredentialStore(keychain, address);
3737
var header = new ProductHeaderValue(program.ProductHeader.Name, program.ProductHeader.Version);
38-
return Task.FromResult<Octokit.GraphQL.IConnection>(new Connection(header, credentials));
38+
return Task.FromResult<Octokit.GraphQL.IConnection>(new Connection(header, address.GraphQLUri, credentials));
3939
}
4040
}
4141
}

src/GitHub.Exports/Primitives/HostAddress.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ private HostAddress(Uri enterpriseUri)
4444
{
4545
WebUri = new Uri(enterpriseUri, new Uri("/", UriKind.Relative));
4646
ApiUri = new Uri(enterpriseUri, new Uri("/api/v3/", UriKind.Relative));
47-
//CredentialCacheKeyHost = ApiUri.Host;
47+
GraphQLUri = new Uri(enterpriseUri, new Uri("/api/graphql", UriKind.Relative));
4848
CredentialCacheKeyHost = WebUri.ToString();
4949
}
5050

5151
public HostAddress()
5252
{
5353
WebUri = new Uri("https://github.com");
5454
ApiUri = new Uri("https://api.github.com");
55-
//CredentialCacheKeyHost = "github.com";
55+
GraphQLUri = new Uri("https://api.github.com/graphql");
5656
CredentialCacheKeyHost = WebUri.ToString();
5757
}
5858

@@ -67,6 +67,12 @@ public HostAddress()
6767
/// </summary>
6868
public Uri ApiUri { get; set; }
6969

70+
/// <summary>
71+
/// The Base Url to the host's GraphQL API endpoint. For example, "https://api.github.com/graphql" or
72+
/// "https://github-enterprise.com/api/graphql"
73+
/// </summary>
74+
public Uri GraphQLUri { get; set; }
75+
7076
// If the host name is "api.github.com" or "gist.github.com", we really only want "github.com",
7177
// since that's the same cache key for all the other github.com operations.
7278
public string CredentialCacheKeyHost { get; private set; }

0 commit comments

Comments
 (0)