From ff4f648fa41f4d9f3e6783ec0c99e2d529610b66 Mon Sep 17 00:00:00 2001 From: Andrew Orobator Date: Thu, 28 Jan 2021 12:43:55 -0500 Subject: [PATCH 1/2] Added toString methods to api.Error and api.Error.Location --- .../kotlin/com/apollographql/apollo/api/Error.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apollo-api/src/commonMain/kotlin/com/apollographql/apollo/api/Error.kt b/apollo-api/src/commonMain/kotlin/com/apollographql/apollo/api/Error.kt index b81bb4dbc19..f054b67143b 100644 --- a/apollo-api/src/commonMain/kotlin/com/apollographql/apollo/api/Error.kt +++ b/apollo-api/src/commonMain/kotlin/com/apollographql/apollo/api/Error.kt @@ -61,6 +61,10 @@ class Error( return result } + override fun toString(): String { + return "Error(message = $message, locations = $locations, customAttributes = $customAttributes)" + } + /** * Represents the location of the error in the GraphQL operation sent to the server. This location is represented in * terms of the line and column number. @@ -106,5 +110,9 @@ class Error( result = 31 * result + column.hashCode() return result } + + override fun toString(): String { + return "Location(line = $line, column = $column)" + } } } From 5a6d3bba5c244b816dcf31ffd1b9a94c6349791a Mon Sep 17 00:00:00 2001 From: Andrew Orobator Date: Thu, 28 Jan 2021 14:03:16 -0500 Subject: [PATCH 2/2] Updated metalava signatures --- apollo-api/api.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apollo-api/api.txt b/apollo-api/api.txt index a82f2eb00ea..aaf69936789 100644 --- a/apollo-api/api.txt +++ b/apollo-api/api.txt @@ -145,6 +145,7 @@ package com.apollographql.apollo.api { method public int hashCode(); method @Deprecated public java.util.List locations(); method @Deprecated public String? message(); + method public String toString(); } public static final class Error.Location { @@ -155,6 +156,7 @@ package com.apollographql.apollo.api { method public long getLine(); method public int hashCode(); method @Deprecated public long line(); + method public String toString(); } @com.apollographql.apollo.api.ApolloExperimental public interface ExecutionContext {