GroceriStar / graphql-server

Second generation of groceristar server
GNU General Public License v3.0
1 stars 3 forks source link

Grocery-Department relation #11

Open nadaa opened 5 years ago

nadaa commented 5 years ago

It is many-many, right? is the id_1 in Grocery table refer to department_id?

atherdon commented 5 years ago

one grocery list has many departments.

maybe we'll change something in future, but for now it's ok relation

nadaa commented 5 years ago

I think we need to add grocery_id to the department?

atherdon commented 5 years ago

What if department are not attached to any of grocery lists? not agree. assume that we have a department Dairy. and your grocery list has it When i create a brand new list and create a Diary department - then we'll have 2 Diary at deparment database with just different grocery_id`s?

Give me more details. What do you trying to do or what method are you trying to build

nadaa commented 5 years ago

I am trying to understand the db relations, so I can reflect the same on graphql. Does it matter to know what departments a groceryist includes?

atherdon commented 5 years ago

I understand. it's not an easy question. Let's do a quick way - grocery object should have an array with departments.

Btw, maybe this visual will help a bit: https://github.com/GroceriStar/creative/blob/master/fetch-examples/readme.md

atherdon commented 5 years ago

we made some updates in our static-data repository and also add some new methods to this project. Buzz me when you'll have time - i want to explain what we actually did and how it can help you