Skip to content

Commit 1ad78c9

Browse files
committed
Add query fragment interpolation helper for representable bindings
1 parent 83e4776 commit 1ad78c9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Sources/StructuredQueriesCore/QueryFragment.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,18 @@ extension QueryFragment: ExpressibleByStringInterpolation {
209209
segments.append(.binding(binding))
210210
}
211211

212+
/// Append a query representable output to the interpolation.
213+
///
214+
/// - Parameters:
215+
/// - queryOutput: A query representable output.
216+
/// - representableType: The type of query representation.
217+
public mutating func appendInterpolation<QueryValue: QueryBindable>(
218+
_ queryOutput: QueryValue.QueryOutput,
219+
as representableType: QueryValue.Type
220+
) {
221+
appendInterpolation(QueryValue(queryOutput: queryOutput))
222+
}
223+
212224
/// Append a query fragment to the interpolation.
213225
///
214226
/// - Parameter fragment: A query fragment.

0 commit comments

Comments
 (0)