@@ -239,16 +239,20 @@ public final class GraphQLObjectType: GraphQLCompositeType, GraphQLInterfaceImpl
239
239
public private( set) var fields : [ String : GraphQLField ] !
240
240
241
241
public private( set) var interfaces : [ GraphQLInterfaceType ] !
242
+
243
+ public private( set) var keyFields : [ String ] !
242
244
243
245
/// Initializer to be used for creating mock objects in tests only.
244
246
init (
245
247
name: GraphQLName ,
246
248
documentation: String ? ,
247
249
fields: [ String : GraphQLField ] ,
248
- interfaces: [ GraphQLInterfaceType ]
250
+ interfaces: [ GraphQLInterfaceType ] ,
251
+ keyFields: [ String ]
249
252
) {
250
253
self . fields = fields
251
254
self . interfaces = interfaces
255
+ self . keyFields = keyFields
252
256
super. init ( name: name, documentation: documentation)
253
257
}
254
258
@@ -259,6 +263,7 @@ public final class GraphQLObjectType: GraphQLCompositeType, GraphQLInterfaceImpl
259
263
override func finalize( _ jsValue: JSValue , bridge: isolated JavaScriptBridge) {
260
264
self . fields = try ! bridge. invokeMethod ( " getFields " , on: jsValue)
261
265
self . interfaces = try ! bridge. invokeMethod ( " getInterfaces " , on: jsValue)
266
+ self . keyFields = jsValue [ " _apolloKeyFields " ]
262
267
}
263
268
264
269
public override var debugDescription : String {
@@ -274,16 +279,20 @@ public final class GraphQLInterfaceType: GraphQLAbstractType, GraphQLInterfaceIm
274
279
public private( set) var fields : [ String : GraphQLField ] !
275
280
276
281
public private( set) var interfaces : [ GraphQLInterfaceType ] !
282
+
283
+ public private( set) var keyFields : [ String ] !
277
284
278
285
/// Initializer to be used for creating mock objects in tests only.
279
286
init (
280
287
name: GraphQLName ,
281
288
documentation: String ? ,
282
289
fields: [ String : GraphQLField ] ,
283
- interfaces: [ GraphQLInterfaceType ]
290
+ interfaces: [ GraphQLInterfaceType ] ,
291
+ keyFields: [ String ]
284
292
) {
285
293
self . fields = fields
286
294
self . interfaces = interfaces
295
+ self . keyFields = keyFields
287
296
super. init ( name: name, documentation: documentation)
288
297
}
289
298
@@ -294,6 +303,7 @@ public final class GraphQLInterfaceType: GraphQLAbstractType, GraphQLInterfaceIm
294
303
override func finalize( _ jsValue: JSValue , bridge: isolated JavaScriptBridge) {
295
304
self . fields = try ! bridge. invokeMethod ( " getFields " , on: jsValue)
296
305
self . interfaces = try ! bridge. invokeMethod ( " getInterfaces " , on: jsValue)
306
+ self . keyFields = jsValue [ " _apolloKeyFields " ]
297
307
}
298
308
299
309
public override var debugDescription : String {
0 commit comments