Skip to content

Commit

Permalink
Merge pull request #131 from cshadek/feature/arguments-public-inits
Browse files Browse the repository at this point in the history
Adds public inits for all 3 paginatable arguments structs
  • Loading branch information
NeedleInAJayStack authored Nov 15, 2023
2 parents 61f714d + 3b40a65 commit 42623e2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ public protocol BackwardPaginatable: Decodable {
public struct BackwardPaginationArguments: BackwardPaginatable {
public let last: Int?
public let before: String?

public init(last: Int?, before: String?) {
self.last = last
self.before = before
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ public protocol ForwardPaginatable: Decodable {
public struct ForwardPaginationArguments: ForwardPaginatable {
public let first: Int?
public let after: String?

public init(first: Int?, after: String?) {
self.first = first
self.after = after
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ public struct PaginationArguments: Paginatable {
public let after: String?
public let before: String?

public init(first: Int? = nil, last: Int? = nil, after: String? = nil, before: String? = nil) {
self.first = first
self.last = last
self.after = after
self.before = before
}

init(_ arguments: Paginatable) {
first = arguments.first
last = arguments.last
Expand Down

0 comments on commit 42623e2

Please sign in to comment.