You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4fa24bf
Browse filesBrowse the repository at this point in the historyBrowse files
Keep a rebuilt async list's own type when the item type changed
An async service field selected below an async service list field crashed with
"Object of type 'List`1[System.Object]' cannot be converted to type
'IEnumerable`1[Dynamic_...]'" - e.g. floor { people { visitSummaries { ... } } }
where people and visitSummaries both resolve via ResolveAsync.
Resolving an item of the outer list rebuilds it, because the item projection
holds an async member of its own, so the finished list no longer holds the item
type the outer field was declared with and falls back to List<object>.
GetResolvedFieldType unwrapped Task<T> to T unconditionally, so the rebuilt
parent still declared that member IEnumerable<T> and setting the resolved list
on it threw.
Only keep T when the resolved value still is one, otherwise take the resolved
value's own type - which is what the non-async path below it already does.
ValueTask<T> had the same hole and takes the same guard.
Bump to 6.2.4.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
# 6.2.4
2
+
3
+
## Fixes
4
+
5
+
- Fixed `Object of type 'System.Collections.Generic.List`1[System.Object]' cannot be converted to type 'System.Collections.Generic.IEnumerable`1[Dynamic_...]'` for a query selecting an async service field below an async service *list* field - `floor { people { visitSummaries { ... } } }`, where both `people` and `visitSummaries` have a `ResolveAsync` resolver. Resolving an item of the outer list rebuilds it, because the item projection holds an async member of its own, so the finished list no longer holds the item type the outer field was declared with and falls back to `List<object>`. `GetResolvedFieldType` unwrapped `Task<T>` to `T` unconditionally, so the rebuilt parent still declared the member as the original `IEnumerable<T>` and setting the resolved list on it threw. `T` is now only kept when the resolved value still is one, otherwise the resolved value's own type is used - which is what the non-async path already did. `ValueTask<T>` had the same hole and takes the same guard.
Copy file name to clipboardExpand all lines: src/EntityGraphQL/EntityGraphQL.csproj
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
<LangVersion>14.0</LangVersion>
5
5
<AssemblyName>EntityGraphQL</AssemblyName>
6
6
<PackageId>EntityGraphQL</PackageId>
7
-
<PackageVersion>6.2.3</PackageVersion>
7
+
<PackageVersion>6.2.4</PackageVersion>
8
8
<Description>A GraphQL library for .NET. Compiles queries into .NET Expressions (LinqProvider) for runtime execution against object graphs. E.g. against an ORM data model (EntityFramework or others) or just an in-memory object.</Description>
0 commit comments