Skip to content

API: OrderToProduct #10

@Austin2Shih

Description

@Austin2Shih

OrderToProduct is the join table for Orders and Products (many to many relationship)
This will have order_id, product_id, those together can make a unique key so you don't need an id field.

Make sure to also add in a field: quantity which will be used to determine how much of each Product is in the Order.

Edit the schema, resolvers, services for Order to support addProductToOrder mutation which takes in a quantity as an argument. If not specified then just default to quantity of 1.

Build out resolver for Order's products field which will return a list of ProductQuantity.

Define ProductQuantity type in the Order typedef file. Make sure the resolver for the products field returns data in the form of ProductQuantity list

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions