exposed notification setting via graph

This commit is contained in:
Wyatt Johnson
2018-03-01 15:28:14 -07:00
parent 86c221d6f9
commit 8cb645651c
2 changed files with 12 additions and 0 deletions
@@ -1,4 +1,5 @@
const { get } = require('lodash');
const { DISABLE_REQUIRE_EMAIL_VERIFICATIONS } = require('./config');
module.exports = {
User: {
@@ -16,4 +17,8 @@ module.exports = {
await User.updateNotificationSettings(input);
},
},
Settings: {
notificationsRequireConfirmation: () =>
Boolean(!DISABLE_REQUIRE_EMAIL_VERIFICATIONS),
},
};
@@ -5,6 +5,13 @@ type User {
notificationSettings: NotificationSettings
}
type Settings {
# notificationsRequireConfirmation when true indicates that User's must have
# their email address confirmed/verified before they can recieve
# notifications.
notificationsRequireConfirmation: Boolean
}
type UpdateNotificationSettingsResponse implements Response {
# An array of errors relating to the mutation that occurred.
errors: [UserError!]