private void AssignValueToObjectField(T result, GraphQLInputObjectTypeFieldInfo field, object value) { value = ReflectionUtilities.ChangeValueType(value, field.SystemType); ReflectionUtilities.MakeSetterFromLambda(field.Lambda) .DynamicInvoke(result, value); }
public InputFieldDefinitionBuilder <TProperty> Field <TProperty>(string fieldName, Expression <Func <T, TProperty> > accessor, string description = null) { if (this.ContainsField(fieldName)) { throw new GraphQLException("Can't insert two fields with the same name."); } var returnType = ReflectionUtilities.GetReturnValueFromLambdaExpression(accessor); if (this.IsInterfaceOrCollectionOfInterfaces(returnType)) { throw new GraphQLException("Can't set accessor to interface based field"); } var fieldInfo = GraphQLInputObjectTypeFieldInfo.CreateAccessorFieldInfo(fieldName, accessor, description); this.Fields.Add(fieldName, fieldInfo); return(new InputFieldDefinitionBuilder <TProperty>(fieldInfo)); }
public InputFieldDefinitionBuilder(GraphQLInputObjectTypeFieldInfo fieldInfo) : base(fieldInfo) { }
private Result GetField(GraphQLObjectField astField, GraphQLInputObjectTypeFieldInfo fieldInfo, ISchemaRepository schemaRepository) { return(this.GetValueFromField(schemaRepository, fieldInfo, astField)); }