-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
85 lines (74 loc) · 2.22 KB
/
index.js
File metadata and controls
85 lines (74 loc) · 2.22 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
84
85
const isE2E = require('../utils/isE2E').default;
const { merge } = require('lodash');
const {
LongResolver,
PositiveIntResolver,
DateTimeResolver,
JSONResolver,
JSONObjectResolver,
} = require('graphql-scalars');
const user = require('./user').default;
const workspace = require('./workspace');
const project = require('./project');
const event = require('./event');
const plans = require('./plans').default;
const projectNotifications = require('./projectNotifications').default;
const projectPatterns = require('./projectPatterns').default;
const userNotifications = require('./userNotifications').default;
const billing = require('./billingNew').default;
const EncodedJSON = require('./encodedJSON').default;
const seed = require('./seed').default;
/**
* @typedef ResolverObj
* @see https://www.apollographql.com/docs/graphql-tools/resolvers#resolver-function-signature
* Object that contains the result returned from the resolver on the parent field,
* or, in the case of a top-level Query field,
* the rootValue passed from the server configuration.
* This argument enables the nested nature of GraphQL queries.
*/
/**
* @typedef ResolverArgs
* @see https://www.apollographql.com/docs/graphql-tools/resolvers#resolver-function-signature
* Object with the arguments passed into the field in the query.
* For example, if the field was called with author(name: "Ada"), the args object would be: { "name": "Ada" }.
*/
/**
* See all types and fields here {@link ../typeDefs/schema.graphql}
*/
const indexResolver = {
Query: {
/**
* Healthcheck endpoint
* @return {string}
*/
health: () => 'ok',
},
// DateTime scalar resolver
DateTime: DateTimeResolver,
// JSON values resolver
JSON: JSONResolver,
// JSON object resolver
JSONObject: JSONObjectResolver,
// Represents JSON objects encoded (or not) in string format
EncodedJSON,
// Allow only positive integers
PositiveInt: PositiveIntResolver,
// Allow big int numbers
Long: LongResolver,
};
const resolvers = [
indexResolver,
user,
workspace,
project,
event,
projectNotifications,
projectPatterns,
userNotifications,
plans,
billing,
];
if (isE2E) {
resolvers.push(seed);
}
module.exports = merge(...resolvers);