@@ -131,6 +131,8 @@ public ConnectionBuilder<TSource> AddNavigationConnectionField<TSource, TReturn>
131131 }
132132 }
133133
134+ // Use via reflection
135+ // ReSharper disable once UnusedMember.Local
134136 ConnectionBuilder < TSource > AddEnumerableConnection < TSource , TGraph , TReturn > (
135137 ComplexGraphType < TSource > graph ,
136138 string name ,
@@ -206,6 +208,8 @@ ConnectionBuilder<TSource> AddEnumerableConnection<TSource, TGraph, TReturn>(
206208 return builder ;
207209 }
208210
211+ // Use via reflection
212+ // ReSharper disable once UnusedMember.Local
209213 ConnectionBuilder < TSource > AddEnumerableConnectionWithProjection < TSource , TGraph , TReturn , TProjection > (
210214 ComplexGraphType < TSource > graph ,
211215 string name ,
@@ -219,7 +223,7 @@ ConnectionBuilder<TSource> AddEnumerableConnectionWithProjection<TSource, TGraph
219223
220224 // Store projection expression - flows through to Select expression builder
221225 IncludeAppender . SetProjectionMetadata ( builder . FieldType , projection , typeof ( TSource ) ) ;
222- // Also set include metadata as fallback
226+ // Also set include metadata as fallback for abstract types where projection can't be built
223227 var includeNames = FilterProjectionAnalyzer . ExtractRequiredProperties ( projection ) ;
224228 IncludeAppender . SetIncludeMetadata ( builder . FieldType , name , includeNames ) ;
225229
@@ -294,6 +298,8 @@ ConnectionBuilder<TSource> AddEnumerableConnectionWithProjection<TSource, TGraph
294298 return builder ;
295299 }
296300
301+ // Use via reflection
302+ // ReSharper disable once UnusedMember.Local
297303 ConnectionBuilder < TSource > AddEnumerableConnectionWithProjectionOnly < TSource , TGraph , TReturn > (
298304 ComplexGraphType < TSource > graph ,
299305 string name ,
@@ -306,10 +312,13 @@ ConnectionBuilder<TSource> AddEnumerableConnectionWithProjectionOnly<TSource, TG
306312
307313 // Store projection expression - flows through to Select expression builder
308314 IncludeAppender . SetProjectionMetadata ( builder . FieldType , projection , typeof ( TSource ) ) ;
309- // Also set include metadata as fallback
315+ // Also set include metadata as fallback for abstract types where projection can't be built
310316 var includeNames = FilterProjectionAnalyzer . ExtractRequiredProperties ( projection ) ;
311317 IncludeAppender . SetIncludeMetadata ( builder . FieldType , name , includeNames ) ;
312318
319+ // No resolver set - this overload is for interface types where the concrete types provide resolvers
320+ // The projection metadata flows through to the Select expression builder
321+
313322 var hasId = keyNames . ContainsKey ( typeof ( TReturn ) ) ;
314323
315324 //TODO: works around https://github.com/graphql-dotnet/graphql-dotnet/pull/2581/
@@ -319,4 +328,4 @@ ConnectionBuilder<TSource> AddEnumerableConnectionWithProjectionOnly<TSource, TG
319328 field . AddWhereArgument ( hasId ) ;
320329 return builder ;
321330 }
322- }
331+ }
0 commit comments