@@ -87,9 +87,19 @@ abstract class GraphQLSocketMessage extends JsonSerializable {
87
87
return PongMessage (payload as Map <String , dynamic >);
88
88
89
89
case MessageTypes .data:
90
- return SubscriptionData (id, payload['data' ], payload['errors' ]);
90
+ return SubscriptionData (
91
+ id,
92
+ payload['data' ],
93
+ payload['errors' ],
94
+ payload['extensions' ],
95
+ );
91
96
case MessageTypes .next:
92
- return SubscriptionNext (id, payload['data' ], payload['errors' ]);
97
+ return SubscriptionNext (
98
+ id,
99
+ payload['data' ],
100
+ payload['errors' ],
101
+ payload['extensions' ],
102
+ );
93
103
case MessageTypes .error:
94
104
return SubscriptionError (id, payload);
95
105
case MessageTypes .complete:
@@ -240,17 +250,20 @@ class ConnectionKeepAlive extends GraphQLSocketMessage {
240
250
/// payload. The user should check the errors result before processing the
241
251
/// data value. These error are from the query resolvers.
242
252
class SubscriptionData extends GraphQLSocketMessage {
243
- SubscriptionData (this .id, this .data, this .errors) : super (MessageTypes .data);
253
+ SubscriptionData (this .id, this .data, this .errors, this .extensions)
254
+ : super (MessageTypes .data);
244
255
245
256
final String id;
246
257
final dynamic data;
247
258
final dynamic errors;
259
+ final dynamic extensions;
248
260
249
261
@override
250
262
toJson () => {
251
263
"type" : type,
252
264
"data" : data,
253
265
"errors" : errors,
266
+ "extensions" : extensions,
254
267
};
255
268
256
269
@override
@@ -262,17 +275,20 @@ class SubscriptionData extends GraphQLSocketMessage {
262
275
}
263
276
264
277
class SubscriptionNext extends GraphQLSocketMessage {
265
- SubscriptionNext (this .id, this .data, this .errors) : super (MessageTypes .next);
278
+ SubscriptionNext (this .id, this .data, this .errors, this .extensions)
279
+ : super (MessageTypes .next);
266
280
267
281
final String id;
268
282
final dynamic data;
269
283
final dynamic errors;
284
+ final dynamic extensions;
270
285
271
286
@override
272
287
toJson () => {
273
288
"type" : type,
274
289
"data" : data,
275
290
"errors" : errors,
291
+ "extensions" : extensions,
276
292
};
277
293
278
294
@override
0 commit comments