-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathweb.js
More file actions
34 lines (32 loc) · 1.05 KB
/
web.js
File metadata and controls
34 lines (32 loc) · 1.05 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
import { GraphQLList, GraphQLObjectType, GraphQLString } from 'graphql'
import { globalIdField } from 'graphql-relay'
import { nodeInterface } from '../../node'
import { GraphQLDateTime } from 'graphql-scalars'
import { webScanType } from './web-scan'
export const webType = new GraphQLObjectType({
name: 'Web',
fields: () => ({
id: globalIdField('web'),
domain: {
type: GraphQLString,
description: `The domain string the scan was ran on.`,
},
timestamp: {
type: GraphQLDateTime,
description: `The time when the scan was initiated.`,
resolve: ({ timestamp }) => new Date(timestamp),
},
results: {
type: new GraphQLList(webScanType),
description: `Results of the web scan at each IP address.`,
resolve: async ({ _id }, args, { dataSources: { webScan } }) => {
return await webScan.getScansByWebId({
webId: _id,
...args,
})
},
},
}),
interfaces: [nodeInterface],
description: `Results of TLS and HTTP connection scans on the given domain.`,
})