Skip to content

Commit d290b27

Browse files
authored
fix(api): GraphQLResponse.toString() include data & errors (#5079)
1 parent fb001b4 commit d290b27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/amplify_core/lib/src/types/api/graphql/graphql_response.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ class GraphQLResponse<T> {
3333

3434
@override
3535
String toString() {
36-
if (hasErrors) {
37-
final errors = this.errors.map((error) => error.toJson()).toList();
38-
return 'GraphQLResponse<$T> error: ${prettyPrintJson(errors)}';
39-
}
40-
return 'GraphQLResponse<$T> success: ${prettyPrintJson(data)}';
36+
final obj = {
37+
'data': data,
38+
'errors': errors,
39+
};
40+
return 'GraphQLResponse<$T>: ${prettyPrintJson(obj)}';
4141
}
4242
}

0 commit comments

Comments
 (0)