File tree Expand file tree Collapse file tree 3 files changed +51
-7
lines changed
src/Types/Types/Relay/Attributes
test/Types.Tests/Types/Relay Expand file tree Collapse file tree 3 files changed +51
-7
lines changed Original file line number Diff line number Diff line change @@ -141,13 +141,6 @@ protected override void OnConfigure(
141
141
nodeDescriptor . TryResolveNode ( type ) ;
142
142
}
143
143
144
- // we trigger a late id field configuration
145
- var typeDescriptor = ObjectTypeDescriptor . From (
146
- completionContext . DescriptorContext ,
147
- definition ) ;
148
- nodeDescriptor . ConfigureNodeField ( typeDescriptor ) ;
149
- typeDescriptor . CreateDefinition ( ) ;
150
-
151
144
// invoke completion explicitly.
152
145
nodeDescriptor . OnCompleteDefinition ( completionContext , definition ) ;
153
146
} ) ;
Original file line number Diff line number Diff line change @@ -251,6 +251,26 @@ ... on Entity {
251
251
. MatchSnapshotAsync ( ) ;
252
252
}
253
253
254
+ // Ensure Issue 7829 is fixed.
255
+ [ Fact ]
256
+ public async Task NodeAttribute_On_Extension_With_Renamed_Id ( )
257
+ {
258
+ await new ServiceCollection ( )
259
+ . AddGraphQL ( )
260
+ . AddQueryType < QueryEntityRenamed > ( )
261
+ . AddTypeExtension < EntityExtensionRenamingId > ( )
262
+ . ExecuteRequestAsync (
263
+ """
264
+ {
265
+ entity(id: 5) {
266
+ id
267
+ data
268
+ }
269
+ }
270
+ """ )
271
+ . MatchSnapshotAsync ( ) ;
272
+ }
273
+
254
274
public class Query
255
275
{
256
276
public Entity GetEntity ( string name ) => new Entity { Name = name , } ;
@@ -330,5 +350,28 @@ public class EntityExtension4
330
350
{
331
351
public static Entity GetEntity ( string id ) => new ( ) { Name = id , } ;
332
352
}
353
+
354
+ public class QueryEntityRenamed
355
+ {
356
+ public EntityNoId GetEntity ( int id )
357
+ => new EntityNoId { Data = id } ;
358
+ }
359
+
360
+ public class EntityNoId
361
+ {
362
+ public int Data { get ; set ; }
363
+ }
364
+
365
+ [ Node ]
366
+ [ ExtendObjectType ( typeof ( EntityNoId ) ) ]
367
+ public class EntityExtensionRenamingId
368
+ {
369
+ public int GetId ( [ Parent ] EntityNoId entity )
370
+ => entity . Data ;
371
+
372
+ [ NodeResolver ]
373
+ public EntityNoId GetEntity ( int id )
374
+ => new ( ) { Data = id , } ;
375
+ }
333
376
}
334
377
#pragma warning restore RCS1102 // Make class static
Original file line number Diff line number Diff line change
1
+ {
2
+ " data" : {
3
+ " entity" : {
4
+ " id" : " RW50aXR5Tm9JZDo1" ,
5
+ " data" : 5
6
+ }
7
+ }
8
+ }
You can’t perform that action at this time.
0 commit comments