You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Join-Monster with join-monster-graphql-tools-adapter -Mysql (mariaDB), Knex.
My "problem" is something like do a join of a query to get a name of the product based on the ID of a product through a foreign column in another table. I was able to do it the standard way, but the data does not stay as I would like to consume, see the example below.
PS. I can live the way I'm doing if it's not possible. Or maybe I'm just lost xD
Note: Only "name" (Foreign column. Regarding the current query column) would be the focus of my question. By understanding how I could get data from "name" I turn to the rest down. All other things like "Where", "Limit" and etc are already in place.
PS. What I'm looking for would be something like this allusion.
name: {type: name// I'm using apollo this crazy thing would never happen// I'm making an allusion with "Including Data From the Junction"},details: {sqlTable: 'Ps_product_lang',include: {name: {sqlColumn: 'name'},sqlJoin: {... joinsomeforeigntable}}}
First the ideal
query{feedByIDcategory(id_category_default: "2"){idname// This data is in another table. available_dateconditionshow_pricedate_add
date_upd
}}
query{feedByIDcategory(id_category_default: "2"){iddetails{
name
}// This is a sub query in another table through a join. It is not desiredavailable_dateconditionshow_pricedate_add
date_upd
}}
details: {sqlJoin: (ThisTable,Ps_product_lang)=>` (${ThisTable}.id_product = ${Ps_product_lang}.id_product AND ${Ps_product_lang}.id_lang = 1 AND ${Ps_product_lang}.id_shop = 1)`,},
I added below just by reference the SQL I use to get data (without the Join-Monster, by SequelPro)
SELECT SQL_CALC_FOUND_ROWS
pl.`name`AS`name`,
cp.`position`AS`position`FROM`ps_product` p
LEFT JOIN`ps_product_lang` pl ON (pl.`id_product`= p.`id_product`AND pl.`id_lang`=1AND pl.`id_shop`=1)
INNER JOIN`ps_category_product` cp ON (cp.`id_product`= p.`id_product`AND cp.`id_category`=3);
The text was updated successfully, but these errors were encountered:
Hi, greetings
I'm using Join-Monster with join-monster-graphql-tools-adapter -Mysql (mariaDB), Knex.
My "problem" is something like do a join of a query to get a name of the product based on the ID of a product through a foreign column in another table. I was able to do it the standard way, but the data does not stay as I would like to consume, see the example below.
PS. I can live the way I'm doing if it's not possible. Or maybe I'm just lost xD
Note: Only "name" (Foreign column. Regarding the current query column) would be the focus of my question. By understanding how I could get data from "name" I turn to the rest down. All other things like "Where", "Limit" and etc are already in place.
PS. What I'm looking for would be something like this allusion.
First the ideal
The result should be this
Then the current result
Example of my join
I added below just by reference the SQL I use to get data (without the Join-Monster, by SequelPro)
The text was updated successfully, but these errors were encountered: