Open Mephistofeles opened 6 months ago
@PascalSenn is this the JSON update issue?
Workaround:
IQueryable<T>
interface. Implementation is not needed.
using System.Collections;
using System.Linq.Expressions;
namespace HotChocolateReproduction;
public class QueryWorkaround
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
}
public Type ElementType => throw new NotImplementedException();
public Expression Expression => throw new NotImplementedException();
public IQueryProvider Provider => throw new NotImplementedException();
}
2. Configure runtime type
descriptor.Field(x => x.Locks.Select(y => y.Lock)).Name("locks").ToDefinition().RuntimeType = typeof(QueryWorkaround
Product
Hot Chocolate
Version
13.9.0
Link to minimal reproduction
https://github.com/Mephistofeles/HotChocolateReproduction
Steps to reproduce
I've included minimal reproduction. When I run query like:
It runs just fine, but when I create a variable for where, like:
and use it with variables:
I'm getting error HC0016: Variable in HotChocolate.Utilities.DictionaryToObjectConverter.VisitObject (in call to Activator.CreateInstance(context.ClrType)) which failes, because of course IEnumerable is an interface and results in "System.MissingMethodException: 'Cannot create an instance of an interface.'"
filter
got an invalid value. which when I debug probably comes from trying to convert "locks" to IEnumerableWhat is expected?
Query should run the same whether I use variables or not
What is actually happening?
Query fails when I use variable for a filter input
Relevant log output
No response
Additional context
No response