Hotchocolate: Filtering change / regression from 10.2.0 to 11?

Created on 12 Dec 2019  ·  8Comments  ·  Source: ChilliCream/hotchocolate

I am having a problem getting basic filtering to work. I have a QueryType set up so:

c# descriptor .Field<UserResolvers>(x => x.GetUsers(default, default)) .Type<ListType<NonNullType<UserType>>>() .Name("Users") .UseFiltering();

The GetUsers method returns an IQueryable from an EF Core DbContext.

I am using HotChocolate.AspNetCore 11.0.0-preview.64 and HotChocolate.Types.Filters 11.0.0-preview.64

The solution compiles but throws an error when I hit the endpoint:

System.Private.CoreLib: Exception while executing function: graphql. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'executor'. HotChocolate.Types: Unable to resolve type reference Input: HotChocolate.Types.ListType<HotChocolate.Types.NonNullType<HotChocolate.Types.NativeType<System.String>>>. - Type: UserFilter.

at HotChocolate.Configuration.CompletionContext.GetTypeT
at HotChocolate.Types.FieldBase2.OnCompleteField(ICompletionContext context, TDefinition definition) at HotChocolate.Types.InputField.OnCompleteField(ICompletionContext context, InputFieldDefinition definition) at HotChocolate.Types.FieldBase2.CompleteField(ICompletionContext context)
at HotChocolate.Types.FieldInitHelper.CompleteFieldsTTypeDef,TFieldType,TFieldDef
at HotChocolate.Configuration.TypeInitializer.CompleteTypes()
at HotChocolate.Configuration.TypeInitializer.Initialize(Func1 schemaResolver, IReadOnlySchemaOptions options) at HotChocolate.SchemaBuilder.InitializeTypes(IServiceProvider services, IDescriptorContext descriptorContext, IBindingLookup bindingLookup, IEnumerable1 types, Func1 schemaResolver) at HotChocolate.SchemaBuilder.Create() at HotChocolate.SchemaBuilder.HotChocolate.ISchemaBuilder.Create() at SolutionName.Server.Graph._Ioc.IocRegistration.<>c.<UseSolutionGraphql>b__0_0(IServiceProvider serviceProvider) in C:\Code\SolutionName\src\SolutionName.Server\SolutionName.Server.Graph\_Ioc\IocRegistration.cs:line 14 at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument) 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.ServiceProviderEngineScope.GetService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at HotChocolate.Execution.QueryExecutionBuilder.<>c__DisplayClass9_0.<Populate>b__0(IServiceProvider sp) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton(SingletonCallSite singletonCallSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(IServiceCallSite callSite, TArgument argument) 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 SolutionName.Server.Graph.API.Startup.InjectConfiguration.<Initialize>b__1_0(InjectAttribute i) in C:\Code\SolutionName\src\SolutionName.Server\SolutionName.Server.Graph.API\Startup\InjectConfiguration.cs:line 31 at Microsoft.Azure.WebJobs.Host.Bindings.PatternMatcher.<>c__DisplayClass8_02.b__0(Object src, Attribute attr, ValueBindingContext ctx) in C:projectsazure-webjobs-sdk-rqm4tsrcMicrosoft.Azure.WebJobs.HostBindingsPatternMatcher.cs:line 58
at Microsoft.Azure.WebJobs.Host.Bindings.BindToInputBindingProvider`2.ExactBinding.d__5.MoveNext() in C:projectsazure-webjobs-sdk-rqm4tsrcMicrosoft.Azure.WebJobs.HostBindingsBindingProvidersBindToInputBindingProvider.cs:line 213

If I downgrade to 10.2.0 the problem goes away.

Has somethng changed in the filtering API in v11?

🔍 investigate

All 8 comments

Quite a lot has changed ... the filters now have a lot more features. But we are still iterating on them.

But I think the issue that you have are from changes coming with 10.3.0 since we are changing how we register types.

We are not done on these yet.

@PascalSenn

It seems from the exception that filters have a problem with the new non-null support for c# 8.

I will create a test for this....

@freever Hi freever!

Do you mind pasting the generated SDL for the UserFilter from the schema?

Sure I will ping you on Slack if that's ok

On Thu, 12 Dec 2019 at 13:33, PascalSenn notifications@github.com wrote:

@freever https://github.com/freever Hi freever!

Do you mind pasting the generated SDL for the UserFilter from the schema?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/ChilliCream/hotchocolate/issues/1275?email_source=notifications&email_token=AARKDOC26Q6JR3NP2WFOIKDQYIORNA5CNFSM4JZ2APM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGWMETI#issuecomment-564970061,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AARKDOGDONUNVIWRCRL7VSTQYIORNANCNFSM4JZ2APMQ
.

@michaelstaib @freever could not reproduce the issue for the moment, he will come back to us once it occurs again

If it helps at all, I happened upon this issue as well. It seems to have a problem with any not null string properties. However, if I switch the properties to be nullable strings, the issue goes away. In my case, the properties should have been null anyway, as they represent values assigned to database columns allowing nulls.

That is what I have suspected....

@PascalSenn

I rewrite the types now and this could lead to issues for you while the type is constructed. We should build a little test for this so we have non-nullability under test.

Can we close this issue? @freever @PascalSenn

Sure thing

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nigel-sampson picture nigel-sampson  ·  5Comments

sergeyshaykhullin picture sergeyshaykhullin  ·  3Comments

PascalSenn picture PascalSenn  ·  5Comments

hognevevle picture hognevevle  ·  3Comments

mortzi picture mortzi  ·  4Comments