Get company data by maincontact ID

Get company data by maincontact ID

DomenicoToma
Shopify Partner
4 0 0

I have a Shopify Plus store and I need to retrieve the company by its main contact specified by the customer ID.

 

I tried this query but I keep receiving the list of all companies:

$query = <<<GRAPHQL
{
companies(query:"mainContact.customer.id:XXXXXX", first:12) {
edges {
node {
id
name
}
}
}
}
GRAPHQL;
 
What is the correct way to query?

Thanks everybody!
Replies 0 (0)