Add pooling
This commit is contained in:
parent
4d83049b22
commit
1053566356
|
@ -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
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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!) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user