generated from TeamMrWeb/graphql-mongoose-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresolvers.js
44 lines (43 loc) · 1.55 KB
/
resolvers.js
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
const isLogged = require('./middlewares/isLogged')
module.exports = {
Query: {
me: isLogged(require('./query/me')),
hello: require('./query/hello'),
users: isLogged(require('./query/users')),
getUserById: isLogged(require('./query/getUserById'), {
verified: true,
}),
getPasteById: isLogged(require('./query/getPasteById'), {
verified: true,
}),
getPastesByAuthor: isLogged(require('./query/getPastesByAuthor'), {
verified: true,
}),
pastes: isLogged(require('./query/pastes'), { verified: true }),
},
Mutation: {
createNewUser: require('./mutation/createNewUser'),
deleteUser: isLogged(require('./mutation/deleteUser'), {
verified: true,
}),
updatePaste: isLogged(require('./mutation/updatePaste'), {
verified: true,
}),
updateUser: isLogged(require('./mutation/updateUser'), {
verified: true,
}),
createPaste: isLogged(require('./mutation/createPaste'), {
verified: true,
}),
deletePaste: isLogged(require('./mutation/deletePaste'), {
verified: true,
}),
sendVerificationEmail: isLogged(
require('./mutation/sendVerificationEmail'),
),
verifyEmailToken: require('./mutation/verifyEmailToken'),
loginUser: require('./mutation/loginUser'),
logoutUser: isLogged(require('./mutation/logoutUser')),
refreshUser: require('./mutation/refreshUser'),
},
}