-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Labels
Description
I noticed that @paulofaria added connections in an earlier commit. I was trying to use them in my code but have not succeeded in getting them working.
Here is what I have been trying. What am I missing here?
Inside the Schema Definition:
Type(User.self,
Field("id", at: \.id).description("The unique id of the user."),
Field("followersConnection", at: User.followers).description("The followers connection")
)
In another file:
class User: Codable, Identifiable {
var id: String? = UUID().uuidString
func followers(context: UserContext, arguments: ForwardPaginationArguments) -> EventLoopFuture<Connection<User>> {
let arr = context.request.eventLoop.makeSucceededFuture([User()])
return arr.connection(from: arguments)
}
}
I get this error:
[ ERROR ] Cannot use type "Connection<User>" for field "followersConnection". Type does not map to a GraphQL type.
Thanks!
Reactions are currently unavailable