Run
yarn install -g typescript or npm install -g typescript
yarn install or npm i
Create a .env file in the root directory and paste in this
MONGO_URI=
JWT_SECRET=
CLIENT_ID =
HOST=
CLIENT_SECRET =
REDIRECT_URI =
REFRESH_TOKEN =
username =
password =
CLOUDINARY_API_KEY =
CLOUDINARY_API_SECRET =
CLOUDINARY_NAME =
- User Signup
- User LogIn
- User Verify Email
- User Request IsGuider Verification
- User Update Profile
- User fetch User Profile
- User Update Profile Picture
- User Remove Profile Picture
- User Change Password
Body
mutation Example {
signUp(
input:{ firstname:"Habimana",
lastname:"sharif" ,
username:"sharif" ,
password:"test123",
email:"[email protected]"
}
){
firstname
lastname
username
password
email
profilePicture
isVerified
role
bio
website
createdAt
}
}Response
{
"data": {
"signUp": {
"firstname": "Habimana",
"lastname": "sharif",
"username": "ty_flex",
"password": "$2b$10$LoiQg9wiSL4jMcLUNVcAIudrl5k34WKyivvy2ZmEX1uc173kTbqTS",
"email": "[email protected]",
"profilePicture": "none",
"isVerified": "false",
"role": null,
"bio": "**No Biography**",
"website": null,
"createdAt": "1635290132898"
}
}
}Body
mutation ex{
logIn(
account:"[email protected]"
password:"drop."
){
username,
email,
token
}
}Response
{
"data": {
"logIn": {
"username": "keleva96",
"email": "[email protected]",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Indpenp5c2hhcmlmaXZrQGdtYWlsLmNvbSIsImlkIjoiNjE5ZTZjNzRkYjdiMjc3NTU3MGQyODM4Iiwicm9sZSI6InVzZXIiLCJpYXQiOjE2Mzc3NzMwMjJ9.CTJmnqpG7TWYSDg8t2QzOkpdRg3rLgZo8n7lfI6t6Is"
}
}
}Body
mutation exp{
verifyEmail(
token:"eyJhbGciOiJIUzI1NiJ9.d2l6enlzaGFyaWZpdmtAZ21haWwuY29t.eJG2votBkpx957dAHHhfAoLiJLnVxb6CVU8WyX0jD7E"
)
{
email
}
}Response
{
"data": {
"verifyEmail": {
"email": "[email protected]"
}
}
}Body
mutation ex{
AdminLogin(
username:"admin",
password:"admin"
){
role
token
}Response
{
"data": {
"AdminLogin": {
"role": "admin",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYWRtaW4iLCJpYXQiOjE2Mzg4NzY0NjZ9.eUzAxkb3LkpOxNKXUgNAQdgTKR9oDNV8N7kr33IQv-4"
}
}
}Body
mutation ex{
verifyGuider(
cirtificate:"/home/ty-flex/Downloads/m8c20gchf7231.jpg"
){
message
}
} {
"data": {
"verifyGuider": {
"message": "verification successfully requested"
}
}
}Body
query ex {
verifications{
cirtificate,
email,
username,
}
}Response
{
"data": {
"verifications": [
{
"cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639554589/f1ktspfks8qwytm3bpjd.jpg",
"email": "[email protected]",
"username": "josue"
},
{
"cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639437711/jy0yghkwk4mxu6cek36d.jpg",
"email": "[email protected]",
"username": "josue"
},
{
"cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639317929/hrul2pnjiajjrwtw8urw.jpg",
"email": "[email protected]",
"username": "josue"
},
{
"cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639317303/b2bpvcxk4iiedomuw19k.jpg",
"email": "[email protected]",
"username": "josue"
},
{
"cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639316082/ucoawsw80irlauvqe7ga.jpg",
"email": "[email protected]",
"username": "josue"
},
{
"cirtificate": "https://res.cloudinary.com/trio-code/image/upload/v1639309047/ycmeodsnqamcpc80xykz.jpg",
"email": "[email protected]",
"username": "josue"
},
]
}
}Body
mutation ex{
adminverify(
email:"[email protected]"
){
username,
email,
isGuider,
firstname,
lastname,
isVerified
}
}Response
{
"data": {
"adminverify": {
"username": "josue",
"email": "[email protected]",
"isGuider": "true",
"firstname": "Igiraneza",
"lastname": "Josue",
"isVerified": "true"
}
}
}body
mutation ex{
createPost(
input:{
caption:"To night was lit"
location:"Kigali,Rwanda"
content:["/home/ty-flex/Downloads/m8c20gchf7231.jpg","/home/ty-flex/Downloads/m8c20gchf7231.jpg","/home/ty-flex/Downloads/m8c20gchf7231.jpg"]
}
){
content
location
}
}Response
{
"data": {
"createPost": {
"content": [
"https://res.cloudinary.com/trio-code/image/upload/v1639757067/p6muxrurlher5pb2ryak.jpg",
"https://res.cloudinary.com/trio-code/image/upload/v1639757077/urqyb3upmgurlz64baou.jpg",
"https://res.cloudinary.com/trio-code/image/upload/v1639757082/wfrpe94lfimca37poiup.jpg"
],
"location": "Kigali,Rwanda"
}
}
}Body
query ex{
posts{
_id
owner{
_id
username
profilePicture
}
likes{
username
profilePicture
}
isLiked
likesNo
content
commentNo
comments{
user{
username
profilePicture
}
content
}
location
createdAt
}
}Response
{
"data": {
"posts": [
{
"_id": "61cab12e91f1cd2ef9a16f26",
"owner": {
"_id": "61c5ccf3a197b25038a11bad",
"username": "kelevaj",
"profilePicture": "none"
},
"likes": [
{
"username": "kelevaj",
"profilePicture": "none"
}
],
"isLiked": true,
"likesNo": 1,
"content": [
"https://res.cloudinary.com/trio-code/image/upload/v1640673556/bsj5cgor6tybtjynb6go.jpg",
"https://res.cloudinary.com/trio-code/image/upload/v1640673570/wkqwlhhorynijfmad0lr.jpg",
"https://res.cloudinary.com/trio-code/image/upload/v1640673581/ylj4yhjauuxzxw71ovug.jpg"
],
"commentNo": 2,
"comments": [
{
"user": {
"username": "kelevaj",
"profilePicture": "none"
},
"content": "I would love to pay a vist"
},
{
"user": {
"username": "sheezy",
"profilePicture": "none"
},
"content": "this is awesome"
}
],
"location": "Kigali,Rwanda",
"createdAt": 1640673582673
}
]
}
}Body
mutation ex{
deletePost(id:"61bcbe59c3cc2b437cfcbb26")
{
message
}
}Response
{
"data": {
"deletePost": {
"message": " Post Deleted Successfully"
}
}
}Body
mutation ex{
likePost(postId:"61c325c31b0cf98eda97b771"){
message
}
}Response
{
"data": {
"likePost": {
"message": " Post liked Successfully"
}
}
}Body
mutation ex{
updateUser(
input:{
firstname:"Tyflex"
lastname:"umuhuza"
bio:"tyflex is cool"
}
){
bio
firstname
lastname
}
}Response
{
"data": {
"updateUser": {
"bio": "tyflex is cool",
"firstname": "Tyflex",
"lastname": "umuhuza"
}
}
}Body
mutation ex{
followUser(userId:"61c5d14e7971b5c9a44d78a8")
{
message
}
}Response
{
"data": {
"likePost": {
"message": " User Followed Successfully"
}
}
}Body
mutation ex{
unfollowUser(userId:"61c5d14e7971b5c9a44d78a8")
{
message
}
}Response
{
"data": {
"likePost": {
"message": " User UnFollowed Successfully"
}
}
}Body
query ex {
userProfile(
userId:"61c5ccf3a197b25038a11bad"
){
username
firstname
lastname
bio
isGuider
isFollowing
isUser
posts{
_id
location
content
caption
isLiked
likesNo
createdAt
caption
likes{
username
profilePicture
}
}
followers
following
allFollowers{
username
profilePicture
}
allFollowing{
username
profilePicture
}
}
}Response
{
"data": {
"userProfile": {
"username": "kelevaj",
"firstname": "Umuhuza",
"lastname": "Clever",
"bio": "**No Biography**",
"isGuider": "true",
"isFollowing": false,
"isUser": true,
"posts": [
{
"_id": "61cab12e91f1cd2ef9a16f26",
"location": "Kigali,Rwanda",
"content": [
"https://res.cloudinary.com/trio-code/image/upload/v1640673556/bsj5cgor6tybtjynb6go.jpg",
"https://res.cloudinary.com/trio-code/image/upload/v1640673570/wkqwlhhorynijfmad0lr.jpg",
"https://res.cloudinary.com/trio-code/image/upload/v1640673581/ylj4yhjauuxzxw71ovug.jpg"
],
"caption": "To night was lit",
"isLiked": true,
"likesNo": 1,
"createdAt": 1640673582673,
"likes": [
{
"username": "kelevaj",
"profilePicture": "none"
}
]
}
],
"followers": 0,
"following": 1,
"allFollowers": [],
"allFollowing": [
{
"username": "sheezy",
"profilePicture": "none"
}
]
}
}
}Body
mutation ex {
updateProfilePicture(picture:"/media/ty-flex/files/greencard/CROPPED-_DSC3111.JPG"){
message
}
}Response
{
"data": {
"updateProfilePicture": {
"message": "Profile Picture Update successfully"
}
}
}Body
query ex{
fetchSinglePost(postId:"61cab12e91f1cd2ef9a16f26"){
_id
owner{
_id
username
profilePicture
}
likes{
username
profilePicture
}
isLiked
likesNo
content
commentNo
comments{
user{
username
profilePicture
}
content
}
location
createdAt
}
}Response
{
"data": {
"fetchSinglePost": {
"_id": "61cab12e91f1cd2ef9a16f26",
"owner": {
"_id": "61c5ccf3a197b25038a11bad",
"username": "kelevaj",
"profilePicture": "none"
},
"likes": [
{
"username": "kelevaj",
"profilePicture": "none"
}
],
"isLiked": true,
"likesNo": 1,
"content": [
"https://res.cloudinary.com/trio-code/image/upload/v1640673556/bsj5cgor6tybtjynb6go.jpg",
"https://res.cloudinary.com/trio-code/image/upload/v1640673570/wkqwlhhorynijfmad0lr.jpg",
"https://res.cloudinary.com/trio-code/image/upload/v1640673581/ylj4yhjauuxzxw71ovug.jpg"
],
"commentNo": 2,
"comments": [
{
"user": {
"username": "kelevaj",
"profilePicture": "none"
},
"content": "I would love to pay a vist"
},
{
"user": {
"username": "sheezy",
"profilePicture": "none"
},
"content": "this is awesome"
}
],
"location": "Kigali,Rwanda",
"createdAt": 1640673582673
}
}
}Body
mutation ex {
removeProfilePicture{
message
}
}Response
{
"data": {
"removeProfilePicture": {
"message": "Profile Picture Removed successfully"
}
}
}Body
mutation ex{
changePassword(
oldPassword:"123test"
newPassword:"test123"
){
message
}
}Response
{
"data": {
"changePassword": {
"message": "Password Changed Succefully"
}
}
}Body
mutation ex {
unLikePost(postId:"61cab12e91f1cd2ef9a16f26"){
message
}
}Response
{
"data": {
"unLikePost": {
"message": "Post Unliked Successfully"
}
}
}Body
mutation ex{
searchUser(
search:"sheezy"
){
firstname
lastname
username
password
email
profilePicture
isVerified
role
bio
website
createdAt
}
}Response
"searchUser": [
{
"firstname": "Habiman",
"lastname": "Sharif",
"username": "sheezy7",
"password": null,
"email": "[email protected]",
"profilePicture": "none",
"isVerified": "true",
"role": null,
"bio": "**No Biography**",
"website": null,
"createdAt": null
},
{
"firstname": "Habiman",
"lastname": "Sharif",
"username": "sheezy",
"password": null,
"email": "[email protected]",
"profilePicture": "none",
"isVerified": "true",
"role": null,
"bio": "**No Biography**",
"website": null,
"createdAt": null
}
]
}
}Body
mutation ex {
commentPost(
postId: "61cab12e91f1cd2ef9a16f26"
content:"this is awesome"
)
{
message
}Response
{
"data": {
"commentPost": {
"message": "comment created successfully"
}
}
}