chingu-voyage5 / Bears-Team-30

Add-project-description-here | Voyage-5 | chingu.io
0 stars 0 forks source link

Test GraphQL Queries and Mutations. #14

Open ibrahimbutt opened 6 years ago

ibrahimbutt commented 6 years ago

Ensure queries and mutations are working as expected as backend features are added/removed, without having to do the manual work.

is343 commented 6 years ago

I hard coded a a call from the client side using the createOrder mutation. I'm able to create an order, but for some reason I keep getting responses that 'discountCards' is required.

I'm at a loss because it doesn't seem required in your code, or in graphiql. I'm able to create orders with the required fields + discountCards.

is343 commented 6 years ago

from the console after I attempt to make the request without any discountCards:

[GraphQL error]: Message: Order validation failed: discountCards: Path discountCards is required., Location: [object Object], Path: createOrder

ibrahimbutt commented 6 years ago

@is343 I've fixed discountCards being required. See PR #21.

is343 commented 6 years ago

New issue regarding stringified array of 'menuItem' objects. The backend is only including the first object, and leaving off the rest of them.

For example: submitted stringified array: -> [{"name":"Chicken Curry","price":16,"category":"adult","foodId":"5b1a9b55595cd90c6a9ce49f","qty":2},{"name":"Soup","price":2,"category":"soup","foodId":"5b1c9e8f17c12677ecbf9261","qty":1},{"name":"Chicken Curry","price":16,"category":"child","foodId":"5b1c9ee017c12677ecbf9262","qty":3}]

but upon inspection of the db, the created order only includes one item: -> "menuItems": [ { "foodId": "5b1a9b55595cd90c6a9ce49f", "name": "Chicken Curry", "price": 16, "category": "adult", "qty": 2 } ],

ibrahimbutt commented 6 years ago

@is343 fixed in #29.