@@ -87,9 +87,19 @@ abstract class GraphQLSocketMessage extends JsonSerializable {
8787 return PongMessage (payload as Map <String , dynamic >);
8888
8989 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+ );
9196 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+ );
93103 case MessageTypes .error:
94104 return SubscriptionError (id, payload);
95105 case MessageTypes .complete:
@@ -240,17 +250,20 @@ class ConnectionKeepAlive extends GraphQLSocketMessage {
240250/// payload. The user should check the errors result before processing the
241251/// data value. These error are from the query resolvers.
242252class 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);
244255
245256 final String id;
246257 final dynamic data;
247258 final dynamic errors;
259+ final dynamic extensions;
248260
249261 @override
250262 toJson () => {
251263 "type" : type,
252264 "data" : data,
253265 "errors" : errors,
266+ "extensions" : extensions,
254267 };
255268
256269 @override
@@ -262,17 +275,20 @@ class SubscriptionData extends GraphQLSocketMessage {
262275}
263276
264277class 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);
266280
267281 final String id;
268282 final dynamic data;
269283 final dynamic errors;
284+ final dynamic extensions;
270285
271286 @override
272287 toJson () => {
273288 "type" : type,
274289 "data" : data,
275290 "errors" : errors,
291+ "extensions" : extensions,
276292 };
277293
278294 @override
0 commit comments