@@ -19,6 +19,8 @@ class GraphQLResponseError {
19
19
this .locations,
20
20
this .path,
21
21
this .extensions,
22
+ this .errorType,
23
+ this .errorInfo,
22
24
});
23
25
24
26
factory GraphQLResponseError .fromJson (Map <String , dynamic > json) {
@@ -34,6 +36,8 @@ class GraphQLResponseError {
34
36
.toList (),
35
37
path: json['path' ] as List ? ,
36
38
extensions: (json['extensions' ] as Map ? )? .cast <String , dynamic >(),
39
+ errorType: json['errorType' ] as String ? ,
40
+ errorInfo: (json['errorInfo' ] as Map ? )? .cast <String , dynamic >(),
37
41
);
38
42
}
39
43
@@ -49,25 +53,35 @@ class GraphQLResponseError {
49
53
/// Additional context.
50
54
final Map <String , dynamic >? extensions;
51
55
56
+ /// The type of error.
57
+ final String ? errorType;
58
+
59
+ /// Additional info.
60
+ final Map <String , dynamic >? errorInfo;
61
+
52
62
Map <String , dynamic > toJson () => < String , dynamic > {
53
63
'message' : message,
54
64
if (locations != null )
55
65
'locations' : locations? .map ((e) => e.toJson ()).toList (),
56
66
if (path != null ) 'path' : path,
57
67
if (extensions != null ) 'extensions' : extensions,
68
+ if (errorType != null ) 'errorType' : errorType,
69
+ if (errorInfo != null ) 'errorInfo' : errorInfo,
58
70
};
59
71
60
72
@override
61
73
bool operator == (Object other) =>
62
74
identical (this , other) ||
63
75
other is GraphQLResponseError &&
64
76
const DeepCollectionEquality ().equals (
65
- [message, locations, path, extensions],
77
+ [message, locations, path, extensions, errorType, errorInfo ],
66
78
[
67
79
other.message,
68
80
other.locations,
69
81
other.path,
70
82
other.extensions,
83
+ other.errorType,
84
+ other.errorInfo,
71
85
],
72
86
);
73
87
@@ -77,6 +91,8 @@ class GraphQLResponseError {
77
91
locations,
78
92
path,
79
93
extensions,
94
+ errorType,
95
+ errorInfo,
80
96
]);
81
97
82
98
@override
0 commit comments