Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #41 from YaroslavKormushyn/main
Browse files Browse the repository at this point in the history
fix #39 bearer token support for scaffolding tool
  • Loading branch information
Giorgi authored Mar 14, 2023
2 parents 6262b10 + 45f8305 commit ac7f623
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/GraphQLinq.Scaffolding/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private static async Task Main(string[] args)
await generate.InvokeAsync(args);
}

private static async Task HandleGenerate(Uri endpoint, string output, string @namespace, string context, string bearerToken, IConsole console)
private static async Task HandleGenerate(Uri endpoint, string output, string @namespace, string context, string bearer, IConsole console)
{
//var webClient = new WebClient();
//webClient.Headers.Add("Content-Type", "application/json");
Expand All @@ -140,9 +140,9 @@ private static async Task HandleGenerate(Uri endpoint, string output, string @na
{
AnsiConsole.WriteLine("Running introspection query ...");
using var httpClient = new HttpClient();
if (!string.IsNullOrEmpty(bearerToken))
if (!string.IsNullOrEmpty(bearer))
{
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", bearerToken);
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", bearer);
}
using var responseMessage = await httpClient.PostAsJsonAsync(endpoint, new { query = IntrospectionQuery });
Expand Down

0 comments on commit ac7f623

Please sign in to comment.