Skip to content

Commit 40a14be

Browse files
fix: Adds explicit @Sendable for Swift 6.0
1 parent 0a03c6e commit 40a14be

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Sources/GraphQLGeneratorCore/Generator/BuildGraphQLSchemaGenerator.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,17 @@ package struct BuildGraphQLSchemaGenerator {
184184
) throws -> String {
185185
var output = ""
186186

187+
// TODO: Swift 6.0 requires `@Sendable` explicitly here. We can remove it when we drop 6.0 support.
187188
if target == .subscription {
188189
output += """
189-
\(variableName)["\(fieldName)"]?.resolve = { source, _, _, _ in
190+
\(variableName)["\(fieldName)"]?.resolve = { @Sendable source, _, _, _ in
190191
return source
191192
}
192-
\(variableName)["\(fieldName)"]?.subscribe = { source, args, context, info in
193+
\(variableName)["\(fieldName)"]?.subscribe = { @Sendable source, args, context, info in
193194
"""
194195
} else {
195196
output += """
196-
\(variableName)["\(fieldName)"]?.resolve = { source, args, context, info in
197+
\(variableName)["\(fieldName)"]?.resolve = { @Sendable source, args, context, info in
197198
"""
198199
}
199200

0 commit comments

Comments
 (0)