graphcraft icon indicating copy to clipboard operation
graphcraft copied to clipboard

Multiple joins skip relations (data missing)

Open jor3l opened this issue 4 years ago • 5 comments

Query without joins runs fine (super slow tho, hundreds of queries run sequentially): image And with a join it simply ignores that find for some reason and ends up not returning data for that node: image

Note that the first join at the category level is working as expected, a single query returns all the categories + products. I wan't the same for all the product options in a product but it just works by running 1:N queries. Any idea what I'm doing wrong?

jor3l avatar Sep 05 '21 19:09 jor3l

Enabling dataloader actually helped A LOT without using joins

jor3l avatar Sep 05 '21 20:09 jor3l

I would not recommend using joins unless it's necessary. Joins will make query slow since it uses include option from sequelize. If you don't use joins, dataloader will kick in and will only run N+1 queries.

If you could explain what you are trying to achieve here, I will be able to suggest a solution.

alirizwan avatar Sep 05 '21 22:09 alirizwan

Hi @alirizwan, To come back to this I've had some similar issues where the joins are taking forever, So like @jor3l I've enabled the dataloader but noticed there are some issues around joins with null values. It significantly increased performance once enabled but some queries don't work. An example of an issue i'm getting is in the screenshot below.

devIssues

I don't know if this is similarly related to another issue other libraries have had previously around dataloaders and getting back the same error. For example

https://github.com/aerogear/graphback/issues/1859

Happy to have a call to discuss if anything's unclear or if you need more detail.

Thanks,

Lewis

lewismclennan avatar Jan 28 '22 10:01 lewismclennan

Hi @alirizwan, To come back to this I've had some similar issues where the joins are taking forever, So like @jor3l I've enabled the dataloader but noticed there are some issues around joins with null values. It significantly increased performance once enabled but some queries don't work. An example of an issue i'm getting is in the screenshot below.

devIssues

I don't know if this is similarly related to another issue other libraries have had previously around dataloaders and getting back the same error. For example

aerogear/graphback#1859

Happy to have a call to discuss if anything's unclear or if you need more detail.

Thanks,

Lewis

I think a call would be great. Let's discuss it and perhaps find a solution together :)

alirizwan avatar Jan 30 '22 16:01 alirizwan

@alirizwan - I've just emailed you to setup a call 👍🏻

lewismclennan avatar Jan 31 '22 09:01 lewismclennan