@@ -34,26 +34,9 @@ public final class GraphQLSchema: @unchecked Sendable {
3434 let astNode : SchemaDefinition ?
3535 let extensionASTNodes : [ SchemaExtensionDefinition ]
3636
37- // Used as a cache for validateSchema().
38- private var _validationErrors : [ GraphQLError ] ?
39- private let validationErrorQueue = DispatchQueue (
40- label: " graphql.schema.validationerrors " ,
41- attributes: . concurrent
42- )
43- var validationErrors : [ GraphQLError ] ? {
44- get {
45- // Reads can occur concurrently.
46- return validationErrorQueue. sync {
47- _validationErrors
48- }
49- }
50- set {
51- // Writes occur sequentially.
52- return validationErrorQueue. sync ( flags: . barrier) {
53- self . _validationErrors = newValue
54- }
55- }
56- }
37+ /// Used as a cache for validateSchema(). Concurrent access is not protected, so assume
38+ /// it can be changed at any time.
39+ var validationErrors : [ GraphQLError ] ?
5740
5841 public let queryType : GraphQLObjectType ?
5942 public let mutationType : GraphQLObjectType ?
@@ -95,7 +78,7 @@ public final class GraphQLSchema: @unchecked Sendable {
9578 extensionASTNodes: [ SchemaExtensionDefinition ] = [ ] ,
9679 assumeValid: Bool = false
9780 ) throws {
98- _validationErrors = assumeValid ? [ ] : nil
81+ validationErrors = assumeValid ? [ ] : nil
9982
10083 self . description = description
10184 self . extensions = extensions
0 commit comments