diff --git a/Sources/GraphQL/Execution/Execute.swift b/Sources/GraphQL/Execution/Execute.swift index 00c28e25..4abeffb6 100644 --- a/Sources/GraphQL/Execution/Execute.swift +++ b/Sources/GraphQL/Execution/Execute.swift @@ -187,7 +187,7 @@ public struct ConcurrentDispatchFieldExecutionStrategy: QueryFieldExecutionStrat .mapValues { _ -> Future? in nil } var err: Error? - fields.forEach { field in + for field in fields { let fieldASTs = field.value let fieldKey = field.key let fieldPath = path.appending(fieldKey) diff --git a/Sources/GraphQL/Type/Directives.swift b/Sources/GraphQL/Type/Directives.swift index 941977aa..04cfb352 100644 --- a/Sources/GraphQL/Type/Directives.swift +++ b/Sources/GraphQL/Type/Directives.swift @@ -1,3 +1,5 @@ +import OrderedCollections + public enum DirectiveLocation: String, Encodable { // Operations case query = "QUERY" diff --git a/Sources/GraphQL/Validation/Rules/Custom/NoDeprecatedCustomRule.swift b/Sources/GraphQL/Validation/Rules/Custom/NoDeprecatedCustomRule.swift index f0e9faa2..230cff7c 100644 --- a/Sources/GraphQL/Validation/Rules/Custom/NoDeprecatedCustomRule.swift +++ b/Sources/GraphQL/Validation/Rules/Custom/NoDeprecatedCustomRule.swift @@ -52,8 +52,6 @@ public func NoDeprecatedCustomRule(context: ValidationContext) -> Visitor { } } if let node = node as? ObjectField { - let inputObjectDef = context.parentInputType as? GraphQLInputObjectType - if let inputObjectDef = context.parentInputType as? GraphQLInputObjectType, let inputFieldDef = inputObjectDef.fields[node.name.value], diff --git a/Tests/GraphQLTests/FieldExecutionStrategyTests/FieldExecutionStrategyTests.swift b/Tests/GraphQLTests/FieldExecutionStrategyTests/FieldExecutionStrategyTests.swift index 03d1e5c2..cd021f3b 100644 --- a/Tests/GraphQLTests/FieldExecutionStrategyTests/FieldExecutionStrategyTests.swift +++ b/Tests/GraphQLTests/FieldExecutionStrategyTests/FieldExecutionStrategyTests.swift @@ -259,7 +259,7 @@ class FieldExecutionStrategyTests: XCTestCase { XCTAssertEqual(result.value.data, multiThrowsExpectedData) let resultErrors = result.value.errors XCTAssertEqual(resultErrors.count, multiThrowsExpectedErrors.count) - multiThrowsExpectedErrors.forEach { m in + for m in multiThrowsExpectedErrors { XCTAssertTrue(resultErrors.contains(m), "Expecting result errors to contain \(m)") } // XCTAssertEqualWithAccuracy(1.0, result.seconds, accuracy: 0.5) @@ -308,7 +308,7 @@ class FieldExecutionStrategyTests: XCTestCase { XCTAssertEqual(result.value.data, multiThrowsExpectedData) let resultErrors = result.value.errors XCTAssertEqual(resultErrors.count, multiThrowsExpectedErrors.count) - multiThrowsExpectedErrors.forEach { m in + for m in multiThrowsExpectedErrors { XCTAssertTrue(resultErrors.contains(m), "Expecting result errors to contain \(m)") } // XCTAssertEqualWithAccuracy(0.1, result.seconds, accuracy: 0.25)