forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummary-category.js
More file actions
28 lines (27 loc) · 799 Bytes
/
summary-category.js
File metadata and controls
28 lines (27 loc) · 799 Bytes
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
import {
GraphQLObjectType,
GraphQLString,
GraphQLInt,
GraphQLFloat,
} from 'graphql'
export const summaryCategoryType = new GraphQLObjectType({
name: 'SummaryCategory',
fields: () => ({
name: {
type: GraphQLString,
description: `Category of computed summary which the other fields relate to.`,
resolve: ({ name }) => name,
},
count: {
type: GraphQLInt,
description: `Total count of domains that fall into this category.`,
resolve: ({ count }) => count,
},
percentage: {
type: GraphQLFloat,
description: `Percentage compared to other categories.`,
resolve: ({ percentage }) => percentage,
},
}),
description: `This object contains the information for each type of summary that has been pre-computed`,
})