Advertisement
Guest User

datamodel.graphql

a guest
Jan 4th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. enum Permission {
  2. ADMIN
  3. USER
  4. ITEMCREATE
  5. ITEMUPDATE
  6. ITEMDELETE
  7. PERMISSIONUPDATE
  8. }
  9.  
  10. type User {
  11. id: ID! @unique
  12. name: String!
  13. email: String! @unique
  14. password: String!
  15. resetToken: String
  16. resetTokenExpiry: Float
  17. permissions: [Permission]
  18. cart: [CartItem!]!
  19. }
  20.  
  21. type Item {
  22. id: ID! @unique
  23. title: String!
  24. description: String!
  25. image: String
  26. largeImage: String
  27. price: Int!
  28. user: User!
  29. category: Category!
  30. }
  31.  
  32. type Category {
  33. id: ID! @unique
  34. name: String!
  35. body: String!
  36. user: User!
  37. # subCategory: [SubCategory]!
  38. # shop: Shop!
  39. }
  40.  
  41. type CartItem {
  42. id: ID! @unique
  43. quantity: Int! @default(value: 1)
  44. item: Item # relationship to Item
  45. user: User! # relationship to User
  46. }
  47.  
  48. type OrderItem {
  49. id: ID! @unique
  50. title: String!
  51. description: String!
  52. image: String!
  53. largeImage: String!
  54. price: Int!
  55. quantity: Int! @default(value: 1)
  56. user: User
  57. }
  58.  
  59. type Order {
  60. id: ID! @unique
  61. items: [OrderItem!]!
  62. total: Int!
  63. user: User!
  64. charge: String!
  65. createdAt: DateTime!
  66. updatedAt: DateTime!
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement