Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unused imports and declarations #3100

Merged
merged 13 commits into from
Jul 20, 2023
2 changes: 0 additions & 2 deletions Sources/Apollo/Collection+Helpers.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

// MARK: - Unzipping
// MARK: Arrays of tuples to tuples of arrays

Expand Down
2 changes: 0 additions & 2 deletions Sources/Apollo/DataLoader.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

final class DataLoader<Key: Hashable, Value> {
public typealias BatchLoad = (Set<Key>) throws -> [Key: Value]
private var batchLoad: BatchLoad
Expand Down
2 changes: 1 addition & 1 deletion Sources/Apollo/DispatchQueue+Optional.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
import Dispatch

extension DispatchQueue {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Foundation
#if !COCOAPODS
import ApolloAPI
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import Foundation
#if !COCOAPODS
import ApolloAPI
#endif

/// A `GraphQLExecutionSource` configured to execute upon the JSON data from the network response
/// for a GraphQL operation.
struct NetworkResponseExecutionSource:
GraphQLExecutionSource,
CacheKeyComputingExecutionSource
{
typealias RawData = JSONObject
struct NetworkResponseExecutionSource: GraphQLExecutionSource, CacheKeyComputingExecutionSource {
typealias RawObjectData = JSONObject
typealias FieldCollector = DefaultFieldSelectionCollector

func resolveField(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import Foundation
#if !COCOAPODS
import ApolloAPI
#endif

/// A `GraphQLExecutionSource` designed for use when the data source is a generated model's
/// `SelectionSet` data.
struct SelectionSetModelExecutionSource:
GraphQLExecutionSource,
CacheKeyComputingExecutionSource
{
typealias RawData = DataDict
struct SelectionSetModelExecutionSource: GraphQLExecutionSource, CacheKeyComputingExecutionSource {
typealias RawObjectData = DataDict
typealias FieldCollector = CustomCacheDataWritingFieldSelectionCollector

func resolveField(
Expand Down
2 changes: 0 additions & 2 deletions Sources/Apollo/GraphQLHTTPMethod.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Supported HTTP methods for Apollo
enum GraphQLHTTPMethod: String, Hashable {
case GET
Expand Down
1 change: 0 additions & 1 deletion Sources/Apollo/GraphQLResult.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Foundation
#if !COCOAPODS
import ApolloAPI
#endif
Expand Down
2 changes: 0 additions & 2 deletions Sources/Apollo/GraphQLSelectionSetMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import ApolloAPI
#endif

import Foundation

/// An accumulator that converts executed data to the correct values to create a `SelectionSet`.
final class GraphQLSelectionSetMapper<T: SelectionSet>: GraphQLResultAccumulator {

Expand Down
4 changes: 0 additions & 4 deletions Sources/Apollo/HTTPURLResponse+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ extension HTTPURLResponse {
return (200..<300).contains(statusCode)
}

var statusCodeDescription: String {
return HTTPURLResponse.localizedString(forStatusCode: statusCode)
}

var isMultipart: Bool {
return (allHeaderFields["Content-Type"] as? String)?.contains("multipart/mixed") ?? false
}
Expand Down
2 changes: 0 additions & 2 deletions Sources/Apollo/InMemoryNormalizedCache.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public final class InMemoryNormalizedCache: NormalizedCache {
private var records: RecordSet

Expand Down
2 changes: 0 additions & 2 deletions Sources/Apollo/NormalizedCache.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public protocol NormalizedCache: AnyObject {

/// Loads records corresponding to the given keys.
Expand Down
2 changes: 0 additions & 2 deletions Sources/Apollo/PossiblyDeferred.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Lazily evaluates an array of possibly deferred values.
/// - Parameters:
/// - elements: An array of possibly deferred values
Expand Down
1 change: 0 additions & 1 deletion Sources/Apollo/RequestBodyCreator.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Foundation
#if !COCOAPODS
import ApolloAPI
#endif
Expand Down
1 change: 0 additions & 1 deletion Sources/Apollo/RequestChain.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Foundation
#if !COCOAPODS
import ApolloAPI
#endif
Expand Down
2 changes: 0 additions & 2 deletions Sources/Apollo/SelectionSet+JSONInitializer.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

#if !COCOAPODS
import ApolloAPI
#endif
Expand Down
2 changes: 0 additions & 2 deletions Sources/ApolloAPI/AnyHashableConvertible.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// A helper protocol to enable `AnyHashable` conversion for types that do not have automatic
/// `AnyHashable` conversion implemented.
///
Expand Down
2 changes: 0 additions & 2 deletions Sources/ApolloAPI/GraphQLNullable.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Indicates the presence of a value, supporting both `nil` and `null` values.
///
/// ``GraphQLNullable`` is generally only used for setting input values on generated ``GraphQLOperation`` objects.
Expand Down
2 changes: 0 additions & 2 deletions Sources/ApolloAPI/InputValue.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Represents an input value to an argument on a ``Selection/Field``'s ``Selection/Field/arguments``.
///
/// # See Also
Expand Down
2 changes: 0 additions & 2 deletions Sources/ApolloAPI/JSON.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

/// Represents a value in a ``JSONObject``
///
/// Making ``JSONValue`` an `AnyHashable` enables comparing ``JSONObject``s
Expand Down
2 changes: 0 additions & 2 deletions Sources/ApolloAPI/LocalCacheMutation.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public protocol LocalCacheMutation: AnyObject, Hashable {
static var operationType: GraphQLOperationType { get }

Expand Down
2 changes: 0 additions & 2 deletions Sources/ApolloAPI/Selection+Conditions.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public extension Selection {
/// The conditions representing a group of `@include/@skip` directives.
///
Expand Down
2 changes: 0 additions & 2 deletions Sources/ApolloAPI/Selection.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Foundation

public enum Selection {
/// A single field selection.
case field(Field)
Expand Down
1 change: 0 additions & 1 deletion Sources/ApolloSQLite/SQLiteSerialization.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import SQLite
#if !COCOAPODS
import Apollo
import ApolloAPI
Expand Down