I ran into an issue when executing queries against mutation results with Entity Framework when a mutation returns a EF proxy.
Looking at Executor (line 19ff):
public static object Execute
(GraphQLSchema<TContext> schema, TContext context, GraphQLField field, ExecSelection<Info> query)
{
var mutReturn = field.RunMutation(context, query.Arguments.Values());
var queryableFuncExpr = field.GetExpression(query.Arguments.Values(), mutReturn);
var replaced = (LambdaExpression)ParameterReplacer.Replace(queryableFuncExpr, queryableFuncExpr.Parameters[0], GraphQLSchema<TContext>.DbParam);
// sniff queryable provider to determine how selector should be built
var dummyQuery = replaced.Compile().DynamicInvoke(context, null);
var queryType = dummyQuery.GetType();
In this case the queryType is System.Data.Entity.DynamicProxies, but we are interested in the queryType.BaseType.
I ran into an issue when executing queries against mutation results with Entity Framework when a mutation returns a EF proxy.
Looking at
Executor
(line 19ff):In this case the
queryType
isSystem.Data.Entity.DynamicProxies
, but we are interested in thequeryType.BaseType
.This PR adds an expression option to handle this.