forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdkim-sub.js
More file actions
36 lines (34 loc) · 1.12 KB
/
dkim-sub.js
File metadata and controls
36 lines (34 loc) · 1.12 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
import { GraphQLObjectType, GraphQLList, GraphQLID } from 'graphql'
import { domainType } from '../../domain/objects'
import { StatusEnum } from '../../enums'
import { dkimResultSubType } from './dkim-result-sub'
export const dkimSubType = new GraphQLObjectType({
name: 'DkimSub',
description:
'DKIM gql object containing the fields for the `dkimScanData` subscription.',
fields: () => ({
sharedId: {
type: GraphQLID,
description: `The shared id to match scans together.`,
resolve: ({ sharedId }) => sharedId,
},
domain: {
type: domainType,
description: `The domain the scan was ran on.`,
resolve: async ({ domainKey }, _, { loaders: { loadDomainByKey } }) => {
const domain = await loadDomainByKey.load(domainKey)
return domain
},
},
status: {
type: StatusEnum,
description: 'The success status of the scan.',
resolve: ({ status }) => status,
},
results: {
type: GraphQLList(dkimResultSubType),
description: 'Individual scans results for each dkim selector.',
resolve: ({ results }) => results,
},
}),
})