Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
import { GraphQLBoolean, GraphQLInt, GraphQLList, GraphQLNonNull, GraphQLObjectType } from 'graphql';
|
|
export const buildPaginatedListType = (name, docType)=>new GraphQLObjectType({
|
|
name,
|
|
fields: {
|
|
docs: {
|
|
type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(docType)))
|
|
},
|
|
hasNextPage: {
|
|
type: new GraphQLNonNull(GraphQLBoolean)
|
|
},
|
|
hasPrevPage: {
|
|
type: new GraphQLNonNull(GraphQLBoolean)
|
|
},
|
|
limit: {
|
|
type: new GraphQLNonNull(GraphQLInt)
|
|
},
|
|
nextPage: {
|
|
type: GraphQLInt
|
|
},
|
|
offset: {
|
|
type: GraphQLInt
|
|
},
|
|
page: {
|
|
type: new GraphQLNonNull(GraphQLInt)
|
|
},
|
|
pagingCounter: {
|
|
type: new GraphQLNonNull(GraphQLInt)
|
|
},
|
|
prevPage: {
|
|
type: GraphQLInt
|
|
},
|
|
totalDocs: {
|
|
type: new GraphQLNonNull(GraphQLInt)
|
|
},
|
|
totalPages: {
|
|
type: new GraphQLNonNull(GraphQLInt)
|
|
}
|
|
}
|
|
});
|
|
|
|
//# sourceMappingURL=buildPaginatedListType.js.map |