Skip to content

Commit

Permalink
1.2 migration guide and docs updates (#3018)
Browse files Browse the repository at this point in the history
Co-authored-by: Calvin Cestari <calvincestari@users.noreply.github.com>
  • Loading branch information
AnthonyMDev and calvincestari committed May 16, 2023
1 parent 415f7fe commit b51006f
Show file tree
Hide file tree
Showing 88 changed files with 9,500 additions and 1,834 deletions.
10 changes: 5 additions & 5 deletions Sources/ApolloAPI/SchemaConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ public protocol SchemaConfiguration {
/// [aliased fields](https://spec.graphql.org/draft/#sec-Field-Alias) will be keyed on their
/// alias name, not the name of the field on the schema type.
///
/// 3. Because cache key resolution is performed both on raw JSON (from a network response or
/// cache hit) and `SelectionSet` model data (when writing to the cache directly), the underlying
/// data will have different formats. The `object` parameter of this function is an ``ObjectData``
/// struct that wraps the underlying object data. The ``ObjectData`` wrapper is used to normalize
/// this data to a consistent format in this context.
/// 3. The `object` parameter of this function is an ``ObjectData`` struct that wraps the
/// underlying object data. Because cache key resolution is performed both on raw JSON (from a
/// network response) and `SelectionSet` model data (when writing to the cache directly),
/// the underlying data will have different formats. The ``ObjectData`` wrapper is used to
/// normalize this data to a consistent format in this context.
///
/// # See Also
/// ``CacheKeyInfo``
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct SchemaConfigurationTemplate: TemplateRenderer {
\(accessControlModifier(for: .parent))enum SchemaConfiguration: \
\(config.ApolloAPITargetName).SchemaConfiguration {
\(accessControlModifier(for: .member))\
static func cacheKeyInfo(for type: Object, object: JSONObject) -> CacheKeyInfo? {
static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? {
// Implement this function to configure cache key resolution for your schema types.
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SchemaConfigurationTemplateTests: XCTestCase {
// given
let expected = """
public enum SchemaConfiguration: ApolloAPI.SchemaConfiguration {
public static func cacheKeyInfo(for type: Object, object: JSONObject) -> CacheKeyInfo? {
public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? {
// Implement this function to configure cache key resolution for your schema types.
return nil
}
Expand All @@ -83,7 +83,7 @@ class SchemaConfigurationTemplateTests: XCTestCase {
// given
let expected = """
enum SchemaConfiguration: ApolloAPI.SchemaConfiguration {
public static func cacheKeyInfo(for type: Object, object: JSONObject) -> CacheKeyInfo? {
public static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? {
// Implement this function to configure cache key resolution for your schema types.
return nil
}
Expand All @@ -104,7 +104,7 @@ class SchemaConfigurationTemplateTests: XCTestCase {
// given
let expected = """
enum SchemaConfiguration: ApolloAPI.SchemaConfiguration {
static func cacheKeyInfo(for type: Object, object: JSONObject) -> CacheKeyInfo? {
static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? {
// Implement this function to configure cache key resolution for your schema types.
return nil
}
Expand All @@ -125,7 +125,7 @@ class SchemaConfigurationTemplateTests: XCTestCase {
// given
let expected = """
enum SchemaConfiguration: Apollo.SchemaConfiguration {
static func cacheKeyInfo(for type: Object, object: JSONObject) -> CacheKeyInfo? {
static func cacheKeyInfo(for type: Object, object: ObjectData) -> CacheKeyInfo? {
// Implement this function to configure cache key resolution for your schema types.
return nil
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b51006f

Please sign in to comment.