From 1ad78c9a4159384d6d45643cd41cf475273f3405 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 1 Jul 2025 14:13:05 -0700 Subject: [PATCH] Add query fragment interpolation helper for representable bindings --- Sources/StructuredQueriesCore/QueryFragment.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Sources/StructuredQueriesCore/QueryFragment.swift b/Sources/StructuredQueriesCore/QueryFragment.swift index a36e5197..4b726c02 100644 --- a/Sources/StructuredQueriesCore/QueryFragment.swift +++ b/Sources/StructuredQueriesCore/QueryFragment.swift @@ -209,6 +209,18 @@ extension QueryFragment: ExpressibleByStringInterpolation { segments.append(.binding(binding)) } + /// Append a query representable output to the interpolation. + /// + /// - Parameters: + /// - queryOutput: A query representable output. + /// - representableType: The type of query representation. + public mutating func appendInterpolation( + _ queryOutput: QueryValue.QueryOutput, + as representableType: QueryValue.Type + ) { + appendInterpolation(QueryValue(queryOutput: queryOutput)) + } + /// Append a query fragment to the interpolation. /// /// - Parameter fragment: A query fragment.