19 public static async ValueTask<IGraphQLGitLabClient>
CreateClient(
string? bearerToken =
null)
21 var serviceCollection =
new ServiceCollection();
23 var clientBuilder = serviceCollection
25 var graphQLEndpoint =
new Uri(
"https://gitlab.com/api/graphql");
27 clientBuilder.ConfigureHttpClient(
30 client.BaseAddress =
new Uri(
"https://gitlab.com/api/graphql");
31 if (bearerToken !=
null)
33 client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Bearer", bearerToken);
37 var serviceProvider = serviceCollection.BuildServiceProvider();
44 await serviceProvider.DisposeAsync();