From 930ad7ea30aa1115de32a77ea4c43f07a677203b Mon Sep 17 00:00:00 2001 From: Jay Herron Date: Mon, 6 Jan 2025 22:56:02 -0700 Subject: [PATCH 1/2] fix: Doc comments before attributes --- Sources/GraphQL/GraphQL.swift | 4 ++-- Sources/GraphQL/Subscription/EventStream.swift | 2 +- Tests/GraphQLTests/SubscriptionTests/SimplePubSub.swift | 2 +- Tests/GraphQLTests/SubscriptionTests/SubscriptionTests.swift | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/GraphQL/GraphQL.swift b/Sources/GraphQL/GraphQL.swift index 0c192fe7..76138126 100644 --- a/Sources/GraphQL/GraphQL.swift +++ b/Sources/GraphQL/GraphQL.swift @@ -279,7 +279,6 @@ public func graphqlSubscribe( // MARK: Async/Await -@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) /// This is the primary entry point function for fulfilling GraphQL operations /// by parsing, validating, and executing a GraphQL document along side a /// GraphQL schema. @@ -315,6 +314,7 @@ public func graphqlSubscribe( /// `errors` if an error occurs only in a specific field. If that happens the value of that /// field will be `null` and there will be an error inside `errors` specifying the reason for /// the failure and the path of the failed field. +@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) public func graphql( queryStrategy: QueryFieldExecutionStrategy = SerialFieldExecutionStrategy(), mutationStrategy: MutationFieldExecutionStrategy = SerialFieldExecutionStrategy(), @@ -343,7 +343,6 @@ public func graphql( ).get() } -@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) /// This is the primary entry point function for fulfilling GraphQL subscription /// operations by parsing, validating, and executing a GraphQL subscription /// document along side a GraphQL schema. @@ -382,6 +381,7 @@ public func graphql( /// If that happens the value of that field will be `null` and there /// will be an error inside `errors` specifying the reason for the failure and the path of the /// failed field. +@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) public func graphqlSubscribe( queryStrategy: QueryFieldExecutionStrategy = SerialFieldExecutionStrategy(), mutationStrategy: MutationFieldExecutionStrategy = SerialFieldExecutionStrategy(), diff --git a/Sources/GraphQL/Subscription/EventStream.swift b/Sources/GraphQL/Subscription/EventStream.swift index a654ab30..5ff7ad89 100644 --- a/Sources/GraphQL/Subscription/EventStream.swift +++ b/Sources/GraphQL/Subscription/EventStream.swift @@ -8,8 +8,8 @@ open class EventStream { } } -@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) /// Event stream that wraps an `AsyncThrowingStream` from Swift's standard concurrency system. +@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) public class ConcurrentEventStream: EventStream { public let stream: AsyncThrowingStream diff --git a/Tests/GraphQLTests/SubscriptionTests/SimplePubSub.swift b/Tests/GraphQLTests/SubscriptionTests/SimplePubSub.swift index 21c33a86..8a742378 100644 --- a/Tests/GraphQLTests/SubscriptionTests/SimplePubSub.swift +++ b/Tests/GraphQLTests/SubscriptionTests/SimplePubSub.swift @@ -1,7 +1,7 @@ import GraphQL -@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) /// A very simple publish/subscriber used for testing +@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) class SimplePubSub { private var subscribers: [Subscriber] diff --git a/Tests/GraphQLTests/SubscriptionTests/SubscriptionTests.swift b/Tests/GraphQLTests/SubscriptionTests/SubscriptionTests.swift index 955a5a9b..57a4273e 100644 --- a/Tests/GraphQLTests/SubscriptionTests/SubscriptionTests.swift +++ b/Tests/GraphQLTests/SubscriptionTests/SubscriptionTests.swift @@ -2,8 +2,8 @@ import GraphQL import NIO import XCTest -@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) /// This follows the graphql-js testing, with deviations where noted. +@available(macOS 10.15, iOS 15, watchOS 8, tvOS 15, *) class SubscriptionTests: XCTestCase { let timeoutDuration = 0.5 // in seconds From 44f5b07deccd4f0cc732abcd75c6ae5d96a12a4e Mon Sep 17 00:00:00 2001 From: Jay Herron Date: Mon, 6 Jan 2025 23:01:13 -0700 Subject: [PATCH 2/2] fix: Remove unused parameter --- Sources/GraphQL/Type/Definition.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Sources/GraphQL/Type/Definition.swift b/Sources/GraphQL/Type/Definition.swift index 06375abb..7f2c0924 100644 --- a/Sources/GraphQL/Type/Definition.swift +++ b/Sources/GraphQL/Type/Definition.swift @@ -877,10 +877,7 @@ public final class GraphQLEnumType { try assertValid(name: name) self.name = name self.description = description - self.values = try defineEnumValues( - name: name, - valueMap: values - ) + self.values = try defineEnumValues(valueMap: values) self.astNode = astNode self.extensionASTNodes = extensionASTNodes @@ -969,7 +966,6 @@ extension GraphQLEnumType: Hashable { } func defineEnumValues( - name: String, valueMap: GraphQLEnumValueMap ) throws -> [GraphQLEnumValueDefinition] { var definitions: [GraphQLEnumValueDefinition] = []