Martin Brehovsky
12/01/2020, 3:10 AMabstract class Page<T:Any> {
@GraphQLIgnore
abstract fetchItems() ...
// these will be exposed in the schema
fun itemsCount(): Int
fun hasNextPage(): Boolean
fun pageItems: List<T>
}
class PageOfStrings: Page<String> {
override fetchItems() ...
}
class PageOfInts Page<Int> {
override fetchItems() ...
}
The resulting schema would have two types:
type PageOfStrings {
itemsCount: Int!
hasNextPage: Boolean!
pageItems: [String]!
}
type PageOfInts {
itemsCount: Int!
hasNextPage: Boolean!
pageItems: [Int]!
}
Is something like this doable?Dariusz Kuc
12/01/2020, 4:01 AMPage
class as ignored and see whether the other types get generatedShane Myrick
12/01/2020, 5:58 AMMartin Brehovsky
12/01/2020, 5:57 PM