forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdkim-result-sub.js
More file actions
67 lines (65 loc) · 2.08 KB
/
dkim-result-sub.js
File metadata and controls
67 lines (65 loc) · 2.08 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
import { GraphQLObjectType, GraphQLString, GraphQLList } from 'graphql'
import { GraphQLJSON } from 'graphql-scalars'
import { guidanceTagType } from '../../guidance-tag/objects'
export const dkimResultSubType = new GraphQLObjectType({
name: 'DkimResultSub',
description: 'Individual one-off scans results for the given dkim selector.',
fields: () => ({
selector: {
type: GraphQLString,
description: 'The selector the scan was ran on.',
resolve: ({ selector }) => selector,
},
record: {
type: GraphQLString,
description: 'DKIM record retrieved during the scan of the domain.',
resolve: ({ record }) => record,
},
keyLength: {
type: GraphQLString,
description: 'Size of the Public Key in bits',
resolve: ({ keyLength }) => keyLength,
},
rawJson: {
type: GraphQLJSON,
description: 'Raw scan result.',
resolve: ({ rawJson }) => JSON.stringify(rawJson),
},
negativeGuidanceTags: {
type: GraphQLList(guidanceTagType),
description: 'Negative guidance tags found during scan.',
resolve: async (
{ negativeTags },
_args,
{ loaders: { loadDkimGuidanceTagByTagId } },
) => {
const dkimTags = await loadDkimGuidanceTagByTagId.loadMany(negativeTags)
return dkimTags
},
},
neutralGuidanceTags: {
type: GraphQLList(guidanceTagType),
description: 'Neutral guidance tags found during scan.',
resolve: async (
{ neutralTags },
_args,
{ loaders: { loadDkimGuidanceTagByTagId } },
) => {
const dkimTags = await loadDkimGuidanceTagByTagId.loadMany(neutralTags)
return dkimTags
},
},
positiveGuidanceTags: {
type: GraphQLList(guidanceTagType),
description: 'Positive guidance tags found during scan.',
resolve: async (
{ positiveTags },
_args,
{ loaders: { loadDkimGuidanceTagByTagId } },
) => {
const dkimTags = await loadDkimGuidanceTagByTagId.loadMany(positiveTags)
return dkimTags
},
},
}),
})