Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Graphiti/Argument/NoArguments.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
public struct NoArguments: Decodable {
init() {}
public init() {}
}
12 changes: 12 additions & 0 deletions Sources/Graphiti/Connection/PageInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,16 @@ public struct PageInfo: Codable {
public let hasNextPage: Bool
public let startCursor: String?
public let endCursor: String?

public init(
hasPreviousPage: Bool,
hasNextPage: Bool,
startCursor: String? = nil,
endCursor: String? = nil
) {
self.hasPreviousPage = hasPreviousPage
self.hasNextPage = hasNextPage
self.startCursor = startCursor
self.endCursor = endCursor
}
}
28 changes: 13 additions & 15 deletions Tests/GraphitiTests/ConnectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,23 @@ class ConnectionTests: XCTestCase {
}
}

let schema = {
try! Schema<ConnectionTypeResolver, NoContext> {
Type(Comment.self) {
Field("id", at: \.id)
Field("message", at: \.message)
}
let schema = try! Schema<ConnectionTypeResolver, NoContext> {
Type(Comment.self) {
Field("id", at: \.id)
Field("message", at: \.message)
}

ConnectionType(Comment.self)
ConnectionType(Comment.self)

Query {
Field("comments", at: ConnectionTypeResolver.comments) {
Argument("first", at: \.first)
Argument("last", at: \.last)
Argument("after", at: \.after)
Argument("before", at: \.before)
}
Query {
Field("comments", at: ConnectionTypeResolver.comments) {
Argument("first", at: \.first)
Argument("last", at: \.last)
Argument("after", at: \.after)
Argument("before", at: \.before)
}
}
}()
}

let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1)

Expand Down