# User
This model defines the properties of a single user. Every user has a uid
which uniquely identifies them. It also includes other information such as email and phone number.
As shown in the Profile tab inside the guide, some fields are required to formulate a user object.
Properties you would find in the user model are:
uid
- An integer value that uniquely identifies the current user.
first_name required
- Contains the first name of the user
middle_name
- Contains the middle name of the user. This field is an optional field as some countries don't have this.
last_name required
- Contains the last name of the user
email required
- Contains the email address of the user. It is a required field
role
- Defines the role of the user. The higher the better.
role > 3
are considered as admin users
phone_number
- Contains the phone number of the user
username required
- Defines the username of the user. Can be used for signing in.
last_login_time
- Timestamp of the last login time of the user.
country required
- The ISO-2 country code of the user's country.
last_location unused
- This property doesn't provide any value at this point.
password_hash required
- The hashed password value of the string user provided when signing up.
- We currently use
bcrypt
for hashing with 10 round folding.
is_verified
- This will hold the status of the email verification for the user.
token
- The current token being used for authenticating the user. Can be used for verification purposes
google_id
- If the account is liked to some google account, this will be the add of the linked account.
facebook_id
- If the account is liked to some facebook account, this will be the add of the linked account.
twitter_id
- If the account is liked to some twitter account, this will be the add of the linked account.
github_id
- If the account is liked to some github account, this will be the add of the linked account.
linkedin_id
- If the account is liked to some linkedin account, this will be the add of the linked account.
telegram_id
- If the account is liked to some telegram account, this will be the add of the linked account.
# Graphql Schema
The gql schema for this model looks like
type User {
uid: Int!,
first_name: String!,
middle_name: String,
last_name: String!,
email: String!,
username: String!,
phone_number: String,
interests: [Interest],
country: String,
is_verified: Boolean,
token: String,
last_location: String,
google_id: String,
facebook_id: String,
twitter_id: String,
github_id: String,
linkedin_id: String,
telegram_id: String
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20