Skip to content

Commit

Permalink
Bring back deprecated CodingKey for localCacheMutation in selectionSe…
Browse files Browse the repository at this point in the history
…tInitializers
  • Loading branch information
AnthonyMDev committed Aug 22, 2024
1 parent 521f9f6 commit 2e6af98
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,24 @@ class ApolloCodegenConfigurationCodableTests: XCTestCase {
expect(decoded).to(equal(expected))
}

func test__decode_selectionSetInitializers__givenLocalCacheMutations_shouldReturnIgnoreOption() throws {
// given
let subject = """
{
"localCacheMutations": true
}
""".asData

// when
let decoded = try JSONDecoder().decode(
ApolloCodegenConfiguration.SelectionSetInitializers.self,
from: subject
)

// then
expect(decoded).to(equal([]))
}

// MARK: - OperationDocumentFormat Tests

func encodedValue(_ case: ApolloCodegenConfiguration.OperationDocumentFormat) -> String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,10 @@ extension ApolloCodegenConfiguration.SelectionSetInitializers {
case operations
case namedFragments
case definitionsNamed

/// Deprecated
/// Local Cache Mutations will now always have initializers generated.
case localCacheMutations
}

public init(from decoder: any Decoder) throws {
Expand Down

0 comments on commit 2e6af98

Please sign in to comment.