Skip to content

Commit c57fd12

Browse files
Merge pull request #1670 from apollographql/remove/codable-interceptor
Remove Codable Parsing interceptor and interceptor provider (for now)
2 parents ffe0a82 + d8a4a4a commit c57fd12

3 files changed

Lines changed: 0 additions & 113 deletions

File tree

Apollo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
9B260BF9245A030100562176 /* ResponseCodeInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B260BF8245A030100562176 /* ResponseCodeInterceptor.swift */; };
3232
9B260BFB245A031900562176 /* NetworkFetchInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B260BFA245A031900562176 /* NetworkFetchInterceptor.swift */; };
3333
9B260BFF245A054700562176 /* JSONRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B260BFE245A054700562176 /* JSONRequest.swift */; };
34-
9B260C01245A059700562176 /* CodableParsingInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B260C00245A059700562176 /* CodableParsingInterceptor.swift */; };
3534
9B260C04245A090600562176 /* RequestChainNetworkTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B260C03245A090600562176 /* RequestChainNetworkTransport.swift */; };
3635
9B260C08245A437400562176 /* InterceptorProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B260C07245A437400562176 /* InterceptorProvider.swift */; };
3736
9B260C0A245A532500562176 /* LegacyParsingInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B260C09245A532500562176 /* LegacyParsingInterceptor.swift */; };
@@ -577,7 +576,6 @@
577576
9B260BF8245A030100562176 /* ResponseCodeInterceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResponseCodeInterceptor.swift; sourceTree = "<group>"; };
578577
9B260BFA245A031900562176 /* NetworkFetchInterceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkFetchInterceptor.swift; sourceTree = "<group>"; };
579578
9B260BFE245A054700562176 /* JSONRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONRequest.swift; sourceTree = "<group>"; };
580-
9B260C00245A059700562176 /* CodableParsingInterceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableParsingInterceptor.swift; sourceTree = "<group>"; };
581579
9B260C03245A090600562176 /* RequestChainNetworkTransport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestChainNetworkTransport.swift; sourceTree = "<group>"; };
582580
9B260C07245A437400562176 /* InterceptorProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InterceptorProvider.swift; sourceTree = "<group>"; };
583581
9B260C09245A532500562176 /* LegacyParsingInterceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyParsingInterceptor.swift; sourceTree = "<group>"; };
@@ -1150,7 +1148,6 @@
11501148
9B260BE9245A01B900562176 /* Interceptor */ = {
11511149
isa = PBXGroup;
11521150
children = (
1153-
9BC742B024D09F9E0029282C /* Codable */,
11541151
9BC742AF24D09F880029282C /* Legacy */,
11551152
9B260BEA245A020300562176 /* ApolloInterceptor.swift */,
11561153
9BC742AB24CFB2FF0029282C /* ApolloErrorInterceptor.swift */,
@@ -1431,14 +1428,6 @@
14311428
name = Legacy;
14321429
sourceTree = "<group>";
14331430
};
1434-
9BC742B024D09F9E0029282C /* Codable */ = {
1435-
isa = PBXGroup;
1436-
children = (
1437-
9B260C00245A059700562176 /* CodableParsingInterceptor.swift */,
1438-
);
1439-
name = Codable;
1440-
sourceTree = "<group>";
1441-
};
14421431
9BCB585D240758B2002F766E /* Extensions */ = {
14431432
isa = PBXGroup;
14441433
children = (
@@ -2739,7 +2728,6 @@
27392728
9B260BEB245A020300562176 /* ApolloInterceptor.swift in Sources */,
27402729
54DDB0921EA045870009DD99 /* InMemoryNormalizedCache.swift in Sources */,
27412730
9FC9A9C51E2D6CE70023C4D5 /* GraphQLSelectionSet.swift in Sources */,
2742-
9B260C01245A059700562176 /* CodableParsingInterceptor.swift in Sources */,
27432731
9B554CC4247DC29A002F452A /* TaskData.swift in Sources */,
27442732
9B9BBAF524DB4F890021C30F /* AutomaticPersistedQueryInterceptor.swift in Sources */,
27452733
9BA1244A22D8A8EA00BF1D24 /* JSONSerialization+Sorting.swift in Sources */,

Sources/Apollo/CodableParsingInterceptor.swift

Lines changed: 0 additions & 54 deletions
This file was deleted.

Sources/Apollo/InterceptorProvider.swift

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -70,50 +70,3 @@ open class LegacyInterceptorProvider: InterceptorProvider {
7070
return nil
7171
}
7272
}
73-
74-
// MARK: - Default implementation for swift codegen
75-
76-
77-
/// The default interceptor provider for code generated with Swift Codegen™
78-
open class CodableInterceptorProvider<FlexDecoder: FlexibleDecoder>: InterceptorProvider {
79-
80-
private let client: URLSessionClient
81-
private let shouldInvalidateClientOnDeinit: Bool
82-
private let decoder: FlexDecoder
83-
84-
/// Designated initializer
85-
///
86-
/// - Parameters:
87-
/// - client: The URLSessionClient to use. Defaults to the default setup.
88-
/// - shouldInvalidateClientOnDeinit: If the passed-in client should be invalidated when this interceptor provider is deinitialized. If you are recreating the `URLSessionClient` every time you create a new provider, you should do this to prevent memory leaks. Defaults to true, since by default we provide a `URLSessionClient` to new instances.
89-
/// - decoder: A `FlexibleDecoder` which can decode `Codable` objects.
90-
public init(client: URLSessionClient = URLSessionClient(),
91-
shouldInvalidateClientOnDeinit: Bool = true,
92-
decoder: FlexDecoder) {
93-
self.client = client
94-
self.shouldInvalidateClientOnDeinit = shouldInvalidateClientOnDeinit
95-
self.decoder = decoder
96-
}
97-
98-
deinit {
99-
if self.shouldInvalidateClientOnDeinit {
100-
self.client.invalidate()
101-
}
102-
}
103-
104-
open func interceptors<Operation: GraphQLOperation>(for operation: Operation) -> [ApolloInterceptor] {
105-
return [
106-
MaxRetryInterceptor(),
107-
// Swift Codegen Phase 2: Add Cache Read interceptor
108-
NetworkFetchInterceptor(client: self.client),
109-
ResponseCodeInterceptor(),
110-
AutomaticPersistedQueryInterceptor(),
111-
CodableParsingInterceptor(decoder: self.decoder),
112-
// Swift codegen Phase 2: Add Cache Write interceptor
113-
]
114-
}
115-
116-
open func additionalErrorInterceptor<Operation: GraphQLOperation>(for operation: Operation) -> ApolloErrorInterceptor? {
117-
return nil
118-
}
119-
}

0 commit comments

Comments
 (0)