public IGraphQlScalarResult <TDomainResult> Resolve <TDomainResult>(Expression <Func <TValue, TJoinedType, TDomainResult> > resolver)
        {
            var newFunc = Expression.Lambda <Func <TValue, TDomainResult> >(resolver.Body.Replace(resolver.Parameters[1], join.Placeholder), resolver.Parameters[0]);

            return(GraphQlExpressionScalarResult <TDomainResult> .CreateJoin(fieldContext, newFunc, join));
        }
Exemple #2
0
 public static IGraphQlScalarResult <TReturnType> Construct <TReturnType>(TReturnType result, FieldContext fieldContext)
 {
     return(GraphQlExpressionScalarResult <TReturnType> .Constant(result, fieldContext));
 }
 IGraphQlScalarResult <TDomainResult> IGraphQlResultFactory <TValue> .Resolve <TDomainResult>(Expression <Func <TValue, TDomainResult> > resolver)
 {
     return(GraphQlExpressionScalarResult <TDomainResult> .Simple(FieldContext, resolver));
 }