From fe32638504379a4855d63141e62b30c10684c218 Mon Sep 17 00:00:00 2001 From: Zach FettersMoore <4425109+BobaFetters@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:39:11 -0400 Subject: [PATCH] Adding debugDescription to SelectionSets (apollographql/apollo-ios-dev#412) --- Sources/ApolloAPI/SelectionSet.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/ApolloAPI/SelectionSet.swift b/Sources/ApolloAPI/SelectionSet.swift index f017bf1135..77a7276db1 100644 --- a/Sources/ApolloAPI/SelectionSet.swift +++ b/Sources/ApolloAPI/SelectionSet.swift @@ -46,7 +46,7 @@ public protocol CompositeInlineFragment: CompositeSelectionSet, InlineFragment { } // MARK: - SelectionSet -public protocol SelectionSet: Hashable { +public protocol SelectionSet: Hashable, CustomDebugStringConvertible { associatedtype Schema: SchemaMetadata /// A type representing all of the fragments the `SelectionSet` can be converted to. @@ -117,6 +117,10 @@ extension SelectionSet { @inlinable public static func ==(lhs: Self, rhs: Self) -> Bool { return lhs.__data == rhs.__data } + + public var debugDescription: String { + return "\(self.__data._data as AnyObject)" + } } extension SelectionSet where Fragments: FragmentContainer {