Skip to content

Commit d3d1c84

Browse files
fix: Fixes cache DispatchQueue work to be sync
This was exposed by Swift Testing not liking DispatchQueue.async. See https://forums.swift.org/t/using-dispatchqueue-async-or-task-detached-in-swift-testing/75215 for more details.
1 parent 5725cf8 commit d3d1c84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/GraphQL/Type/Schema.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public final class GraphQLSchema: @unchecked Sendable {
4949
}
5050
set {
5151
// Writes occur sequentially.
52-
return validationErrorQueue.async(flags: .barrier) {
52+
return validationErrorQueue.sync(flags: .barrier) {
5353
self._validationErrors = newValue
5454
}
5555
}
@@ -77,7 +77,7 @@ public final class GraphQLSchema: @unchecked Sendable {
7777
}
7878
set {
7979
// Writes occur sequentially.
80-
return subTypeMapQueue.async(flags: .barrier) {
80+
return subTypeMapQueue.sync(flags: .barrier) {
8181
self._subTypeMap = newValue
8282
}
8383
}

0 commit comments

Comments
 (0)