da9224a069
feat: server & stream invites rework Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
39 lines
781 B
JavaScript
39 lines
781 B
JavaScript
const { gql } = require('apollo-server-express')
|
|
|
|
const adminUsersQuery = gql`
|
|
query ($limit: Int! = 25, $offset: Int! = 0, $query: String = null) {
|
|
adminUsers(limit: $limit, offset: $offset, query: $query) {
|
|
totalCount
|
|
items {
|
|
id
|
|
registeredUser {
|
|
id
|
|
email
|
|
name
|
|
}
|
|
invitedUser {
|
|
id
|
|
email
|
|
invitedBy {
|
|
id
|
|
name
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
module.exports = {
|
|
/**
|
|
* adminUsers query
|
|
* @param {import('apollo-server-express').ApolloServer} apollo
|
|
*/
|
|
getAdminUsersList(apollo, { limit, offset, query }) {
|
|
return apollo.executeOperation({
|
|
query: adminUsersQuery,
|
|
variables: { limit, offset, query }
|
|
})
|
|
}
|
|
}
|