Skip to content

Commit f5288e0

Browse files
feat: validateSchema no longer throws
1 parent d3366a2 commit f5288e0

8 files changed

Lines changed: 264 additions & 166 deletions

File tree

Sources/GraphQL/GraphQL.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public func graphql(
8888
validationRules: [@Sendable (ValidationContext) -> Visitor] = specifiedRules
8989
) async throws -> GraphQLResult {
9090
// Validate schema
91-
let schemaValidationErrors = try validateSchema(schema: schema)
91+
let schemaValidationErrors = validateSchema(schema: schema)
9292
guard schemaValidationErrors.isEmpty else {
9393
return GraphQLResult(errors: schemaValidationErrors)
9494
}

Sources/GraphQL/GraphQLRequest.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ public struct GraphQLRequest: Equatable, Codable, Sendable {
2626
///
2727
/// - Returns: True if request is a subscription, false if it is an atomic operation (like
2828
/// `query` or `mutation`)
29+
@available(
30+
*,
31+
deprecated,
32+
message: "Call `parse` manually and then use `execute(..., documentAST: , ...)`"
33+
)
2934
public func isSubscription() throws -> Bool {
3035
return try operationType() == .subscription
3136
}
@@ -35,6 +40,11 @@ public struct GraphQLRequest: Equatable, Codable, Sendable {
3540
/// performance when calling multiple times.
3641
///
3742
/// - Returns: The operation type performed by the request
43+
@available(
44+
*,
45+
deprecated,
46+
message: "Call `parse` manually and then use `execute(..., documentAST: , ...)`"
47+
)
3848
public func operationType() throws -> OperationType {
3949
let documentAST = try GraphQL.parse(
4050
source: Source(body: query, name: "GraphQL request")

0 commit comments

Comments
 (0)