null, empty lists or fewer results. Check the customer’s company membership and location roles before changing GraphQL.On this page
Why this looks like a broken query
There is no schema change. Shopify changed authorization behavior. CompanyContact.locations returns an empty list unless the contact belongs to the current customer. For the current customer’s contact, location access is limited to locations where the customer has a role, including via Company.locations and companyLocation(id:). For a location where the customer lacks a role, taxIdentifier, contacts and roleAssignments may be null or empty.
When a customer is removed from a company, order(id:) and draftOrder(id:) no longer expose that company’s records. customer.orders and customer.draftOrders exclude them, while personal orders remain accessible.
Fix the account experience, not the access rules
- Confirm which customer is authenticated and which company/location roles they currently hold.
- Separate personal orders from company orders in UI state and caches.
- Treat an empty company list as a valid authorization outcome, not a reason to retry indefinitely.
- Render location-specific controls only when the customer can access the location; do not show a stale location selector from cached data.
- Invalidate account-side cached company/order data when membership changes. Never use a privileged Admin API token in the browser to bypass the customer’s permissions.
Example: an account dashboard after staff removal
A purchasing employee used to see invoices for a company location. After the merchant removes that employee from the company, the dashboard’s company order history becomes empty while personal purchases remain. That is expected authorization behavior, not an API outage. Show a neutral “No accessible company orders” state and direct legitimate access requests to the company’s administrator.
- Use two test customers: one with an assigned company-location role and one without.
- Run the same location query for each and compare accessible fields.
- Verify the authorized customer can see only their permitted locations.
- Remove a test customer’s company membership and confirm company orders and draft orders disappear, including direct-ID lookups.
- Confirm personal orders remain visible and the UI clears stale cached company data.
- Restore membership and verify access returns only where explicitly authorized.

