The title says it pretty clearly.
The Order Object returned from the Admin REST API includes the “company” field, which in turn has an “id” (company.id) and “location_id” (company.location.id). Great! I need those for the app I’m writing.
However, REST is depricated so I’m trying to use GQL to do it instead. When I go to the documentation for the Order GQL object, company is not there!
I’ve tried using the Order.Customer.CompanyContactProfiles (which it seems, is supposed to return a List of “CompanyContact”) objects like in the following snippet, but it returns null when I put it in like this:
Query = @"
query getOrderById($id: ID!) {
order(id: $id) {
id
customer {
companyContactProfiles {
company {
id
}
}
}
}
and it errors when I try and feed it a “first: 10” argument like this:
Query = @"
query getOrderById($id: ID!) {
order(id: $id) {
id
customer {
companyContactProfiles(first: 10) {
edges {
node {
company {
id
}
}
}
}
}
}
}
So how do I get to that former Order.Company field that was accessible for the REST API?