To Query customer's assigned company location

am trying to query the customer details with shopify graphql
specifically the location of the company this customer is assigned to.

the green circled item

What should be the graph ql query ?

Thank you so much.

I’d be thinking something like

query MyQuery {
  customers(first: 10) {
    nodes {
      displayName
      companyContactProfiles {
        title
        company {
          name
          locations(first: 10) {
            nodes {
              shippingAddress {
                address1
                companyName
                city
              }
            }
          }
        }
      }
    }
  }
}

but what if the company have multiple location ?

which one of those location will be assigned to the customer ?

There will be 2 locations shown in Admin:
Here – “Frome Road” and “Test”

Apologies for not properly phrasing my question.

Example

Company 1

  • Location 1
  • Location 2
  • Location 3

Customer 1

  • Assigned location Location 1 of company Company 1 with Ordering only

What i want is Locations assigned to Customer 1

{
  customer(id: "gid://shopify/Customer/customer1") {
    displayName
    companyContactProfiles {
      company {
        locations(first: 10) {
          edges {
            node {
              id
              name
            }
          }
        }
      }
    }
  }
}

this returns

"customer": {
      "companyContactProfiles": [
        "displayName":"Customer1"
        {
          "company": {
            "locations": {
              "nodes": [
                {
                  "id": "gid://shopify/CompanyLocation/location1",
                  "name": "Location 1"
                },
                {
                  "id": "gid://shopify/CompanyLocation/location2",
                  "name": "Location 2"
                },
                {
                  "id": "gid://shopify/CompanyLocation/location3",
                  "name": "Location 3"
                },
              ]
            }
          }
        }
      ]
    }

this query returns all the locations of Company 1

i just saw another property called roleAssignments which seems to be behaving the way i want

so i ran this query

{
  customer(id: "gid://shopify/Customer/customer1") {
    displayName
    companyContactProfiles {
      roleAssignments(first: 2) {
        nodes {
          companyLocation{
            name
          }
          role {
            name
          }
        }
      }
    }
  }
}

and it gave me

 "customer": {
      "displayName": "Customer 1",
      "companyContactProfiles": [
        {
          "roleAssignments": {
            "nodes": [
              {
                "companyLocation": {
                  "name": "Location 1"
                },
                "role": {
                  "name": "Ordering only"
                }
              }
            ]
          }
        }
      ]
    }

Thank you so much for responding and looking into it