From 80e851ed89de5a8edcbea96a7ad6855f17882f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=CC=8Cimon=20S=CC=8Cesta=CC=81k?= Date: Mon, 30 Sep 2024 10:17:58 +0200 Subject: [PATCH] GraphQLAPIAdapterError add parsing of ApolloError --- Sources/GraphQLAPIKit/Errors/GraphQLAPIAdapterError.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/GraphQLAPIKit/Errors/GraphQLAPIAdapterError.swift b/Sources/GraphQLAPIKit/Errors/GraphQLAPIAdapterError.swift index 0df9942..9fe173c 100644 --- a/Sources/GraphQLAPIKit/Errors/GraphQLAPIAdapterError.swift +++ b/Sources/GraphQLAPIKit/Errors/GraphQLAPIAdapterError.swift @@ -22,6 +22,8 @@ public enum GraphQLAPIAdapterError: LocalizedError { init(error: Error) { if let error = error as? GraphQLAPIAdapterError { self = error + } else if let error = error as? ApolloError { + self = .graphQl(error.errors.map(GraphQLError.init)) } else if let error = error as? URLSessionClient.URLSessionClientError, case let URLSessionClient.URLSessionClientError.networkError(_, response, underlyingError) = error {