Frugal-Foods/Frugal-Foods-BE

GraphQL: User's Store Items Query

Closed this issue · 0 comments

As a user of the API, I want to be able to retrieve a list of a user's store items based on the user id passed in.
{
userStoreItems(user: id) {
stores {
id
name
address
storeItems {
id
price - will be constant
itemName
photoUrl
quantity - user store item attribute
itemTotal - quantity * price
}
storeTotalPrice # all items at one particular store
}
grandTotalPrice # all items at all stores and all items
}
}

The endpoint should return the list of stores in JSON format, with each store containing the following fields:

  • id: A unique identifier for the store
  • name: The name of the store
  • address: The address of the store
    A nested list of store items that include:
  • storeItemId - unique identifier for the store item
  • price: The price of the store item
  • itemName: The name of the item
  • photoUrl - the url for the photo associated with that store's item
  • quantity - the quantity of that item
  • itemTotal - quantity * price
    Also included will be
  • storeTotalPrice - the total cost of all items at a particular store - this is included at the same level as stores attributes
  • grandTotalPrice - all items at all store's prices totaled - this is included at the same level as stores

Documentation: Update the README file so that the changes are reflected:

  • Query readme updated
  • Expected Response updated