Add accessPoint query

This commit is contained in:
Douglas Barone 2022-03-29 07:21:28 -04:00
parent e07153b7cd
commit a532d4e148
3 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,8 @@
import prisma from '../../prisma'
export async function accessPoint(parent, { id }, context, info) {
return prisma.accessPoint.findUnique({
where: { id: parseInt(id) },
include: { wifiDevices: true }
})
}

View File

@ -1,4 +1,5 @@
import { accessPoints } from './accessPoints' import { accessPoints } from './accessPoints'
import { accessPoint } from './accessPoint'
import { basicUser } from './basicUser' import { basicUser } from './basicUser'
import { groups } from './groups' import { groups } from './groups'
import { logs } from './logs' import { logs } from './logs'
@ -13,6 +14,7 @@ import { wifiUsers } from './wifiUsers'
const Query = { const Query = {
accessPoints, accessPoints,
accessPoint,
basicUser, basicUser,
groups, groups,
logs, logs,

View File

@ -56,6 +56,9 @@ const typeDefs = gql`
"All Access Points" "All Access Points"
accessPoints: [AccessPoint!]! @auth(roles: ["superAdmin"]) accessPoints: [AccessPoint!]! @auth(roles: ["superAdmin"])
"One Access Point"
accessPoint(id: ID!): AccessPoint! @auth(roles: ["superAdmin"])
} }
type Mutation { type Mutation {
@ -94,7 +97,7 @@ const typeDefs = gql`
"Remove a PA host" "Remove a PA host"
delPAHost(id: Int!): PAHost! @auth(roles: ["superAdmin"]) delPAHost(id: Int!): PAHost! @auth(roles: ["superAdmin"])
"Update Access Points" "Force Update Access Points"
updateAccessPoints: String! @auth(roles: ["superAdmin"]) updateAccessPoints: String! @auth(roles: ["superAdmin"])
} }