"Unexpected type: " error
K-Pavlov opened this issue · 3 comments
K-Pavlov commented
Having this Schema and request
internal class Program
{
private static async Task Main(string[] args)
{
var res = await GraphQLEngine.New<CoreQuery>()
.NewExecutor()
.WithQueryString("query { node { id } }")
.Execute();
res.Errors.ToList().ForEach(x => Console.WriteLine(x.ToString()));
}
}
public partial class CoreQuery
{
public INode Node()
{
return new Test();
}
public Test A()
{
return null;
}
public NonNull<Test> B()
{
return null;
}
}
public class Test : INode
{
public Id Id => Id.New<Test>(1);
}
Results in a "Unexpected type: " error from GraphQL.NET. This seems very similar to #187, but the same fix breaks a lot of tests;
The contents of the type cache seem wrong to me:
I am not really sure what the real issue is here and what a suitable fix would be here (and why this comes up after so many working cases)
tlil commented
Does changing the following make any difference?
-public partial class CoreQuery
+public class CoreQuery
K-Pavlov commented