Skip to content

Commit

Permalink
fix(api): GraphQLResponse.toString() include data & errors (#5079)
Browse files Browse the repository at this point in the history
  • Loading branch information
Equartey authored and Jordan-Nelson committed Jun 27, 2024
1 parent 2e46749 commit 69da27d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class GraphQLResponse<T> {

@override
String toString() {
if (hasErrors) {
final errors = this.errors.map((error) => error.toJson()).toList();
return 'GraphQLResponse<$T> error: ${prettyPrintJson(errors)}';
}
return 'GraphQLResponse<$T> success: ${prettyPrintJson(data)}';
final obj = {
'data': data,
'errors': errors,
};
return 'GraphQLResponse<$T>: ${prettyPrintJson(obj)}';
}
}

0 comments on commit 69da27d

Please sign in to comment.