Implement UserConnection on the graph

This commit is contained in:
Chi Vinh Le
2017-08-29 18:57:20 +07:00
parent b76f1956dc
commit eb67d86163
3 changed files with 53 additions and 12 deletions
+17 -1
View File
@@ -121,6 +121,22 @@ type User {
suspension: SuspensionInfo
}
# UserConnection represents a paginable subset of a user list.
type UserConnection {
# Indicates that there are more users after this subset.
hasNextPage: Boolean!
# Cursor of first user in subset.
startCursor: Cursor
# Cursor of last user in subset.
endCursor: Cursor
# Subset of users.
nodes: [User!]!
}
# UsersQuery allows the ability to query users by a specific fields.
input UsersQuery {
action_type: ACTION_TYPE
@@ -731,7 +747,7 @@ type RootQuery {
me: User
# Users returned based on a query.
users(query: UsersQuery): [User]
users(query: UsersQuery!): UserConnection
# a single User by id
user(id: ID!): User