Skip to content
Snippets Groups Projects
Commit 8d65cce9 authored by Grigor Malo's avatar Grigor Malo
Browse files

fix(models): allow paginating users results

parent fafdcf16
No related branches found
No related tags found
3 merge requests!52Docx,!26Paginate users query result,!17Graphql api
This commit is part of merge request !26. Comments created here will be created in the context of that merge request.
...@@ -3,7 +3,7 @@ scalar DateTime ...@@ -3,7 +3,7 @@ scalar DateTime
# find a better place to inject that # find a better place to inject that
input PageInput { input PageInput {
pageSize: Int! pageSize: Int!
pageNumber: Int! page: Int!
} }
# #
type User { type User {
...@@ -70,7 +70,7 @@ input UpdatePasswordInput { ...@@ -70,7 +70,7 @@ input UpdatePasswordInput {
extend type Query { extend type Query {
user(id: ID): User user(id: ID): User
users: Users! users(options: PageInput): Users!
currentUser: User! currentUser: User!
} }
......
...@@ -38,10 +38,10 @@ const userResolver = async (_, { id }, ctx) => { ...@@ -38,10 +38,10 @@ const userResolver = async (_, { id }, ctx) => {
} }
} }
const usersResolver = async (_, args, ctx) => { const usersResolver = async (_, { options }, ctx) => {
try { try {
logger.error(`${USER_RESOLVER} users`) logger.error(`${USER_RESOLVER} users`)
return getUsers() return getUsers(options)
} catch (e) { } catch (e) {
logger.error(`${USER_RESOLVER} users: ${e.message}`) logger.error(`${USER_RESOLVER} users: ${e.message}`)
throw new Error(e) throw new Error(e)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment