Skip to content

Commit

Permalink
Improves inline documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
calvincestari committed Jan 28, 2025
1 parent c21c683 commit afd91c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import GraphQLCompiler

extension GraphQLCompositeType {
/// Indicates if the type has a single keyField named `id`.
var isIdentifiable: Bool {
switch(self) {
case let interface as GraphQLInterfaceType:
Expand Down
3 changes: 2 additions & 1 deletion apollo-ios-codegen/Sources/IR/IR+ComputedSelectionSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public struct ComputedSelectionSet {
/// The `TypeInfo` for the selection set of the computed selections
public let typeInfo: IR.SelectionSet.TypeInfo

/// Indicates if the parent type has a single keyField named `id`.
/// Indicates if a field named `id` is selected as well as requiring that the parent type
/// be identifiable.
public var isIdentifiable: Bool {
guard direct?.fields["id"] != nil || merged.fields["id"] != nil else {
return false
Expand Down
3 changes: 2 additions & 1 deletion apollo-ios-codegen/Sources/IR/IR+NamedFragment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public class NamedFragment: Definition, Hashable, CustomDebugStringConvertible {
public var type: GraphQLCompositeType { definition.type }
public var isLocalCacheMutation: Bool { definition.isLocalCacheMutation }

/// Indicates if the parent type has a single keyField named `id`.
/// Indicates if a field named `id` is selected as well as requiring that the parent type
/// be identifiable.
public var isIdentifiable: Bool {
guard definition.selectionSet.selections.contains(where: {
guard case .field(let field) = $0 else { return false }
Expand Down

0 comments on commit afd91c3

Please sign in to comment.