summaryrefslogtreecommitdiff
path: root/app/graphql/types/users/email_type.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/users/email_type.rb')
-rw-r--r--app/graphql/types/users/email_type.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/graphql/types/users/email_type.rb b/app/graphql/types/users/email_type.rb
new file mode 100644
index 00000000000..5e0b9563f57
--- /dev/null
+++ b/app/graphql/types/users/email_type.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+module Types
+ module Users
+ class EmailType < BaseObject
+ graphql_name 'Email'
+
+ authorize :read_user_email_address
+
+ field :id,
+ GraphQL::Types::ID,
+ null: false,
+ description: 'Internal ID of the email.'
+
+ field :email,
+ GraphQL::Types::String,
+ null: false,
+ description: 'Email address.'
+
+ field :confirmed_at,
+ Types::TimeType,
+ null: true,
+ description: 'Timestamp the email was confirmed.'
+
+ field :created_at,
+ Types::TimeType,
+ null: false,
+ description: 'Timestamp the email was created.'
+
+ field :updated_at,
+ Types::TimeType,
+ null: false,
+ description: 'Timestamp the email was last updated.'
+ end
+ end
+end