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

Expose cacheKey function as public #2014

Merged
merged 2 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Apollo/GraphQLSelectionSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public struct GraphQLField: GraphQLSelection {
self.type = type
}

func cacheKey(with variables: [String: JSONEncodable]?) throws -> String {
public func cacheKey(with variables: [String: JSONEncodable]?) throws -> String {
if
let argumentValues = try arguments?.evaluate(with: variables),
argumentValues.apollo.isNotEmpty {
Expand Down
2 changes: 1 addition & 1 deletion Tests/ApolloTests/CacheKeyForFieldTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import XCTest
@testable import Apollo
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in two minds about this change. I left it in as a forcing function of-sorts for anyone who one day thinks public might be the wrong choice. I could easily be convinced to revert this line if someone feels strongly that it should remain @testable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this, though we should probably do some audits of where we're using @testable import separate from this.

import Apollo
import ApolloTestSupport
import StarWarsAPI

Expand Down