Skip to content

Commit 75061c3

Browse files
authored
Merge pull request #2 from futuredapp/fix/ApolloError-parsing
Fix - GraphQLAPIAdapterError parsing of ApolloError
2 parents 3bb76ac + 80e851e commit 75061c3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Sources/GraphQLAPIKit/Errors/GraphQLAPIAdapterError.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public enum GraphQLAPIAdapterError: LocalizedError {
2222
init(error: Error) {
2323
if let error = error as? GraphQLAPIAdapterError {
2424
self = error
25+
} else if let error = error as? ApolloError {
26+
self = .graphQl(error.errors.map(GraphQLError.init))
2527
} else if let error = error as? URLSessionClient.URLSessionClientError,
2628
case let URLSessionClient.URLSessionClientError.networkError(_, response, underlyingError) = error
2729
{

0 commit comments

Comments
 (0)