@@ -2,7 +2,7 @@ import Foundation
22import GraphQL
33import GraphQLGeneratorRuntime
44
5- // Must be created by user and named `GraphQLContext`.
5+ /// Must be created by user and named `GraphQLContext`.
66class GraphQLContext : @unchecked Sendable {
77 // User can choose structure
88 var users : [ String : User ]
@@ -22,8 +22,8 @@ class GraphQLContext: @unchecked Sendable {
2222 }
2323}
2424
25- // Scalars must be represented by a Swift type of the same name in the GraphQLScalars namespace, conforming to
26- // the GraphQLScalar protocol
25+ /// Scalars must be represented by a Swift type of the same name in the GraphQLScalars namespace, conforming to
26+ /// the GraphQLScalar protocol
2727extension GraphQLScalars {
2828 struct EmailAddress : GraphQLScalar {
2929 let email : String
@@ -32,7 +32,7 @@ extension GraphQLScalars {
3232 self . email = email
3333 }
3434
35- // Codability conformance. Required for usage in InputObject
35+ /// Codability conformance. Required for usage in InputObject
3636 init ( from decoder: any Decoder ) throws {
3737 email = try decoder. singleValueContainer ( ) . decode ( String . self)
3838 }
@@ -41,7 +41,7 @@ extension GraphQLScalars {
4141 try email. encode ( to: encoder)
4242 }
4343
44- // Scalar conformance. Not necessary, but default methods are very inefficient.
44+ /// Scalar conformance. Not necessary, but default methods are very inefficient.
4545 static func serialize( this: Self ) throws -> Map {
4646 return . string( this. email)
4747 }
@@ -67,7 +67,7 @@ extension GraphQLScalars {
6767 }
6868}
6969
70- // Now create types that conform to the expected protocols
70+ /// Now create types that conform to the expected protocols
7171struct Resolvers : GraphQLGenerated . Resolvers {
7272 typealias Query = HelloWorldServer . Query
7373 typealias Mutation = HelloWorldServer . Mutation
@@ -82,7 +82,7 @@ struct User: GraphQLGenerated.User {
8282 let age : Int ?
8383 let role : GraphQLGenerated . Role ?
8484
85- // Required implementations
85+ /// Required implementations
8686 func id( context _: GraphQLContext , info _: GraphQL . GraphQLResolveInfo ) async throws -> String {
8787 return id
8888 }
@@ -105,10 +105,10 @@ struct User: GraphQLGenerated.User {
105105}
106106
107107struct Contact : GraphQLGenerated . Contact {
108- // User can choose structure
108+ /// User can choose structure
109109 let email : String
110110
111- // Required implementations
111+ /// Required implementations
112112 func email( context _: GraphQLContext , info _: GraphQL . GraphQLResolveInfo ) async throws -> GraphQLScalars . EmailAddress {
113113 return . init( email: email)
114114 }
@@ -121,7 +121,7 @@ struct Post: GraphQLGenerated.Post {
121121 let content : String
122122 let authorId : String
123123
124- // Required implementations
124+ /// Required implementations
125125 func id( context _: GraphQLContext , info _: GraphQL . GraphQLResolveInfo ) async throws -> String {
126126 return id
127127 }
@@ -140,7 +140,7 @@ struct Post: GraphQLGenerated.Post {
140140}
141141
142142struct Query : GraphQLGenerated . Query {
143- // Required implementations
143+ /// Required implementations
144144 static func user( id: String , context: GraphQLContext , info _: GraphQL . GraphQLResolveInfo ) async throws -> ( any GraphQLGenerated . User ) ? {
145145 return context. users [ id]
146146 }
@@ -163,7 +163,7 @@ struct Query: GraphQLGenerated.Query {
163163}
164164
165165struct Mutation : GraphQLGenerated . Mutation {
166- // Required implementations
166+ /// Required implementations
167167 static func upsertUser( userInfo: GraphQLGenerated . UserInfo , context: GraphQLContext , info _: GraphQLResolveInfo ) -> any GraphQLGenerated . User {
168168 let user = User (
169169 id: userInfo. id,
@@ -178,7 +178,7 @@ struct Mutation: GraphQLGenerated.Mutation {
178178}
179179
180180struct Subscription : GraphQLGenerated . Subscription {
181- // Required implementations
181+ /// Required implementations
182182 static func watchUser( id: String , context: GraphQLContext , info _: GraphQLResolveInfo ) async throws -> AnyAsyncSequence < ( any GraphQLGenerated . User ) ? > {
183183 return AsyncStream < ( any GraphQLGenerated . User ) ? > { continuation in
184184 context. onTriggerWatch = { [ weak context] in
0 commit comments