Skip to content

Commit f28036a

Browse files
committed
Fixed issue that private setter where not used during input deserialization.
1 parent 64dc2eb commit f28036a

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Core/Types.Tests/Types/InputObjectTypeTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ public async Task Input_With_Immutable_ClrType()
10271027

10281028
// act
10291029
IExecutionResult result = await executor.ExecuteAsync(
1030-
"{ do(input: { bar: \"abc\" baz: \"def\" }) { bar baz } }");
1030+
"{ do(input: { bar: \"abc\" baz: \"def\" qux: \"ghi\" }) { bar baz qux } }");
10311031

10321032
// assert
10331033
result.MatchSnapshot();
@@ -1168,6 +1168,7 @@ public FooImmutable(string bar, string baz)
11681168

11691169
public string Bar { get; }
11701170
public string Baz { get; set; }
1171+
public string Qux { get; private set; }
11711172
}
11721173
}
11731174
}

src/Core/Types.Tests/Types/__snapshots__/InputObjectTypeTests.Input_With_Immutable_ClrType.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"Data": {
33
"do": {
44
"bar": "abc",
5-
"baz": "def"
5+
"baz": "def",
6+
"qux": "ghi"
67
}
78
},
89
"Extensions": {},

src/Core/Types/Utilities/Serialization/InputObjectFactoryCompiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private static IEnumerable<Expression> SetFields(
127127
foreach (InputField field in fields.Values)
128128
{
129129
Expression value = GetFieldValue(field, data, converter);
130-
yield return Expression.Call(instance, field.Property.GetSetMethod(), value);
130+
yield return Expression.Call(instance, field.Property.GetSetMethod(true), value);
131131
}
132132
}
133133

0 commit comments

Comments
 (0)