Add pooling

This commit is contained in:
Douglas Barone 2022-04-04 16:10:52 -04:00
parent 4d83049b22
commit 1053566356
2 changed files with 5 additions and 3 deletions

View File

@ -1,16 +1,17 @@
import prisma from '../../prisma' import prisma from '../../prisma'
export async function accessPoint(parent, { id }, context, info) { export async function accessPoint(parent, { id }, context, info) {
const ap = prisma.accessPoint.findUnique({ return prisma.accessPoint.findUnique({
where: { id: parseInt(id) }, where: { id: parseInt(id) },
include: { include: {
wifiDevices: { wifiDevices: {
orderBy: {
ip: 'asc'
},
where: { where: {
status: 'ONLINE' status: 'ONLINE'
} }
} }
} }
}) })
console.log(ap);
return ap
} }

View File

@ -97,6 +97,7 @@ export default {
}, },
apollo: { apollo: {
accessPoint: { accessPoint: {
pollInterval: 1000,
cachePolicy: 'cache-and-network', cachePolicy: 'cache-and-network',
query: gql` query: gql`
query accessPoint($id: ID!) { query accessPoint($id: ID!) {