2023-03-20 07:29:19 +00:00
|
|
|
export const login = `
|
|
|
|
mutation Login($facebookId:String,$email:String,$password:String,$type:String!,$appleId:String,$name:String,$notificationToken:String){
|
|
|
|
login(facebookId:$facebookId,email:$email,password:$password,type:$type,appleId:$appleId,name:$name,notificationToken:$notificationToken){
|
|
|
|
userId
|
|
|
|
token
|
2023-03-29 07:52:59 +00:00
|
|
|
is_active
|
2023-03-20 07:29:19 +00:00
|
|
|
tokenExpiration
|
|
|
|
name
|
|
|
|
email
|
|
|
|
phone
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const categories = `
|
|
|
|
{
|
|
|
|
categories{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
img_menu
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const foods = `
|
|
|
|
query FoodByCategory($category:String!,$onSale:Boolean,$inStock:Boolean,$min:Float,$max:Float,$search:String){
|
|
|
|
foodByCategory(category:$category,onSale:$onSale,inStock:$inStock,min:$min,max:$max,search:$search){
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
variations{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
price
|
|
|
|
discounted
|
|
|
|
addons{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
quantity_minimum
|
|
|
|
quantity_maximum
|
|
|
|
options{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
price
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
category{_id}
|
|
|
|
img_url
|
|
|
|
stock
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const createUser = `
|
|
|
|
mutation CreateUser($facebookId:String,$phone:String,$email:String,$password:String,$name:String,$notificationToken:String,$appleId:String){
|
|
|
|
createUser(userInput:{
|
|
|
|
facebookId:$facebookId,
|
|
|
|
phone:$phone,
|
|
|
|
email:$email,
|
|
|
|
password:$password,
|
|
|
|
name:$name,
|
|
|
|
notificationToken:$notificationToken,
|
|
|
|
appleId:$appleId
|
|
|
|
}){
|
|
|
|
userId
|
|
|
|
token
|
|
|
|
tokenExpiration
|
|
|
|
name
|
|
|
|
email
|
|
|
|
phone
|
|
|
|
notificationToken
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const updateUser = `
|
2023-03-29 07:52:59 +00:00
|
|
|
mutation UpdateUser($name:String!,$phone:String!,$is_active:Boolean!){
|
|
|
|
updateUser(updateUserInput:{name:$name,phone:$phone,is_active:$is_active}){
|
2023-03-20 07:29:19 +00:00
|
|
|
_id
|
|
|
|
name
|
|
|
|
phone
|
2023-03-29 07:52:59 +00:00
|
|
|
is_active
|
2023-03-20 07:29:19 +00:00
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const updateNotificationStatus = `
|
|
|
|
mutation UpdateNotificationStatus($offerNotification:Boolean!,$orderNotification:Boolean!){
|
|
|
|
updateNotificationStatus(offerNotification:$offerNotification,orderNotification:$orderNotification){
|
|
|
|
_id
|
|
|
|
notificationToken
|
|
|
|
is_order_notification
|
|
|
|
is_offer_notification
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
export const profile = `
|
|
|
|
query{
|
|
|
|
profile{
|
|
|
|
_id
|
|
|
|
name
|
|
|
|
phone
|
|
|
|
email
|
2023-03-29 07:52:59 +00:00
|
|
|
is_active
|
|
|
|
|
2023-03-20 07:29:19 +00:00
|
|
|
notificationToken
|
|
|
|
is_order_notification
|
|
|
|
is_offer_notification
|
|
|
|
addresses{
|
|
|
|
_id
|
|
|
|
label
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
longitude
|
|
|
|
latitude
|
|
|
|
selected
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const order = `query Order($id:String!){
|
|
|
|
order(id:$id){
|
|
|
|
_id
|
|
|
|
delivery_address{
|
|
|
|
latitude
|
|
|
|
longitude
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
label
|
|
|
|
}
|
|
|
|
delivery_charges
|
|
|
|
order_id
|
|
|
|
user{
|
|
|
|
_id
|
|
|
|
phone
|
|
|
|
}
|
|
|
|
items{
|
|
|
|
_id
|
|
|
|
food{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
category{
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
description
|
|
|
|
img_url
|
|
|
|
|
|
|
|
}
|
|
|
|
variation{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
price
|
|
|
|
}
|
|
|
|
addons{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
quantity_minimum
|
|
|
|
quantity_maximum
|
|
|
|
options{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
price
|
|
|
|
}
|
|
|
|
}
|
|
|
|
quantity
|
|
|
|
}
|
|
|
|
payment_status
|
|
|
|
payment_method
|
|
|
|
order_amount
|
|
|
|
paid_amount
|
|
|
|
order_status
|
|
|
|
status_queue{
|
|
|
|
pending
|
|
|
|
preparing
|
|
|
|
picked
|
|
|
|
delivered
|
|
|
|
cancelled
|
|
|
|
}
|
|
|
|
createdAt
|
|
|
|
review{
|
|
|
|
_id
|
|
|
|
rating
|
|
|
|
description
|
|
|
|
}
|
|
|
|
rider{
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const myOrders = `query Orders($offset:Int){
|
|
|
|
orders(offset:$offset){
|
|
|
|
_id
|
|
|
|
delivery_address{
|
|
|
|
latitude
|
|
|
|
longitude
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
label
|
|
|
|
}
|
|
|
|
delivery_charges
|
|
|
|
order_id
|
|
|
|
user{
|
|
|
|
_id
|
|
|
|
phone
|
|
|
|
}
|
|
|
|
|
|
|
|
items{
|
|
|
|
_id
|
|
|
|
food{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
category{
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
description
|
|
|
|
img_url
|
|
|
|
}
|
|
|
|
variation{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
price
|
|
|
|
}
|
|
|
|
addons{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
quantity_minimum
|
|
|
|
quantity_maximum
|
|
|
|
options{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
price
|
|
|
|
}
|
|
|
|
}
|
|
|
|
quantity
|
|
|
|
}
|
|
|
|
payment_status
|
|
|
|
payment_method
|
|
|
|
order_amount
|
|
|
|
paid_amount
|
|
|
|
order_status
|
|
|
|
status_queue{
|
|
|
|
pending
|
|
|
|
preparing
|
|
|
|
picked
|
|
|
|
delivered
|
|
|
|
cancelled
|
|
|
|
}
|
|
|
|
createdAt
|
|
|
|
review{
|
|
|
|
_id
|
|
|
|
rating
|
|
|
|
description
|
|
|
|
}
|
|
|
|
rider{
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// can we get userId from request instead??
|
|
|
|
// needs research
|
|
|
|
//
|
|
|
|
|
|
|
|
export const orderStatusChanged = `subscription OrderStatusChanged($userId:String!){
|
|
|
|
orderStatusChanged(userId:$userId)
|
|
|
|
{
|
|
|
|
userId
|
|
|
|
origin
|
|
|
|
order{
|
|
|
|
_id
|
|
|
|
delivery_address{
|
|
|
|
latitude
|
|
|
|
longitude
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
label
|
|
|
|
}
|
|
|
|
delivery_charges
|
|
|
|
order_id
|
|
|
|
user{
|
|
|
|
_id
|
|
|
|
phone
|
|
|
|
}
|
|
|
|
|
|
|
|
items{
|
|
|
|
_id
|
|
|
|
food{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
category{
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
description
|
|
|
|
img_url
|
|
|
|
}
|
|
|
|
variation{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
price
|
|
|
|
}
|
|
|
|
addons{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
quantity_minimum
|
|
|
|
quantity_maximum
|
|
|
|
options{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
price
|
|
|
|
}
|
|
|
|
}
|
|
|
|
quantity
|
|
|
|
}
|
|
|
|
payment_status
|
|
|
|
payment_method
|
|
|
|
order_amount
|
|
|
|
paid_amount
|
|
|
|
order_status
|
|
|
|
status_queue{
|
|
|
|
pending
|
|
|
|
preparing
|
|
|
|
picked
|
|
|
|
delivered
|
|
|
|
cancelled
|
|
|
|
}
|
|
|
|
createdAt
|
|
|
|
review{
|
|
|
|
_id
|
|
|
|
rating
|
|
|
|
description
|
|
|
|
}
|
|
|
|
rider{
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// status queue??
|
|
|
|
// can we use address id instead of address object, then get the address on backend??
|
|
|
|
//
|
|
|
|
export const placeOrder = `
|
|
|
|
mutation PlaceOrder($orderInput:[OrderInput!]!,$paymentMethod:String!,$couponCode:String,$address:AddressInput!){
|
|
|
|
placeOrder(orderInput: $orderInput,paymentMethod:$paymentMethod,couponCode:$couponCode,address:$address) {
|
|
|
|
_id
|
|
|
|
order_id
|
|
|
|
delivery_address{
|
|
|
|
latitude
|
|
|
|
longitude
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
label
|
|
|
|
}
|
|
|
|
delivery_charges
|
|
|
|
items{
|
|
|
|
_id
|
|
|
|
food{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
category{
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
description
|
|
|
|
img_url
|
|
|
|
}
|
|
|
|
variation{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
price
|
|
|
|
}
|
|
|
|
addons{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
quantity_minimum
|
|
|
|
quantity_maximum
|
|
|
|
options{
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
price
|
|
|
|
}
|
|
|
|
}
|
|
|
|
quantity
|
|
|
|
}
|
|
|
|
user {
|
|
|
|
_id
|
|
|
|
phone
|
|
|
|
email
|
|
|
|
}
|
|
|
|
rider{
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
payment_status
|
|
|
|
payment_method
|
|
|
|
paid_amount
|
|
|
|
order_amount
|
|
|
|
order_status
|
|
|
|
status_queue{
|
|
|
|
pending
|
|
|
|
preparing
|
|
|
|
picked
|
|
|
|
delivered
|
|
|
|
cancelled
|
|
|
|
}
|
|
|
|
createdAt
|
|
|
|
review{
|
|
|
|
_id
|
|
|
|
rating
|
|
|
|
description
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const reviewOrder = `mutation ReviewOrder(
|
|
|
|
$orderId:String!,
|
|
|
|
$rating:Int!,
|
|
|
|
$description:String
|
|
|
|
){
|
|
|
|
reviewOrder(reviewInput:{
|
|
|
|
orderId:$orderId,
|
|
|
|
rating:$rating,
|
|
|
|
description:$description
|
|
|
|
}){
|
|
|
|
_id
|
|
|
|
order_id
|
|
|
|
review{
|
|
|
|
_id
|
|
|
|
rating
|
|
|
|
description
|
|
|
|
}
|
|
|
|
createdAt
|
|
|
|
updatedAt
|
|
|
|
is_active
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// use this to push token instead of login, signup mutation?
|
|
|
|
// needs research
|
|
|
|
//
|
|
|
|
export const pushToken = `mutation PushToken($token:String!){
|
|
|
|
pushToken(token:$token){
|
|
|
|
_id
|
|
|
|
notificationToken
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const getConfiguration = `query Configuration{
|
|
|
|
configuration{
|
|
|
|
_id
|
|
|
|
currency
|
|
|
|
currency_symbol
|
|
|
|
delivery_charges
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const foodByIds = `query FoodByIds($ids:[String!]!){
|
|
|
|
foodByIds(ids: $ids) {
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
img_url
|
|
|
|
stock
|
|
|
|
category {
|
|
|
|
_id
|
|
|
|
}
|
|
|
|
variations {
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
price
|
|
|
|
discounted
|
|
|
|
addons {
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
quantity_minimum
|
|
|
|
quantity_maximum
|
|
|
|
options {
|
|
|
|
_id
|
|
|
|
title
|
|
|
|
description
|
|
|
|
price
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const getCoupon = `mutation Coupon($coupon:String!){
|
|
|
|
coupon(coupon:$coupon){
|
|
|
|
_id
|
|
|
|
code
|
|
|
|
discount
|
|
|
|
enabled
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const deleteAddress = `mutation DeleteAddress($id:ID!){
|
|
|
|
deleteAddress(id:$id){
|
|
|
|
_id
|
|
|
|
addresses{
|
|
|
|
_id
|
|
|
|
label
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
longitude
|
|
|
|
latitude
|
|
|
|
selected
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const createAddress = `mutation CreateAddress($addressInput:AddressInput!){
|
|
|
|
createAddress(addressInput:$addressInput){
|
|
|
|
_id
|
|
|
|
addresses{
|
|
|
|
_id
|
|
|
|
label
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
longitude
|
|
|
|
latitude
|
|
|
|
selected
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const editAddress = `mutation EditAddress($addressInput:AddressInput!){
|
|
|
|
editAddress(addressInput:$addressInput){
|
|
|
|
_id
|
|
|
|
label
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
longitude
|
|
|
|
latitude
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const changePassword = `mutation ChangePassword($oldPassword:String!,$newPassword:String!){
|
|
|
|
changePassword(oldPassword:$oldPassword,newPassword:$newPassword)
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const forgotPassword = `mutation ForgotPassword($email:String!){
|
|
|
|
forgotPassword(email:$email){
|
|
|
|
result
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const selectAddress = `mutation SelectAddress($id:String!){
|
|
|
|
selectAddress(id:$id){
|
|
|
|
_id
|
|
|
|
addresses{
|
|
|
|
_id
|
|
|
|
label
|
|
|
|
delivery_address
|
|
|
|
details
|
|
|
|
longitude
|
|
|
|
latitude
|
|
|
|
selected
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const subscriptionRiderLocation = `subscription SubscriptionRiderLocation($riderId:String!){
|
|
|
|
subscriptionRiderLocation(riderId:$riderId) {
|
|
|
|
_id
|
|
|
|
location {
|
|
|
|
latitude
|
|
|
|
longitude
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|
2023-03-20 07:29:19 +00:00
|
|
|
|
|
|
|
export const rider = `query Rider($id:String){
|
|
|
|
rider(id:$id){
|
|
|
|
_id
|
|
|
|
location {
|
|
|
|
latitude
|
|
|
|
longitude
|
|
|
|
}
|
|
|
|
}
|
2023-03-29 07:52:59 +00:00
|
|
|
}`;
|