forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetail-tables.js
More file actions
83 lines (77 loc) · 2.35 KB
/
detail-tables.js
File metadata and controls
83 lines (77 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import { GraphQLObjectType } from 'graphql'
import { connectionArgs } from 'graphql-relay'
import { dkimFailureConnection } from './dkim-failure-table-connection'
import { dmarcFailureConnection } from './dmarc-failure-table-connection'
import { fullPassConnection } from './full-pass-table-connection'
import { spfFailureConnection } from './spf-failure-table-connection'
export const detailTablesType = new GraphQLObjectType({
name: 'DetailTables',
description:
'Object that contains the various senders and details for each category.',
fields: () => ({
dkimFailure: {
description: 'List of senders that are failing DKIM checks.',
args: connectionArgs,
type: dkimFailureConnection.connectionType,
resolve: async (
{ _id },
args,
{ loaders: { loadDkimFailConnectionsBySumId } },
) => {
const dkimFailures = await loadDkimFailConnectionsBySumId({
summaryId: _id,
...args,
})
return dkimFailures
},
},
dmarcFailure: {
description: 'List of senders that are failing DMARC checks.',
args: connectionArgs,
type: dmarcFailureConnection.connectionType,
resolve: async (
{ _id },
args,
{ loaders: { loadDmarcFailConnectionsBySumId } },
) => {
const dmarcFailures = await loadDmarcFailConnectionsBySumId({
summaryId: _id,
...args,
})
return dmarcFailures
},
},
fullPass: {
description: 'List of senders that are passing all checks.',
args: connectionArgs,
type: fullPassConnection.connectionType,
resolve: async (
{ _id },
args,
{ loaders: { loadFullPassConnectionsBySumId } },
) => {
const fullPasses = await loadFullPassConnectionsBySumId({
summaryId: _id,
...args,
})
return fullPasses
},
},
spfFailure: {
description: 'List of senders that are failing SPF checks.',
args: connectionArgs,
type: spfFailureConnection.connectionType,
resolve: async (
{ _id },
args,
{ loaders: { loadSpfFailureConnectionsBySumId } },
) => {
const spfFailures = await loadSpfFailureConnectionsBySumId({
summaryId: _id,
...args,
})
return spfFailures
},
},
}),
})