Skip to content

Commit

Permalink
Fix newline at end of generated operation (apollographql/apollo-ios-d…
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMDev authored and gh-action-runner committed Aug 1, 2024
1 parent 83488f6 commit 9823c07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ struct DeferredFragmentsMetadataTemplate {
/// Renders metadata definitions for the deferred fragments of an Operation.
///
/// - Returns: The `TemplateString` for the deferred fragments metadata definitions.
func render() -> TemplateString {
func render() -> TemplateString? {
let deferredFragmentPathTypeInfo = DeferredFragmentsPathTypeInfo(
from: operation.rootField.selectionSet.selections
)
guard !deferredFragmentPathTypeInfo.isEmpty else { return "" }
guard !deferredFragmentPathTypeInfo.isEmpty else { return nil }

return """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ struct OperationDefinitionTemplate: OperationTemplateRenderer {
).renderBody())
}
}
\(section: DeferredFragmentsMetadataTemplate(
\(DeferredFragmentsMetadataTemplate(
operation: operation,
config: config,
renderAccessControl: { accessControlModifier(for: .parent) }()
).render())
""")
}

Expand Down

0 comments on commit 9823c07

Please sign in to comment.