Skip to content

Instantly share code, notes, and snippets.

@JeremyLikness
Created November 2, 2020 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeremyLikness/11e83c30bf8c8b361beeb2bac5f2c4e6 to your computer and use it in GitHub Desktop.
Save JeremyLikness/11e83c30bf8c8b361beeb2bac5f2c4e6 to your computer and use it in GitHub Desktop.
StrawberryShake errors
{"Schemas":[{"Name":"github","Type":"http","File":"github.graphql","Url":"https://api.github.com/graphql"}],"ClientName":"githubClient"}
Unhandled exception. System.ArgumentException: The type `Uri` has no value serializer and cannot be handled.
at StrawberryShake.ValueSerializerCollection.Get(String typeName)
at EFCoreContributors.GetPrsResultParser..ctor(IValueSerializerCollection serializerResolver) in C:\Users\jeliknes\source\repos\EFCoreContributors\EFCoreContributors\github\Generated\GetPrsResultParser.cs:line 29
at EFCoreContributors.githubClientServiceCollectionExtensions.<>c.<AddgithubClient>b__1_1(IValueSerializerCollection serializers) in C:\Users\jeliknes\source\repos\EFCoreContributors\EFCoreContributors\github\Generated\GithubClientServiceCollectionExtensions.cs:line 41
at StrawberryShake.OperationClientBuilderExtensions.<>c__DisplayClass5_0.<AddResultParser>b__1(IValueSerializerCollection serializers, IDictionary`2 parsers)
at StrawberryShake.Configuration.ClientOptions.CreateConfiguration(String clientName)
at StrawberryShake.Configuration.ClientOptions.<GetOperationPipeline>b__7_0[T](String n)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at StrawberryShake.Configuration.ClientOptions.GetOperationPipeline[T](String clientName)
at EFCoreContributors.githubClientServiceCollectionExtensions.<>c.<AddgithubClient>b__1_0(IServiceProvider sp) in C:\Users\jeliknes\source\repos\EFCoreContributors\EFCoreContributors\github\Generated\GithubClientServiceCollectionExtensions.cs:line 33
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
at EFCoreContributors.Program.Main(String[] args) in C:\Users\jeliknes\source\repos\EFCoreContributors\EFCoreContributors\Program.cs:line 46
at EFCoreContributors.Program.<Main>(String[] args)
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Threading.Tasks;
namespace EFCoreContributors
{
public class Program
{
private const string PAT = "xyz";
static async Task Main(string[] args)
{
var sc = new ServiceCollection();
sc.AddHttpClient(
"githubClient",
c =>
{
c.BaseAddress = new Uri("https://api.github.com/graphql");
c.DefaultRequestHeaders.Add("Authorization", $"Bearer {PAT}");
});
sc.AddgithubClient();
var sp = sc.BuildServiceProvider();
var client = sp.GetRequiredService<IGithubClient>();
var result = await client.GetPrsAsync();
foreach (var item in result.Data.Repository.Label.PullRequests.Nodes)
{
Console.WriteLine(item.CreatedAt);
}
}
}
}
query getPrs {
repository(name: "efcore", owner: "dotnet") {
label(name: "community-contribution") {
pullRequests(states: [MERGED], first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {
totalCount
nodes {
permalink
author {
login,
avatarUrl,
url
}
createdAt
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment