Issue: The GraphQL Admin API lacks a direct method to search customers by company name, unlike the REST API which supports this functionality.
Proposed Solutions:
GraphQL filtering approach: Query all customers and filter their addresses for company names—however, this proved ineffective as it returned an “Invalid search field” error when tested.
Hybrid REST + GraphQL method: Use the REST API to search by company and retrieve customer IDs, then pass those IDs to a GraphQL query to fetch related data (addresses, orders). This workaround is currently functional.
Customer segments: Suggested as an alternative since customer search filters are deprecated in GraphQL. However, company name doesn’t appear to be an available attribute for segment queries.
Current Status: The hybrid REST/GraphQL approach remains the working solution, though not ideal. The discussion remains open as no native GraphQL-only method exists for company-based customer searches.
Summarized with AI on November 6.
AI used: claude-sonnet-4-5-20250929.
In the Shopify GraphQL Admin API, there isn’t a direct way to search customers by their company name. The REST API does provide this capability, but the GraphQL API does not currently have an equivalent query parameter for searching customers by company. However, you can achieve a similar result by querying customers and filtering their addresses to check for the company name. Here is an example of how you might do this:
Thanks for the suggestion! What I ended up doing was using the REST API to search by company and then building a GraphQL customer query using the customer ids from REST. That way I can search by company and still use GraphQLs ability to load related data like addresses and orders.
I hadn’t thought of using customer segments. I found this list of attributes that can be queried. But company doesn’t appear to be one of them. What I have now is working well enough I guess. I probably just stick with that. Thanks for the suggestion.